tizen 2.3.1 release tizen_2.3.1 submit/tizen_2.3.1/20150915.080951 tizen_2.3.1_release
authorjk7744.park <jk7744.park@samsung.com>
Tue, 8 Sep 2015 13:24:27 +0000 (22:24 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Tue, 8 Sep 2015 13:24:27 +0000 (22:24 +0900)
551 files changed:
.gitignore [new file with mode: 0644]
.mailmap [new file with mode: 0644]
CMakeLists.txt [new file with mode: 0644]
ChangeLog
ChangeLog.21
ChangeLog.23
ChangeLog.24 [new file with mode: 0644]
Jamfile
LICENSE [new file with mode: 0644]
LICENSE.GPL-2.0 [new file with mode: 0644]
README
README.git
TC/_export_env.sh [deleted file]
TC/_export_target_env.sh [deleted file]
TC/build.sh [deleted file]
TC/clean.sh [deleted file]
TC/config [deleted file]
TC/execute.sh [deleted file]
TC/testcase/Makefile [deleted file]
TC/testcase/tslist [deleted file]
TC/testcase/utc_ft_bench.c [deleted file]
TC/testcase/utc_ft_diff.c [deleted file]
TC/testcase/utc_ft_dump.c [deleted file]
TC/testcase/utc_ft_gamma.c [deleted file]
TC/testcase/utc_ft_grid.c [deleted file]
TC/testcase/utc_ft_lint.c [deleted file]
TC/testcase/utc_ft_multi.c [deleted file]
TC/testcase/utc_ft_string.c [deleted file]
TC/testcase/utc_ft_view.c [deleted file]
TC/tet_scen [deleted file]
TC/tetbuild.cfg [deleted file]
TC/tetclean.cfg [deleted file]
TC/tetexec.cfg [deleted file]
autogen.sh [changed mode: 0644->0755]
builds/amiga/README
builds/amiga/include/config/ftconfig.h [moved from builds/amiga/include/freetype/config/ftconfig.h with 90% similarity]
builds/amiga/include/config/ftmodule.h [moved from builds/amiga/include/freetype/config/ftmodule.h with 100% similarity]
builds/amiga/makefile
builds/amiga/makefile.os4
builds/amiga/smakefile
builds/amiga/src/base/ftdebug.c
builds/amiga/src/base/ftsystem.c
builds/atari/deflinejoiner.awk
builds/cmake/iOS.cmake [new file with mode: 0644]
builds/compiler/bcc-dev.mk
builds/detect.mk
builds/dos/detect.mk
builds/exports.mk
builds/freetype.mk
builds/mac/README
builds/mac/freetype-Info.plist [new file with mode: 0644]
builds/mac/ftmac.c
builds/modules.mk
builds/symbian/bld.inf
builds/toplevel.mk
builds/unix/.gitignore
builds/unix/aclocal.m4
builds/unix/config.guess
builds/unix/config.sub
builds/unix/configure
builds/unix/configure.ac
builds/unix/configure.raw
builds/unix/detect.mk
builds/unix/freetype-config.in
builds/unix/freetype2.in
builds/unix/freetype2.m4
builds/unix/ft2unix.h [deleted file]
builds/unix/ftconfig.in
builds/unix/ftsystem.c
builds/unix/install-sh
builds/unix/install.mk
builds/unix/ltmain.sh [changed mode: 0755->0644]
builds/unix/pkg.m4 [new file with mode: 0644]
builds/unix/unix-def.in
builds/vms/ftconfig.h
builds/vms/ftsystem.c
builds/win32/vc2010/freetype.vcxproj [deleted file]
builds/win32/vc2010/index.html [deleted file]
builds/wince/ftdebug.c
builds/wince/vc2005-ce/freetype.vcproj
builds/wince/vc2005-ce/index.html
builds/wince/vc2008-ce/freetype.vcproj
builds/wince/vc2008-ce/index.html
builds/windows/.gitignore [new file with mode: 0644]
builds/windows/detect.mk [moved from builds/win32/detect.mk with 95% similarity]
builds/windows/ftdebug.c [moved from builds/win32/ftdebug.c with 90% similarity]
builds/windows/vc2005/freetype.sln [moved from builds/win32/vc2005/freetype.sln with 100% similarity]
builds/windows/vc2005/freetype.vcproj [moved from builds/win32/vc2005/freetype.vcproj with 97% similarity]
builds/windows/vc2005/index.html [moved from builds/win32/vc2005/index.html with 76% similarity]
builds/windows/vc2008/freetype.sln [moved from builds/win32/vc2008/freetype.sln with 100% similarity]
builds/windows/vc2008/freetype.vcproj [moved from builds/win32/vc2008/freetype.vcproj with 94% similarity]
builds/windows/vc2008/index.html [moved from builds/win32/vc2008/index.html with 76% similarity]
builds/windows/vc2010/freetype.sln [moved from builds/win32/vc2010/freetype.sln with 56% similarity]
builds/windows/vc2010/freetype.user.props [new file with mode: 0644]
builds/windows/vc2010/freetype.vcxproj [new file with mode: 0644]
builds/windows/vc2010/freetype.vcxproj.filters [moved from builds/win32/vc2010/freetype.vcxproj.filters with 91% similarity]
builds/windows/vc2010/index.html [new file with mode: 0644]
builds/windows/visualc/freetype.dsp [moved from builds/win32/visualc/freetype.dsp with 86% similarity]
builds/windows/visualc/freetype.dsw [moved from builds/win32/visualce/freetype.dsw with 100% similarity]
builds/windows/visualc/freetype.sln [moved from builds/win32/visualc/freetype.sln with 100% similarity]
builds/windows/visualc/freetype.vcproj [moved from builds/win32/visualc/freetype.vcproj with 94% similarity]
builds/windows/visualc/index.html [moved from builds/win32/visualc/index.html with 77% similarity]
builds/windows/visualce/freetype.dsp [moved from builds/win32/visualce/freetype.dsp with 86% similarity]
builds/windows/visualce/freetype.dsw [moved from builds/win32/visualc/freetype.dsw with 100% similarity]
builds/windows/visualce/freetype.vcproj [moved from builds/win32/visualce/freetype.vcproj with 95% similarity]
builds/windows/visualce/index.html [moved from builds/win32/visualce/index.html with 80% similarity]
builds/windows/w32-bcc.mk [moved from builds/win32/w32-bcc.mk with 88% similarity]
builds/windows/w32-bccd.mk [moved from builds/win32/w32-bccd.mk with 86% similarity]
builds/windows/w32-dev.mk [moved from builds/win32/w32-dev.mk with 88% similarity]
builds/windows/w32-gcc.mk [moved from builds/win32/w32-gcc.mk with 89% similarity]
builds/windows/w32-icc.mk [moved from builds/win32/w32-icc.mk with 89% similarity]
builds/windows/w32-intl.mk [moved from builds/win32/w32-intl.mk with 88% similarity]
builds/windows/w32-lcc.mk [moved from builds/win32/w32-lcc.mk with 87% similarity]
builds/windows/w32-mingw32.mk [moved from builds/win32/w32-mingw32.mk with 89% similarity]
builds/windows/w32-vcc.mk [moved from builds/win32/w32-vcc.mk with 88% similarity]
builds/windows/w32-wat.mk [moved from builds/win32/w32-wat.mk with 88% similarity]
builds/windows/win32-def.mk [moved from builds/win32/win32-def.mk with 89% similarity]
configure
debian/changelog [deleted file]
debian/compat [deleted file]
debian/control [deleted file]
debian/copyright [deleted file]
debian/dirs [deleted file]
debian/docs [deleted file]
debian/libfreetype6-dev.install.in [deleted file]
debian/libfreetype6.install.in [deleted file]
debian/rules [deleted file]
devel/ft2build.h
devel/ftoption.h
docs/CHANGES
docs/CMAKE [new file with mode: 0644]
docs/CUSTOMIZE
docs/DEBUG
docs/INSTALL
docs/INSTALL.ANY
docs/INSTALL.CROSS
docs/INSTALL.GNU
docs/INSTALL.UNIX
docs/LICENSE.TXT
docs/VERSION.DLL
docs/formats.txt
docs/freetype-config.1 [new file with mode: 0644]
docs/reference/ft2-base_interface.html [deleted file]
docs/reference/ft2-basic_types.html [deleted file]
docs/reference/ft2-bdf_fonts.html [deleted file]
docs/reference/ft2-bitmap_handling.html [deleted file]
docs/reference/ft2-cache_subsystem.html [deleted file]
docs/reference/ft2-cid_fonts.html [deleted file]
docs/reference/ft2-computations.html [deleted file]
docs/reference/ft2-font_formats.html [deleted file]
docs/reference/ft2-gasp_table.html [deleted file]
docs/reference/ft2-glyph_management.html [deleted file]
docs/reference/ft2-glyph_stroker.html [deleted file]
docs/reference/ft2-glyph_variants.html [deleted file]
docs/reference/ft2-gx_validation.html [deleted file]
docs/reference/ft2-gzip.html [deleted file]
docs/reference/ft2-header_file_macros.html [deleted file]
docs/reference/ft2-incremental.html [deleted file]
docs/reference/ft2-index.html [deleted file]
docs/reference/ft2-lcd_filtering.html [deleted file]
docs/reference/ft2-list_processing.html [deleted file]
docs/reference/ft2-lzw.html [deleted file]
docs/reference/ft2-mac_specific.html [deleted file]
docs/reference/ft2-module_management.html [deleted file]
docs/reference/ft2-multiple_masters.html [deleted file]
docs/reference/ft2-ot_validation.html [deleted file]
docs/reference/ft2-outline_processing.html [deleted file]
docs/reference/ft2-pfr_fonts.html [deleted file]
docs/reference/ft2-quick_advance.html [deleted file]
docs/reference/ft2-raster.html [deleted file]
docs/reference/ft2-sfnt_names.html [deleted file]
docs/reference/ft2-sizes_management.html [deleted file]
docs/reference/ft2-system_interface.html [deleted file]
docs/reference/ft2-toc.html [deleted file]
docs/reference/ft2-truetype_engine.html [deleted file]
docs/reference/ft2-truetype_tables.html [deleted file]
docs/reference/ft2-type1_tables.html [deleted file]
docs/reference/ft2-user_allocation.html [deleted file]
docs/reference/ft2-version.html [deleted file]
docs/reference/ft2-winfnt_fonts.html [deleted file]
docs/release
ft2demos/ftbench [deleted file]
ft2demos/ftdiff [deleted file]
ft2demos/ftdump [deleted file]
ft2demos/ftgamma [deleted file]
ft2demos/ftgrid [deleted file]
ft2demos/ftlint [deleted file]
ft2demos/ftmulti [deleted file]
ft2demos/ftstring [deleted file]
ft2demos/ftview [deleted file]
include/config/ftconfig.h [moved from include/freetype/config/ftconfig.h with 77% similarity]
include/config/ftheader.h [moved from include/freetype/config/ftheader.h with 87% similarity]
include/config/ftmodule.h [moved from include/freetype/config/ftmodule.h with 100% similarity]
include/config/ftoption.h [moved from include/freetype/config/ftoption.h with 86% similarity]
include/config/ftstdlib.h [moved from include/freetype/config/ftstdlib.h with 98% similarity]
include/freetype.h [moved from include/freetype/freetype.h with 93% similarity]
include/freetype/internal/internal.h [deleted file]
include/ft2build.h
include/ftadvanc.h [moved from include/freetype/ftadvanc.h with 89% similarity]
include/ftautoh.h [new file with mode: 0644]
include/ftbbox.h [moved from include/freetype/ftbbox.h with 97% similarity]
include/ftbdf.h [moved from include/freetype/ftbdf.h with 96% similarity]
include/ftbitmap.h [moved from include/freetype/ftbitmap.h with 94% similarity]
include/ftbzip2.h [moved from include/freetype/ftbzip2.h with 99% similarity]
include/ftcache.h [moved from include/freetype/ftcache.h with 94% similarity]
include/ftcffdrv.h [new file with mode: 0644]
include/ftchapters.h [moved from include/freetype/ftchapters.h with 85% similarity]
include/ftcid.h [moved from include/freetype/ftcid.h with 99% similarity]
include/fterrdef.h [moved from include/freetype/fterrdef.h with 95% similarity]
include/fterrors.h [moved from include/freetype/fterrors.h with 93% similarity]
include/ftgasp.h [moved from include/freetype/ftgasp.h with 99% similarity]
include/ftglyph.h [moved from include/freetype/ftglyph.h with 95% similarity]
include/ftgxval.h [moved from include/freetype/ftgxval.h with 91% similarity]
include/ftgzip.h [moved from include/freetype/ftgzip.h with 74% similarity]
include/ftimage.h [moved from include/freetype/ftimage.h with 88% similarity]
include/ftincrem.h [moved from include/freetype/ftincrem.h with 99% similarity]
include/ftlcdfil.h [moved from include/freetype/ftlcdfil.h with 80% similarity]
include/ftlist.h [moved from include/freetype/ftlist.h with 96% similarity]
include/ftlzw.h [moved from include/freetype/ftlzw.h with 99% similarity]
include/ftmac.h [moved from include/freetype/ftmac.h with 98% similarity]
include/ftmm.h [moved from include/freetype/ftmm.h with 98% similarity]
include/ftmodapi.h [moved from include/freetype/ftmodapi.h with 75% similarity]
include/ftmoderr.h [moved from include/freetype/ftmoderr.h with 63% similarity]
include/ftotval.h [moved from include/freetype/ftotval.h with 91% similarity]
include/ftoutln.h [moved from include/freetype/ftoutln.h with 90% similarity]
include/ftpfr.h [moved from include/freetype/ftpfr.h with 99% similarity]
include/ftrender.h [moved from include/freetype/ftrender.h with 99% similarity]
include/ftsizes.h [moved from include/freetype/ftsizes.h with 98% similarity]
include/ftsnames.h [moved from include/freetype/ftsnames.h with 98% similarity]
include/ftstroke.h [moved from include/freetype/ftstroke.h with 93% similarity]
include/ftsynth.h [moved from include/freetype/ftsynth.h with 91% similarity]
include/ftsystem.h [moved from include/freetype/ftsystem.h with 95% similarity]
include/fttrigon.h [moved from include/freetype/fttrigon.h with 95% similarity]
include/ftttdrv.h [new file with mode: 0644]
include/fttypes.h [moved from include/freetype/fttypes.h with 96% similarity]
include/ftwinfnt.h [moved from include/freetype/ftwinfnt.h with 97% similarity]
include/ftxf86.h [moved from include/freetype/ftxf86.h with 96% similarity]
include/internal/autohint.h [moved from include/freetype/internal/autohint.h with 84% similarity]
include/internal/ftcalc.h [moved from include/freetype/internal/ftcalc.h with 51% similarity]
include/internal/ftdebug.h [moved from include/freetype/internal/ftdebug.h with 93% similarity]
include/internal/ftdriver.h [moved from include/freetype/internal/ftdriver.h with 54% similarity]
include/internal/ftgloadr.h [moved from include/freetype/internal/ftgloadr.h with 88% similarity]
include/internal/ftmemory.h [moved from include/freetype/internal/ftmemory.h with 71% similarity]
include/internal/ftobjs.h [moved from include/freetype/internal/ftobjs.h with 72% similarity]
include/internal/ftpic.h [moved from include/freetype/internal/ftpic.h with 80% similarity]
include/internal/ftrfork.h [moved from include/freetype/internal/ftrfork.h with 89% similarity]
include/internal/ftserv.h [moved from include/freetype/internal/ftserv.h with 82% similarity]
include/internal/ftstream.h [moved from include/freetype/internal/ftstream.h with 88% similarity]
include/internal/fttrace.h [moved from include/freetype/internal/fttrace.h with 94% similarity]
include/internal/ftvalid.h [moved from include/freetype/internal/ftvalid.h with 88% similarity]
include/internal/internal.h [new file with mode: 0644]
include/internal/psaux.h [moved from include/freetype/internal/psaux.h with 98% similarity]
include/internal/pshints.h [moved from include/freetype/internal/pshints.h with 93% similarity]
include/internal/services/svbdf.h [moved from include/freetype/internal/services/svbdf.h with 100% similarity]
include/internal/services/svcid.h [moved from include/freetype/internal/services/svcid.h with 100% similarity]
include/internal/services/svgldict.h [moved from include/freetype/internal/services/svgldict.h with 100% similarity]
include/internal/services/svgxval.h [moved from include/freetype/internal/services/svgxval.h with 100% similarity]
include/internal/services/svkern.h [moved from include/freetype/internal/services/svkern.h with 100% similarity]
include/internal/services/svmm.h [moved from include/freetype/internal/services/svmm.h with 100% similarity]
include/internal/services/svotval.h [moved from include/freetype/internal/services/svotval.h with 100% similarity]
include/internal/services/svpfr.h [moved from include/freetype/internal/services/svpfr.h with 100% similarity]
include/internal/services/svpostnm.h [moved from include/freetype/internal/services/svpostnm.h with 100% similarity]
include/internal/services/svprop.h [new file with mode: 0644]
include/internal/services/svpscmap.h [moved from include/freetype/internal/services/svpscmap.h with 100% similarity]
include/internal/services/svpsinfo.h [moved from include/freetype/internal/services/svpsinfo.h with 100% similarity]
include/internal/services/svsfnt.h [moved from include/freetype/internal/services/svsfnt.h with 100% similarity]
include/internal/services/svttcmap.h [moved from include/freetype/internal/services/svttcmap.h with 97% similarity]
include/internal/services/svtteng.h [moved from include/freetype/internal/services/svtteng.h with 100% similarity]
include/internal/services/svttglyf.h [moved from include/freetype/internal/services/svttglyf.h with 100% similarity]
include/internal/services/svwinfnt.h [moved from include/freetype/internal/services/svwinfnt.h with 100% similarity]
include/internal/services/svxf86nm.h [moved from include/freetype/internal/services/svxf86nm.h with 100% similarity]
include/internal/sfnt.h [moved from include/freetype/internal/sfnt.h with 66% similarity]
include/internal/t1types.h [moved from include/freetype/internal/t1types.h with 98% similarity]
include/internal/tttypes.h [moved from include/freetype/internal/tttypes.h with 94% similarity]
include/t1tables.h [moved from include/freetype/t1tables.h with 76% similarity]
include/ttnameid.h [moved from include/freetype/ttnameid.h with 86% similarity]
include/tttables.h [moved from include/freetype/tttables.h with 87% similarity]
include/tttags.h [moved from include/freetype/tttags.h with 94% similarity]
include/ttunpat.h [moved from include/freetype/ttunpat.h with 99% similarity]
modules.cfg
objs/.gitignore
packaging/freetype.manifest [new file with mode: 0644]
packaging/freetype.spec
src/Jamfile
src/autofit/afangles.c
src/autofit/afblue.c [new file with mode: 0644]
src/autofit/afblue.cin [new file with mode: 0644]
src/autofit/afblue.dat [new file with mode: 0644]
src/autofit/afblue.h [new file with mode: 0644]
src/autofit/afblue.hin [new file with mode: 0644]
src/autofit/afcjk.c
src/autofit/afcjk.h
src/autofit/afcover.h [new file with mode: 0644]
src/autofit/afdummy.c
src/autofit/afdummy.h
src/autofit/afglobal.c
src/autofit/afglobal.h
src/autofit/afhints.c
src/autofit/afhints.h
src/autofit/afindic.c
src/autofit/afindic.h
src/autofit/aflatin.c
src/autofit/aflatin.h
src/autofit/aflatin2.c
src/autofit/aflatin2.h
src/autofit/afloader.c
src/autofit/afloader.h
src/autofit/afmodule.c
src/autofit/afmodule.h
src/autofit/afpic.c
src/autofit/afpic.h
src/autofit/afranges.c [new file with mode: 0644]
src/autofit/afranges.h [new file with mode: 0644]
src/autofit/afscript.h [new file with mode: 0644]
src/autofit/afstyles.h [new file with mode: 0644]
src/autofit/aftypes.h
src/autofit/afwrtsys.h [new file with mode: 0644]
src/autofit/autofit.c
src/autofit/hbshim.c [new file with mode: 0644]
src/autofit/hbshim.h [new file with mode: 0644]
src/autofit/rules.mk
src/base/basepic.c
src/base/basepic.h
src/base/ftadvanc.c
src/base/ftbbox.c
src/base/ftbdf.c
src/base/ftbitmap.c
src/base/ftcalc.c
src/base/ftcid.c
src/base/ftdbgmem.c
src/base/ftdebug.c
src/base/ftfstype.c
src/base/ftgloadr.c
src/base/ftglyph.c
src/base/ftgxval.c
src/base/ftinit.c
src/base/ftlcdfil.c
src/base/ftmac.c
src/base/ftmm.c
src/base/ftobjs.c
src/base/ftotval.c
src/base/ftoutln.c
src/base/ftpfr.c
src/base/ftpic.c
src/base/ftrfork.c
src/base/ftsnames.c
src/base/ftstream.c
src/base/ftstroke.c
src/base/ftsynth.c
src/base/ftsystem.c
src/base/fttrigon.c
src/base/fttype1.c
src/base/ftutil.c
src/base/ftwinfnt.c
src/base/md5.c [new file with mode: 0644]
src/base/md5.h [new file with mode: 0644]
src/base/rules.mk
src/bdf/bdfdrivr.c
src/bdf/bdflib.c
src/bzip2/ftbzip2.c
src/cache/Jamfile
src/cache/ftcbasic.c
src/cache/ftccache.c
src/cache/ftccache.h
src/cache/ftccback.h
src/cache/ftccmap.c
src/cache/ftcmanag.c
src/cache/ftcmanag.h
src/cache/ftcmru.h
src/cache/ftcsbits.c
src/cff/cf2arrst.c [new file with mode: 0644]
src/cff/cf2arrst.h [new file with mode: 0644]
src/cff/cf2blues.c [new file with mode: 0644]
src/cff/cf2blues.h [new file with mode: 0644]
src/cff/cf2error.c [new file with mode: 0644]
src/cff/cf2error.h [new file with mode: 0644]
src/cff/cf2fixed.h [new file with mode: 0644]
src/cff/cf2font.c [new file with mode: 0644]
src/cff/cf2font.h [new file with mode: 0644]
src/cff/cf2ft.c [new file with mode: 0644]
src/cff/cf2ft.h [new file with mode: 0644]
src/cff/cf2glue.h [new file with mode: 0644]
src/cff/cf2hints.c [new file with mode: 0644]
src/cff/cf2hints.h [new file with mode: 0644]
src/cff/cf2intrp.c [new file with mode: 0644]
src/cff/cf2intrp.h [new file with mode: 0644]
src/cff/cf2read.c [new file with mode: 0644]
src/cff/cf2read.h [new file with mode: 0644]
src/cff/cf2stack.c [new file with mode: 0644]
src/cff/cf2stack.h [new file with mode: 0644]
src/cff/cf2types.h [new file with mode: 0644]
src/cff/cff.c
src/cff/cffcmap.c
src/cff/cffdrivr.c
src/cff/cffgload.c
src/cff/cffgload.h
src/cff/cffload.c
src/cff/cffobjs.c
src/cff/cffobjs.h
src/cff/cffparse.c
src/cff/cffpic.c
src/cff/cffpic.h
src/cff/cfftypes.h
src/cff/rules.mk
src/cid/cidgload.c
src/cid/cidload.c
src/cid/cidobjs.c
src/cid/cidparse.c
src/cid/cidparse.h
src/cid/cidriver.c
src/gxvalid/gxvbsln.c
src/gxvalid/gxvcommn.c
src/gxvalid/gxvcommn.h
src/gxvalid/gxverror.h
src/gxvalid/gxvfeat.c
src/gxvalid/gxvjust.c
src/gxvalid/gxvkern.c
src/gxvalid/gxvlcar.c
src/gxvalid/gxvmod.c
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
src/gzip/ftgzip.c
src/gzip/inftrees.c
src/gzip/rules.mk
src/lzw/ftlzw.c
src/lzw/ftzopen.h
src/otvalid/otvbase.c
src/otvalid/otvcommn.c
src/otvalid/otvcommn.h
src/otvalid/otverror.h
src/otvalid/otvgdef.c
src/otvalid/otvgpos.c
src/otvalid/otvgsub.c
src/otvalid/otvjstf.c
src/otvalid/otvmath.c
src/otvalid/otvmod.c
src/pcf/README
src/pcf/pcfdrivr.c
src/pcf/pcfread.c
src/pcf/pcfutil.c
src/pfr/pfrcmap.c
src/pfr/pfrdrivr.c
src/pfr/pfrgload.c
src/pfr/pfrload.c
src/pfr/pfrobjs.c
src/pfr/pfrsbit.c
src/psaux/afmparse.c
src/psaux/psconv.c
src/psaux/psconv.h
src/psaux/psobjs.c
src/psaux/t1cmap.c
src/psaux/t1decode.c
src/pshinter/pshalgo.c
src/pshinter/pshalgo.h
src/pshinter/pshglob.c
src/pshinter/pshglob.h
src/pshinter/pshmod.c
src/pshinter/pshpic.c
src/pshinter/pshpic.h
src/pshinter/pshrec.c
src/pshinter/pshrec.h
src/psnames/psmodule.c
src/psnames/pspic.c
src/psnames/pspic.h
src/psnames/rules.mk
src/raster/ftmisc.h
src/raster/ftraster.c
src/raster/ftrend1.c
src/raster/rastpic.c
src/raster/rastpic.h
src/sfnt/pngshim.c [new file with mode: 0644]
src/sfnt/pngshim.h [new file with mode: 0644]
src/sfnt/rules.mk
src/sfnt/sfdriver.c
src/sfnt/sferrors.h
src/sfnt/sfnt.c
src/sfnt/sfntpic.c
src/sfnt/sfntpic.h
src/sfnt/sfobjs.c
src/sfnt/ttbdf.c
src/sfnt/ttcmap.c
src/sfnt/ttcmap.h
src/sfnt/ttcmapc.h
src/sfnt/ttkern.c
src/sfnt/ttload.c
src/sfnt/ttmtx.c
src/sfnt/ttmtx.h
src/sfnt/ttpost.c
src/sfnt/ttsbit.c
src/sfnt/ttsbit.h
src/sfnt/ttsbit0.c [deleted file]
src/smooth/ftgrays.c
src/smooth/ftsmooth.c
src/smooth/ftspic.c
src/smooth/ftspic.h
src/tools/afblue.pl [new file with mode: 0644]
src/tools/apinames.c
src/tools/chktrcmp.py
src/tools/cordic.py
src/tools/docmaker/content.py
src/tools/docmaker/docmaker.py
src/tools/docmaker/formatter.py
src/tools/docmaker/sources.py
src/tools/docmaker/tohtml.py
src/tools/docmaker/utils.py
src/tools/ftrandom/README
src/tools/ftrandom/ftrandom.c
src/tools/test_afm.c
src/tools/test_bbox.c
src/tools/test_trig.c
src/truetype/rules.mk
src/truetype/truetype.c
src/truetype/ttdriver.c
src/truetype/ttgload.c
src/truetype/ttgload.h
src/truetype/ttgxvar.c
src/truetype/ttinterp.c
src/truetype/ttinterp.h
src/truetype/ttobjs.c
src/truetype/ttobjs.h
src/truetype/ttpic.c
src/truetype/ttpic.h
src/truetype/ttpload.c
src/truetype/ttsubpix.c [new file with mode: 0644]
src/truetype/ttsubpix.h [new file with mode: 0644]
src/type1/t1afm.c
src/type1/t1driver.c
src/type1/t1gload.c
src/type1/t1load.c
src/type1/t1objs.c
src/type1/t1parse.c
src/type42/t42drivr.c
src/type42/t42objs.c
src/type42/t42parse.c
src/winfonts/winfnt.c
vms_make.com

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..b5db9d8
--- /dev/null
@@ -0,0 +1,2 @@
+config.mk
+objs/vc2010/
diff --git a/.mailmap b/.mailmap
new file mode 100644 (file)
index 0000000..a3c5f94
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1,7 @@
+Alexei Podtelezhnikov (Алексей Подтележников) <apodtele@gmail.com>
+Behdad Esfahbod <behdad@behdad.org> <behdad.esfahbod@gmail.com>
+Bram Tassyns <bramt@enfocus.be> bram tassyns <BramT@enfocus.be>
+Bram Tassyns <bramt@enfocus.be> <BramT@enfocus.com>
+Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> <sssa@flavor1.ipc.hiroshima-u.ac.jp>
+Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> sssa <sssa@IPA2004-mps.local>
+Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8b859a5
--- /dev/null
@@ -0,0 +1,253 @@
+# CMakeLists.txt
+#
+# Copyright 2013, 2014 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# Written by John Cary <cary@txcorp.com>
+#
+# 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.
+#
+#
+# Say
+#
+#   cmake CMakeLists.txt
+#
+# to create a Makefile that builds a static version of the library.
+#
+# For a dynamic library, use
+#
+#   cmake CMakeLists.txt -DBUILD_SHARED_LIBS:BOOL=true
+#
+# For a framework on OS X, use
+#
+#   cmake CMakeLists.txt -DBUILD_FRAMEWORK:BOOL=true -G Xcode
+#
+# instead.
+#
+# For an iOS static library, use
+#
+#   cmake CMakeLists.txt -DIOS_PLATFORM=OS -G Xcode
+#
+# or
+#
+#   cmake CMakeLists.txt -DIOS_PLATFORM=SIMULATOR -G Xcode
+#
+# Please refer to the cmake manual for further options, in particular, how
+# to modify compilation and linking parameters.
+#
+# Some notes.
+#
+# . `cmake' will overwrite FreeType's original (top-level) `Makefile' file.
+#
+# . You can use `cmake' directly on a freshly cloned FreeType git
+#   repository.
+#
+# . `CMakeLists.txt'  is provided as-is since it is not used by the
+#   developer team.
+
+
+cmake_minimum_required(VERSION 2.6)
+
+# CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which
+# configures the base build environment and references the toolchain file
+if (APPLE)
+  if (DEFINED IOS_PLATFORM)
+    if (NOT "${IOS_PLATFORM}" STREQUAL "OS"
+        AND NOT "${IOS_PLATFORM}" STREQUAL "SIMULATOR")
+      message(FATAL_ERROR
+        "IOS_PLATFORM must be set to either OS or SIMULATOR")
+    endif ()
+    if (NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode")
+      message(AUTHOR_WARNING
+        "You should use Xcode generator with IOS_PLATFORM enabled to get Universal builds.")
+    endif ()
+    if (BUILD_SHARED_LIBS)
+      message(FATAL_ERROR
+        "BUILD_SHARED_LIBS can not be on with IOS_PLATFORM enabled")
+    endif ()
+    if (BUILD_FRAMEWORK)
+      message(FATAL_ERROR
+        "BUILD_FRAMEWORK can not be on with IOS_PLATFORM enabled")
+    endif ()
+
+    # iOS only uses static libraries
+    set(BUILD_SHARED_LIBS OFF)
+
+    set(CMAKE_TOOLCHAIN_FILE
+      ${PROJECT_SOURCE_DIR}/builds/cmake/iOS.cmake)
+  endif ()
+else ()
+  if (DEFINED IOS_PLATFORM)
+    message(FATAL_ERROR "IOS_PLATFORM is not supported on this platform")
+  endif ()
+endif ()
+
+project(freetype)
+
+if (BUILD_FRAMEWORK)
+  if (NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode")
+    message(FATAL_ERROR
+      "You should use Xcode generator with BUILD_FRAMEWORK enabled")
+  endif ()
+  set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)")
+  set(BUILD_SHARED_LIBS ON)
+endif ()
+
+set(VERSION_MAJOR "2")
+set(VERSION_MINOR "5")
+set(VERSION_PATCH "5")
+set(PROJECT_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
+
+# Compiler definitions for building the library
+add_definitions(-DFT2_BUILD_LIBRARY)
+
+# Specify library include directories
+include_directories("${PROJECT_SOURCE_DIR}/include")
+
+# Create the configuration file
+message(STATUS "Creating directory, ${PROJECT_BINARY_DIR}/include/freetype2.")
+file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/freetype2)
+
+# For the auto-generated ftconfig.h file
+include_directories(BEFORE "${PROJECT_BINARY_DIR}/include/freetype2")
+message(STATUS "Creating ${PROJECT_BINARY_DIR}/include/freetype2/ftconfig.h.")
+execute_process(
+  COMMAND sed -e "s/FT_CONFIG_OPTIONS_H/<ftoption.h>/" -e "s/FT_CONFIG_STANDARD_LIBRARY_H/<ftstdlib.h>/" -e "s?/undef ?#undef ?"
+  INPUT_FILE ${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.in
+  OUTPUT_FILE ${PROJECT_BINARY_DIR}/include/freetype2/ftconfig.h
+)
+
+file(GLOB PUBLIC_HEADERS "include/*.h")
+file(GLOB PUBLIC_CONFIG_HEADERS "include/config/*.h")
+file(GLOB PRIVATE_HEADERS "include/internal/*.h")
+
+set(BASE_SRCS
+  src/autofit/autofit.c
+  src/base/ftadvanc.c
+  src/base/ftbbox.c
+  src/base/ftbdf.c
+  src/base/ftbitmap.c
+  src/base/ftcalc.c
+  src/base/ftcid.c
+  src/base/ftdbgmem.c
+  src/base/ftdebug.c
+  src/base/ftfstype.c
+  src/base/ftgasp.c
+  src/base/ftgloadr.c
+  src/base/ftglyph.c
+  src/base/ftgxval.c
+  src/base/ftinit.c
+  src/base/ftlcdfil.c
+  src/base/ftmm.c
+  src/base/ftobjs.c
+  src/base/ftotval.c
+  src/base/ftoutln.c
+  src/base/ftpatent.c
+  src/base/ftpfr.c
+  src/base/ftrfork.c
+  src/base/ftsnames.c
+  src/base/ftstream.c
+  src/base/ftstroke.c
+  src/base/ftsynth.c
+  src/base/ftsystem.c
+  src/base/fttrigon.c
+  src/base/fttype1.c
+  src/base/ftutil.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/gzip/ftgzip.c
+  src/lzw/ftlzw.c
+  src/pcf/pcf.c
+  src/pfr/pfr.c
+  src/psaux/psaux.c
+  src/pshinter/pshinter.c
+  src/psnames/psmodule.c
+  src/raster/raster.c
+  src/sfnt/sfnt.c
+  src/smooth/smooth.c
+  src/truetype/truetype.c
+  src/type1/type1.c
+  src/type42/type42.c
+  src/winfonts/winfnt.c
+)
+
+include_directories("src/truetype")
+include_directories("src/sfnt")
+include_directories("src/autofit")
+include_directories("src/smooth")
+include_directories("src/raster")
+include_directories("src/psaux")
+include_directories("src/psnames")
+
+if (BUILD_FRAMEWORK)
+  set(BASE_SRCS
+    ${BASE_SRCS}
+    builds/mac/freetype-Info.plist
+  )
+endif ()
+
+add_library(freetype
+  ${PUBLIC_HEADERS}
+  ${PUBLIC_CONFIG_HEADERS}
+  ${PRIVATE_HEADERS}
+  ${BASE_SRCS}
+)
+
+if (BUILD_FRAMEWORK)
+  set_property(SOURCE ${PUBLIC_CONFIG_HEADERS}
+    PROPERTY MACOSX_PACKAGE_LOCATION Headers/config
+  )
+  set_target_properties(freetype PROPERTIES
+    FRAMEWORK TRUE
+    MACOSX_FRAMEWORK_INFO_PLIST builds/mac/freetype-Info.plist
+    PUBLIC_HEADER "${PUBLIC_HEADERS}"
+    XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
+  )
+endif ()
+
+# Installations
+# Note the trailing slash in the argument to the `DIRECTORY' directive
+install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/
+  DESTINATION include/freetype2
+  PATTERN "internal" EXCLUDE
+)
+install(TARGETS freetype
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib
+  FRAMEWORK DESTINATION Library/Frameworks
+)
+
+# Packaging
+# CPack version numbers for release tarball name.
+set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
+set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
+set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}})
+if (NOT DEFINED CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+  set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${CMAKE_PROJECT_NAME}")
+endif ()
+if (NOT DEFINED CPACK_SOURCE_PACKAGE_FILE_NAME)
+  set(CPACK_SOURCE_PACKAGE_FILE_NAME
+    "${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}-r${PROJECT_REV}"
+    CACHE INTERNAL "tarball basename"
+  )
+endif ()
+set(CPACK_SOURCE_GENERATOR TGZ)
+set(CPACK_SOURCE_IGNORE_FILES
+  "/CVS/;/.svn/;.swp$;.#;/#;/build/;/serial/;/ser/;/parallel/;/par/;~;/preconfig.out;/autom4te.cache/;/.config")
+set(CPACK_GENERATOR TGZ)
+include(CPack)
+
+# add make dist target
+add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
+
+# eof
index 9afc1aa..5a857ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
-2012-03-08  Werner Lemberg  <wl@gnu.org>
+2014-12-30  Werner Lemberg  <wl@gnu.org>
 
-       * Version 2.4.9 released.
+       * Version 2.5.5 released.
        =========================
 
 
-       Tag sources with `VER-2-4-9'.
-
-       * docs/CHANGES: Updated.
+       Tag sources with `VER-2-5-5'.
 
        * 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,
+       2.5.5.
+
+       * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
+       builds/windows/vc2005/index.html,
+       builds/windows/vc2008/freetype.vcproj,
+       builds/windows/vc2008/index.html,
+       builds/windows/vc2010/freetype.vcxproj,
+       builds/windows/vc2010/index.html,
+       builds/windows/visualc/freetype.dsp,
+       builds/windows/visualc/freetype.vcproj,
+       builds/windows/visualc/index.html,
+       builds/windows/visualce/freetype.dsp,
+       builds/windows/visualce/freetype.vcproj,
+       builds/windows/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/.
+       builds/wince/vc2008-ce/index.html: s/2.5.4/2.5.5/, s/254/255/.
 
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 9.
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5.
 
-       * builds/unix/configure.raw (version_info): Set to 14:1:8.
+       * builds/unix/configure.raw (version_info): Set to 17:4:11.
+       * CMakeLists.txt (VERSION_PATCH): Set to 5.
+       * docs/CHANGES: Updated.
 
-2012-03-08  Werner Lemberg  <wl@gnu.org>
+       * builds/toplevel.mk (dist): Fix typos.
 
-       [bdf] Add missing overflow check.
+2014-12-24  Alexei Podtelezhnikov <apodtele@gmail.com>
 
-       * src/bdf/bdflib.c (_bdf_parse_glyphs) <BITMAP>: Add threshold for
-       `glyph->bpr'.
+       [base] Formatting and nanooptimizations.
 
-2012-03-07  Vinnie Falco  <vinnie.falco@gmail.com>
+       * src/base/ftcalc.c,
+       * src/base/fttrigon.c: Revise sign restoration.
 
-       Prepare source code for amalgamation.
+2014-12-13  Werner Lemberg  <wl@gnu.org>
 
-       * 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.
+       * src/pcf/pcfread.c (pcf_read_TOC): Improve fix from 2014-12-08.
 
-2012-03-03  Werner Lemberg  <wl@gnu.org>
+2014-12-11  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #35660.
+       * builds/toplevel.mk (dist): Use older POSIX standard for `tar'.
 
-       For some divisions, we use casts to 32bit entities.  Always guard
-       against division by zero with these casts also.
+       Apparently, BSD tar isn't capable yet of handling POSIX-1.2001
+       (contrary to GNU tar), so force the POSIX-1.1988 format.
 
-       * 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).
+       Problem reported by Stephen Fisher <sfisher@SDF.ORG>.
 
-2012-03-03  Werner Lemberg  <wl@gnu.org>
+2014-12-11  Werner Lemberg  <wl@gnu.org>
 
-       [psaux] Fix handling of track kerning.
+       * src/type42/t42parse.c (t42_parse_sfnts): Reject invalid TTF size.
 
-       * 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.
+2014-12-11  Werner Lemberg  <wl@gnu.org>
 
-2012-03-02  Werner Lemberg  <wl@gnu.org>
+       * src/base/ftobjs.c (FT_Get_Glyph_Name): Fix off-by-one check.
 
-       [truetype] Fix Savannah bug #35689.
+       Problem reported by Dennis Felsing <dennis@felsin9.de>.
 
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check first outline
-       point.
+2014-12-11  Werner Lemberg  <wl@gnu.org>
 
-2012-03-01  Werner Lemberg  <wl@gnu.org>
+       * src/type42/t42parse.c (t42_parse_sfnts): Check `string_size'.
 
-       [bdf] Fix Savannah bug #35656.
+       Problem reported by Dennis Felsing <dennis@felsin9.de>.
 
-       * src/bdf/bdflib.c (_bdf_parse_glyphs) <_BDF_BITMAP>: Check validity
-       of nibble characters instead of accessing `a2i' array.
+2014-12-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-2012-03-01  Werner Lemberg  <wl@gnu.org>
+       [gxvalid] Fix a naming convention conflicting with ftvalid.
 
-       [winfonts] Fix Savannah bug #35659.
+       See previous changeset for otvalid.
 
-       * src/winfonts/winfnt.c (FNT_Face_Init): Check number of glyphs.
+       * src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
+       `valid' by `gxvalid'.
+       * src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
+       gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
+       gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
+       gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
+       gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
+       it is typed as GXV_Validator.
 
-2012-03-01  Werner Lemberg  <wl@gnu.org>
+2014-12-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       [bdf] Fix Savannah bug #35658.
+       [otvalid] Fix a naming convention conflicting with ftvalid.
 
-       * src/bdf/bdflib.c (_bdf_list_split): Initialize `field' elements
-       properly.
+       Some prototypes in ftvalid.h use `valid' for the variables
+       typed as FT_Validator.  Their implementations in src/base/
+       ftobjs.c and utilizations in src/sfnt/ttcmap.c do similar.
 
-2012-03-01  Werner Lemberg  <wl@gnu.org>
+       Some macros in otvcommn.h assume the exist of the variable
+       `valid' typed as OTV_Validator in the caller.
 
-       [psaux] Fix Savannah bug #35657.
+       Mixing these two conventions cause invalid pointer conversion
+       and unexpected SEGV in longjmp.  To prevent it, all variables
+       typed as OTV_Validator are renamed to `otvalid'.
 
-       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/otvalid/otvcommn.h: Replace `valid' by `otvalid'.
+       * src/otvalid/{otvcommn.c, otvbase.c, otvgdef.c, otvgpos.c,
+       otvgsub.c, otvjstf.c, otvmath.c}: Replace `valid' by `otvalid'
+       if it is typed as OTV_Validator.
 
-       * src/psaux/psconv.c (PS_Conv_Strtol, PS_Conv_ToFixed,
-       PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Fix boundary checking.
+2014-12-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-2012-03-01  Werner Lemberg  <wl@gnu.org>
+       [ftvalid] Introduce FT_THROW() in FT_INVALID_XXX macros.
 
-       [truetype] Fix Savannah bug #35646.
+       Original patch is designed by Werner Lemberg.  Extra part
+       for otvalid and gxvalid are added by suzuki toshiya, see
+       discussion:
+       http://lists.nongnu.org/archive/html/freetype-devel/2014-12/msg00002.html
+       http://lists.nongnu.org/archive/html/freetype-devel/2014-12/msg00007.html
 
-       * 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.
+       * include/internal/ftvalid.h: Introduce FT_THROW() in FT_INVALID_().
+       * src/gxvalid/gxvcommn.h: Ditto.
+       * src/otvalid/otvcommn.h: Ditto.
 
-2012-03-01  Werner Lemberg  <wl@gnu.org>
+2014-12-08  Werner Lemberg  <wl@gnu.org>
 
-       [bdf] Fix Savannah bug #35643.
+       [pcf] Fix Savannah bug #43774.
 
-       * 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.
+       Work around `features' of X11's `pcfWriteFont' and `pcfReadFont'
+       functions.  Since the PCF format doesn't have an official
+       specification, we have to exactly follow these functions' behaviour.
 
-2012-03-01  Werner Lemberg  <wl@gnu.org>
+       The problem was unveiled with a patch from 2014-11-06, fixing issue
+       #43547.
 
-       [bdf] Fix Savannah bug #35641.
+       * src/pcf/pcfread.c (pcf_read_TOC): Don't check table size for last
+       element.  Instead, assign real size.
 
-       * 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.
+2014-12-07  Werner Lemberg  <wl@gnu.org>
 
-2012-03-01  Werner Lemberg  <wl@gnu.org>
+       Work around a bug in Borland's C++ compiler.
 
-       [truetype] Fix Savannah bug #35640.
+       See
 
-       * src/truetype/ttinterp.c (SkipCode, TT_RunIns): Fix boundary check
-       for NPUSHB and NPUSHW instructions.
+         http://qc.embarcadero.com/wc/qcmain.aspx?d=118998
 
-2012-02-29  Werner Lemberg  <wl@gnu.org>
+       for Borland's bug tracker entry.
 
-       [truetype] Fix Savannah bug #35601.
+       Reported by Yuliana Zigangirova <zigangirova@inbox.ru>,
+       http://lists.gnu.org/archive/html/freetype-devel/2014-04/msg00001.html.
 
-       * src/truetype/ttinterp.c (Ins_SHZ): Use number of points instead of
-       last point for loop.
-       Also remove redundant boundary check.
+       * include/internal/ftvalid.h (FT_ValidatorRec), src/smooth/ftgrays.c
+       (gray_TWorker_): Move `ft_jmp_buf' field to be the first element.
 
-2012-02-29  Werner Lemberg  <wl@gnu.org>
+2014-12-07  Werner Lemberg  <wl@gnu.org>
 
-       [truetype] Remove redundant check.
+       */*: Decorate hex constants with `U' and `L' where appropriate.
 
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove redundant
-       second check for ordered contour start points.
+2014-12-07  Werner Lemberg  <wl@gnu.org>
 
-2012-02-29  Werner Lemberg  <wl@gnu.org>
+       [truetype] Prevent memory leak for buggy fonts.
 
-       [truetype] Make SHC instruction behave similar to MS rasterizer.
+       * src/truetype/ttobjs.c (tt_size_done): Unconditionally call
+       `tt_size_done_bytecode'.
 
-       * src/truetype/ttinterp.c (Ins_SHC): Handle virtual contour in
-       twilight zone.
+2014-12-06  Werner Lemberg  <wl@gnu.org>
 
-2012-02-29  Alexei Podtelezhnikov  <apodtele@gmail.com>
+       * Version 2.5.4 released.
+       =========================
 
-       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.
+       Tag sources with `VER-2-5-4'.
 
-2012-02-29  Werner Lemberg  <wl@gnu.org>
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.5.4.
+
+       * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
+       builds/windows/vc2005/index.html,
+       builds/windows/vc2008/freetype.vcproj,
+       builds/windows/vc2008/index.html,
+       builds/windows/vc2010/freetype.vcxproj,
+       builds/windows/vc2010/index.html,
+       builds/windows/visualc/freetype.dsp,
+       builds/windows/visualc/freetype.vcproj,
+       builds/windows/visualc/index.html,
+       builds/windows/visualce/freetype.dsp,
+       builds/windows/visualce/freetype.vcproj,
+       builds/windows/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.5.3/2.5.4/, s/253/254/.
 
-       [autofit] Don't synchronize digit widths for light rendering mode.
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.
 
-       We don't hint horizontally in this mode.
+       * builds/unix/configure.raw (version_info): Set to 17:3:11.
+       * CMakeLists.txt (VERSION_PATCH): Set to 4.
+       * docs/CHANGES: Updated.
 
-       * src/autofit/afloader.c (af_loader_load_g) <Hint_Metrics>:
-       Implement it.
+2014-12-04  Werner Lemberg  <wl@gnu.org>
 
-2012-02-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
+       docs/CHANGES: Updated, formatted.
 
-       [type42] Minor code optimization (again).
+2014-12-04  Dave Arnold  <darnold@adobe.com>
 
-       * src/type42/t42parse.c (t42_parse_sfnts): Simplify previous change.
+       [cff] Modify an FT_ASSERT.
 
-2012-02-26  Mateusz Jurczyk  <mjurczyk@google.com>
-           Werner Lemberg  <wl@gnu.org>
+       * src/cff/cf2hints.c (cf2_hintmap_map): After the fix for Savannah
+       bug #43661, the test font `...aspartam.otf' still triggers an
+       FT_ASSERT.  Since hintmap still works with count==0, ...
+       (cf2_glyphpath_lineTo, cf2_glyphpath_curveTo): ... add that term to
+       suppress the assert.
 
-       [smooth] Fix Savannah bug #35604.
+2014-12-04  Dave Arnold  <darnold@adobe.com>
 
-       * 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.
+       [cff] Fix Savannah bug #43661.
 
-2012-02-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
+       * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdHSTEM,
+       cf2_cmdVSTEM, cf2_cmdHINTMASK>: Don't append to stem arrays after
+       hintmask is constructed.
 
-       [type42] Minor code optimization.
+       * src/cff/cf2hints.c (cf2_hintmap_build): Add defensive code to
+       avoid reading past end of hintmask.
 
-       * src/type42/t42parse.c (t42_parse_sfnts): Use bitmask instead of
-       modulo operator.
+2014-12-03  Werner Lemberg  <wl@gnu.org>
 
-2012-02-26  Werner Lemberg  <wl@gnu.org>
+       docs/CHANGES: Updated.
 
-       * docs/CHANGES: Updated.
+2014-12-03  Werner Lemberg  <wl@gnu.org>
 
-2012-02-26  Werner Lemberg  <wl@gnu.org>
+       [autofit] Better fix for conversion specifiers in debug messages.
 
-       [type1] Fix Savannah bug #35608.
+       Using `%ld' for pointer differences causes warnings on 32bit
+       platforms.  The correct type would be (the relatively new) `%td',
+       however, this is missing on some important platforms.
 
-       * src/type1/t1parse.c (T1_Get_Private_Dict): Reject too short
-       dictionaries.
+       This patch improves the change from 2014-11-28.
 
-2012-02-26  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/afhints.c (AF_INDEX_NUM): Use `int' typecast.  Our
+       pointer differences are always sufficiently small.
+       (af_glyph_hints_dump_points, af_glyph_hints_dump_segments,
+       af_glyph_hints_dump_edge): Revert to `%d' and use `AF_INDEX_NUM'.
 
-       [bdf] Support `ENCODING -1 <n>' format.
+2014-12-03  Werner Lemberg  <wl@gnu.org>
 
-       * src/bdf/bdflib.c (_bdf_parse_glyphs) <ENCODING>: Implement it.
+       FT_Sfnt_Tag: s/ft_sfnt_xxx/FT_SFNT_XXX/ for orthogonality.
 
-2012-02-26  Werner Lemberg  <wl@gnu.org>
+       All public FreeType enumeration and flag values are uppercase...
 
-       [bdf] Fix Savannah bug #35607.
+       * include/tttables.h (FT_Sfnt_Tag): Implement it.  For backwards
+       compatilibity, retain the old values as macros.
 
-       * src/bdf/bdflib.c (_bdf_parse_glyphs) <ENCODING>: Normalize
-       negative encoding values.
+       * src/base/ftfstype.c (FT_Get_FSType_Flags), src/sfnt/sfdriver.c
+       (get_sfnt_table): Updated.
 
-2012-02-26  Werner Lemberg  <wl@gnu.org>
+2014-12-02  Werner Lemberg  <wl@gnu.org>
 
-       [type1] Fix Savannah bug #35606.
+       * include/*: Improve structure of documentation.
 
-       * src/type1/t1load.c (parse_subrs): Add proper guards for `strncmp'.
+       . Add and update many `<Order>' tags.
+       . Apply various documentation fixes.
+       . Remove details to deprecated (or never implemented) data.
 
-       * src/psaux/psobjs.c (ps_parser_skip_PS_token): Emit error message
-       only if cur < limit.
+2014-12-02  Werner Lemberg  <wl@gnu.org>
 
-2012-02-25  Werner Lemberg  <wl@gnu.org>
+       [docmaker] Always handle `<Order>' section elements.
 
-       [pcf] Fix Savannah bug #35603.
+       Previously, those elements were handled only for sections present in
+       a `<Sections>' chapter element.
 
-       * src/pcf/pcfread.c (pcf_get_properties): Assure final zero byte in
-       `strings' array.
+       * src/tools/docmaker/content.py (ContentProcessor::finish):
+       Implement it.
 
-2012-02-25  Werner Lemberg  <wl@gnu.org>
+2014-12-02  Werner Lemberg  <wl@gnu.org>
 
-       [type42] Fix Savannah bug #35602.
+       [docmaker] Properly handle empty rows in Synopsis.
 
-       * src/type42/t42parse.c (t42_parse_sfnts): Check `string_size' more
-       thoroughly.
+       * src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Emit
+       `&nbsp;' for empty fields.
 
-2012-02-25  Werner Lemberg  <wl@gnu.org>
+2014-12-02  Werner Lemberg  <wl@gnu.org>
 
-       [bdf] Fix Savannah bugs #35599 and #35600.
+       [docmaker] Thinko.
 
-       * src/bdf/bdflib.c (ACMSG16): New warning message.
-       (_bdf_parse_glyphs) <_BDF_BITMAP>: Check line length.
+       * src/tools/docmaker/content.py (DocBlock::get_markup_words_all):
+       Emit `/empty/' string for first element also.
 
-2012-02-24  Werner Lemberg  <wl@gnu.org>
+2014-12-02  Werner Lemberg  <wl@gnu.org>
 
-       [bdf] Fix Savannah bugs #35597 and #35598.
+       [docmaker] Honour empty lines in `<Order>' section element.
 
-       * src/bdf/bdflib.c (_bdf_is_atom): Fix handling of property value.
+       This greatly improves the readability of the `Synopsis' links.
 
-2012-02-24  Vinnie Falco  <vinnie.falco@gmail.com>
+       * src/tools/docmaker/content.py (DocBlock::get_markup_words_all):
+       Insert string `/empty/' between items.
 
-       Prepare source code for amalgamation (6/6).
+       * src/tools/docmaker/formatter.py (Formatter::section_dump): Make it
+       robust against nonexistent keys.
 
-       * src/cff/cffdrivr.c: s/Load_Glyph/cff_glyph_load/.
+       * src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Emit
+       empty <td> elements for `/empty/'.
 
-       * 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/.
+2014-12-02  Werner Lemberg  <wl@gnu.org>
 
-       * src/pxaux/t1cmap.c: s/t1_get_glyph_name/psaux_get_glyph_name/.
+       [docmaker] Ensure Python 3 compatibility.
 
-       * src/truetype/ttdriver.c: s/Load_Glyph/tt_glyph_load/.
+       * src/tools/docmaker/content.py (ContentProcessor::set_section,
+       ContentProcessor::finish): Replace `has_key' function with `in'
+       keyword.
 
-       * src/type1/t1load.c: s/parse_font_matrix/t1_parse_font_matrix/.
+       * src/tools/docmaker/formatter.py (Formatter::__init__): Replace
+       sorting function with a key generator.
+       (Formatter::add_identifier): Replace `has_key' function with `in'
+       keyword.
 
-2012-02-24  Vinnie Falco  <vinnie.falco@gmail.com>
+       * src/tools/docmaker/tohtml.py (HtmlFormatter::html_source_quote):
+       Replace `has_key' function with `in' keyword.
+       (HtmlFormatter::index_exit, HtmlFormatter::section_enter): Use
+       integer division.
+       s/<>/>/.
 
-       Prepare source code for amalgamation (5/6).
+       * src/tools/docmaker/utils.py: Import `itertools'.
+       (index_sort): Replaced by...
+       (index_key): ... this new key generator (doing exactly the same).
 
-       * include/freetype/fterrors.h: Undefine FT_KEEP_ERR_PREFIX after
-       using it.
+2014-11-29  Werner Lemberg  <wl@gnu.org>
 
-2012-02-22  Vinnie Falco  <vinnie.falco@gmail.com>
+       [docmaker] Don't output a block multiple times.
 
-       Prepare source code for amalgamation (4/6).
+       This bug was hidden by not processing all lines of `<Order>' blocks.
 
-       * src/smooth/ftgrays.c, src/raster/ftraster.c: Undefine RAS_ARG,
-       RAS_ARGS, RAS_VAR, and RAS_VARS before defining it.
+       * src/tools/docmaker/formatter.py (Formatter::section_dump): Filter
+       out field names.
 
-       * src/smooth/ftgrays.c: s/TRaster/black_TRaster/,
-       s/PRaster/black_PRaster/.
-       * src/raster/ftraster.c: s/TRaster/gray_TRaster/,
-       s/PRaster/gray_PRaster/.
+2014-11-29  Werner Lemberg  <wl@gnu.org>
 
-2012-02-20  Vinnie Falco  <vinnie.falco@gmail.com>
+       [docmaker] Use field values as HTML link targets where possible.
 
-       Prepare source code for amalgamation (3/6).
+       * src/tools/docmaker/tohtml.py (HtmlFormatter::make_block_url):
+       Accept second, optional argument to specify a name.
+       (HtmlFormatter::html_source_quote): Link to field ID if possible.
+       (HtmlFormatter::print_html_field_list): Emit `id' attribute.
 
-       * src/smooth/ftgrays.c: s/TWorker/black_TWorker/,
-       s/PWorker/black_PWorker/.
-       * src/raster/ftraster.c: s/TWorker/gray_TWorker/,
-       s/PWorker/gray_PWorker/.
+2014-11-29  Werner Lemberg  <wl@gnu.org>
 
-2012-02-20  Vinnie Falco  <vinnie.falco@gmail.com>
+       [docmaker] Allow empty lines in `<Order>' blocks.
 
-       Prepare source code for amalgamation (2/6).
+       Before this patch, the suggested order of entries stopped at the
+       first empty line.
 
-       * src/smooth/ftgrays.c, src/raster/ftraster.c: Undefine FLOOR,
-       CEILING, TRUNC, and SCALED before defining it.
+       Obviously, nobody noticed that this problem caused a much reduced
+       set of links in the `Synopsis' sections; in particular, the
+       `<Order>' blocks contain a lot of entries that wouldn't be listed
+       otherwise...
 
-2012-02-20  Vinnie Falco  <vinnie.falco@gmail.com>
+       * src/tools/docmaker/content.py (DocBlock::get_markup_words_all):
+       New function to iterate over all items.
+       (DocSection::process): Use it.
 
-       Prepare source code for amalgamation (1/6).
+2014-11-29  Werner Lemberg  <wl@gnu.org>
 
-       See discussion starting at
+       * src/tools/docmaker/sources.py (column) [Format 2]: Fix regexp.
 
-         http://lists.gnu.org/archive/html/freetype-devel/2012-01/msg00037.html
+       After the single asterisk there must be no other immediately following
+       asterisk.
 
-       * src/smooth/ftgrays.c: s/TBand/gray_TBand/.
-       * src/raster/ftraster.c: s/TBand/black_TBand/.
+2014-11-29  Werner Lemberg  <wl@gnu.org>
 
-2012-02-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
+       * src/tools/docmaker/tohtml.py: Improve CSS for vertical spacing.
 
-       [autofit] Fix outline flags.
+2014-11-29  Werner Lemberg  <wl@gnu.org>
 
-       * src/autofit/afloader.c (af_loader_load_g): Don't reassign
-       `outline.flags' so that this information is preserved.  See
-       discussion starting at
+       [docmaker] Improve HTML code for table of contents.
 
-         http://lists.gnu.org/archive/html/freetype-devel/2012-02/msg00046.html
+       * src/tools/docmaker/tohtml.py: Introduce a new table class `toc',
+       together with proper CSS.
 
-2012-02-11  Werner Lemberg  <wl@gnu.org>
+2014-11-29  Werner Lemberg  <wl@gnu.org>
 
-       [truetype] Fix Savannah bug #35466.
+       [docmaker] Provide higher-level markup and simplify HTML.
 
-       Jump instructions are now bound to the current function.  The MS
-       Windows rasterizer behaves the same, as confirmed by Greg Hitchcock.
+       * src/tools/docmaker/tohtml.py: Instead of using extraneous `<div>'
+       elements, use CSS descendants (of class `section') to format the
+       data.
 
-       * src/truetype/ttinterp.h (TT_CallRec): Add `Cur_End' element.
-       * src/truetype/ttobjs.h (TT_DefRecord): Add `end' element.
+       Also remove reduntant <p> and <br> elements, replacing them with
+       proper CSS.
 
-       * 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.
+       Globally reduce page width to 75%.
 
-2012-02-11  Werner Lemberg  <wl@gnu.org>
+       (block_header): Rename <div> class to `section'.
 
-       We don't use `extensions'.
+2014-11-29  Werner Lemberg  <wl@gnu.org>
 
-       * include/freetype/internal/ftobjs.h (FT_DriverRec): Remove
-       `extensions' field.
+       [docmaker] Add `top' links after blocks.
 
-2012-02-11  Werner Lemberg  <wl@gnu.org>
+       * src/tools/docmaker/tohtml.py (block_footer_middle): Implement it.
 
-       Clean up `generic' fields.
+2014-11-29  Werner Lemberg  <wl@gnu.org>
 
-       * include/freetype/internal/ftobjs.h (FT_ModuleRec, FT_LibraryRec):
-       Remove `generic' field since users can't access it.
+       * src/tools/docmaker/tohtml.py: Improve CSS for fields.
 
-       * 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'.
+       Make fields align horizontally relative to full line width.
 
-2012-02-07  Werner Lemberg  <wl@gnu.org>
+2014-11-29  Werner Lemberg  <wl@gnu.org>
 
-       [autofit] Harmonize function arguments.
+       * src/tools/docmaker/tohtml.py: Fix index and TOC templates.
 
-       * src/autofit/afloader.c, src/autofit/afloader.h: Use `FT_Int32' for
-       `load_flags'.
+       This thinko was introduced 2014-11-27.
 
-2012-02-07  Werner Lemberg  <wl@gnu.org>
+2014-11-28  Werner Lemberg  <wl@gnu.org>
 
-       * src/cff/cffobjs.c (cff_face_init): Remove unnecessary casts.
+       [docmaker] Format field lists with CSS.
 
-2012-01-17  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       This also simplifies the inserted HTML code.
 
-       [gxvalid] Fix Savannah bug #35286.
+       * src/tools/docmaker/tohtml.py
+       (HtmlFormatter::print_html_field_list): Do it.
 
-       Patch submitted by anonymous reporter.
+2014-11-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       * 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.
+       Fix compiler warning to the comparison between signed and
+       unsigned variable.
 
-2012-01-17  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Fix the comparison
+       between `ypos + ysize' and FT_INT_{MAX,MIN}.
 
-       [raccess] Modify for PIC build.
+2014-11-28  Werner Lemberg  <wl@gnu.org>
 
-       Based on the patch provided by Erik Dahlstrom <ed@opera.com>,
-       http://lists.gnu.org/archive/html/freetype-devel/2012-01/msg00010.html
+       [docmaker] Replace empty `<td>' with CSS.
 
-       Also `raccess_guess_table[]' and `raccess_rule_by_darwin_vfs()'
-       are renamed with `ft_' suffixes.
+       * src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Do
+       it.
 
-       * src/base/ftbase.h: `raccess_rule_by_darwin_vfs()' is renamed
-       to `ft_raccess_rule_by_darwin_vfs()'.
-       * src/base/ftobjs.c: Ditto.
+2014-11-28  Werner Lemberg  <wl@gnu.org>
 
-       * src/base/ftrfork.c: Declarations of FT_RFork_Rule,
-       raccess_guess_rec, are moved to...
-       * include/freetype/internal/ftrfork.h: Here.
+       [docmaker] Replace some `<table>' tags with `<h4>' and `<div>'.
 
-       * 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/tools/docmaker/tohtml.py (marker_*): Use `<h4>'.
+       (source_*): Use `<div>'.
+       (HtmlFormatter::block_enter): s/<h4>/<h3>/.
 
-       * 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.
+2014-11-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-2012-01-16  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       Fix compiler warning to conversion specifiers in debug messages.
 
-       Remove trailing spaces.
+       * src/autofit/afhints.c (af_glyph_hints_dump_points): Add length
+       modifier to dump long integers.
+       (af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Ditto.
 
-2012-01-16  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-11-27  Werner Lemberg  <wl@gnu.org>
 
-       Formatting PIC related sources.
+       * src/tools/docmaker/tohtml.py: Use more CSS for index.
 
-       * 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.
+2014-11-27  Werner Lemberg  <wl@gnu.org>
 
-2012-01-16  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       [docmaker] Replace `name' attribute of `<a>' with `id'.
 
-       [autofit] Fix the inclusion of `aflatin2.h' in PIC file.
+       * src/tools/docmaker/tohtml.py (HtmlFormatter::block_enter): Do it.
 
-       * 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.
+2014-11-27  Werner Lemberg  <wl@gnu.org>
 
-2012-01-16  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/tools/docmaker/tohtml.py: Remove remaining `width' attributes.
 
-       [cff] Remove redundant declarations of cff_cmap_XXX_class_rec.
+       For `Index' and `TOC' links, we now simply use the `text-align' CSS
+       property of `<td>' to enforce flush-left and flush-right,
+       eliminating the hack with an empty, full-width `<td>' element
+       inbetween.
 
-       * 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.
+       The change also enforces the same (smaller) size for all index and
+       TOC links.
 
-2012-01-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-11-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       Fix redundant declaration warning in PIC mode.
+       * src/cff/cf2font.c: Include `ftcalc.h' to use FT_MSB(),
+       cf2font.c could not find it under `make multi' build.
 
-       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.
+2014-11-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       * 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/smooth/ftsmooth.c (ft_smooth_render_generic): Remove
+       unrequired negative value check for `width' and `height'.
 
-       * 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}.
+2014-11-27  Werner Lemberg  <wl@gnu.org>
 
-2012-01-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/tools/docmaker/tohtml.py: More HTML table refactoring.
 
-       Make pspic.c to include module error header to fix multi build.
+       Replace some `<table>' tags with `<div>' to simplify structure.
 
-       * src/psnames/pspic.c: Include `psnamerr.h'.
+       Move `bgcolor' attribute to CSS.
 
-2012-01-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       Replace most `width' attributes with CSS.  The remaining instances
+       (providing a similar effect as LaTeX's `\hfill' command) are removed
+       in a later patch.
 
-       [base] Fix a dereference of uninitialized variable in PIC mode.
+2014-11-27  Werner Lemberg  <wl@gnu.org>
 
-       * 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.
+       * src/tools/docmaker/tohtml.py: Replace <font> with CSS.
 
-2012-01-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-11-27  Werner Lemberg  <wl@gnu.org>
 
-       [base] Insert explicit cast for GCC 4.6 in PIC mode.
+       * src/tools/docmaker/tohtml.py: Center <table> with CSS.
 
-       * 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.
+2014-11-27  Werner Lemberg  <wl@gnu.org>
 
-2012-01-13  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/tools/docmaker/tohtml.py: Replace `<center>' with `<div>'.
 
-       Fix PIC build broken by d9145241fe378104ba4c12a42534549faacc92e6.
+2014-11-27  Werner Lemberg  <wl@gnu.org>
 
-       Under PIC configuration, FT_{CFF,PSCMAPS,SFNT,TT}_SERVICES_GET
-       take no arguments but derefer the variable named `library'
-       internally.
+       * src/tools/docmaker/tohtml.py: Remove redundant `<center>' tags.
 
-       * 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.
+       This starts a series of commits into the direction of generating
+       valid HTML 5 code, especially using much more CSS.
 
-       * 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.
+2014-11-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-2012-01-13  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       Prevent too negative values (< FT_INT_MIN) in bitmap metrics,
+       suggested by Alexei.
 
-       Make PIC files include module error headers, to use the error codes
-       with per-module prefix.
+       * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Prevent too
+       negative values in `xpos' and `ypos + ysize'.
+       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Prevent
+       too negative values in `x_left' and `y_top'.  Either negative
+       values in `width' and `height' are checked.
 
-       * 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'.
+2014-11-27  Werner Lemberg  <wl@gnu.org>
 
-2012-01-04  Tobias Ringström  <tobias@ringis.se>
+       [docmaker] Produce better HTML code.
 
-       [truetype] Fix IP instruction if x_ppem != y_ppem.
+       * src/tools/docmaker/tohtml.py: Always use double quotes for
+       attribute values.
+       (source_footer): Close `td' and `tr' groups.
 
-       * src/truetype/ttinterp.c (Ins_IP): Scale `orus' coordinates
-       properly.
+2014-11-27  Werner Lemberg  <wl@gnu.org>
 
-2012-01-02  Werner Lemberg  <wl@gnu.org>
+       Use better way to disable creation of .pyc files for `make refdoc'.
 
-       Fix tracing message for `loca' table.
+       Python 2.6 was released in 2008...
 
-       * src/truetype/ttpload.c (tt_face_get_location): Don't emit a
-       warning message if the last `loca' entry references an empty glyph.
+       * builds/freetype.mk (refdoc): Use python's `-B' option.
 
-2011-12-10  Werner Lemberg  <wl@gnu.org>
+       * builds/detect.mk (std_setup, dos_setup): Mention required python
+       version for `refdoc' target.
 
-       Add some variable initializations.
-       Reported by Richard COOK <rscook@unicode.org>.
+2014-11-27  Werner Lemberg  <wl@gnu.org>
 
-       * src/type1/t1driver.c (t1_ps_get_font_value): Initialize `val'.
-       * src/smooth/ftgrays.c (gray_render_conic): Initialize `levels'
-       earlier.
+       * src/tools/docmaker/sources.py (re_bold, re_italic): Use
+       non-grouping parentheses.
+       * src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_word):
+       Updated.
 
-2011-12-08  Werner Lemberg  <wl@gnu.org>
+2014-11-27  Werner Lemberg  <wl@gnu.org>
 
-       Fix serious scaling bug in `FT_Get_Advances'.
+       * src/base/ftobjs.c (FT_Get_Glyph_Name): Fix compiler warning.
 
-       * src/base/ftadvanc.c (FT_Get_Advances): Advance values returned by
-       `FT_Load_Glyph' must be simply multiplied by 1024.
+       Introdruced in previous change.  Reported by Alexei.
 
-2011-12-08  Werner Lemberg  <wl@gnu.org>
+2014-11-26  Werner Lemberg  <wl@gnu.org>
 
-       * src/bdf/bdflib.c (_bdf_parse_start): Drop redundant error tracing.
+       * src/*: Add checks for parameters of API functions where missing.
 
-2011-12-02  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       `API functions' are functions tagged with `FT_EXPORT_DEF'.
 
-       [mac] Unify DARWIN_NO_CARBON with FT_MACINTOSH.
+       Besides trivial fixes, the following changes are included, too.
 
-       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).
+       * src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): Set
+       error code if no service is available.
 
-       * 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/ftinit.c (FT_Done_FreeType): Change return value for
+       invalid `library' parameter to `Invalid_Library_Handle'.
 
-       * 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/ftobjs.c (FT_New_Size): Change return value for invalid
+       `asize' parameter to `Invalid_Argument'.
 
-       * 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.
+       * src/base/ftoutln.c (FT_Outline_Copy): Change return value for
+       invalid `source' and `target' parameters to `Invalid_Outline'.
+       (FT_Outline_Done_Internal): Change return value for invalid
+       `outline' parameter to `Invalid_Outline'.
 
-       * 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.
+2014-11-26  Werner Lemberg  <wl@gnu.org>
 
-2011-11-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/cache/ftcbasic.c: Use single calls to `FT_TRACE'.
 
-       Fix Savannah bug #34728 (`make devel' on Mac OS X).
+2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       * 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.
+       * src/base/ftobj.c (Mac_Read_POST_Resource): Additional
+       overflow check in the summation of POST fragment lengths,
+       suggested by Mateusz Jurczyk <mjurczyk@google.com>.
 
-2011-11-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       [apinames] Fix the overflow of signed integer hash.
+       * src/base/ftobjs.c (Mac_Read_POST_Resource): Insert comments
+       and fold too long tracing messages.
 
-       * 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.
+2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-2011-11-30  Werner Lemberg  <wl@gnu.org>
+       Fix Savannah bug #43540.
 
-       [winfonts] Remove casts.
+       * src/base/ftmac.c (parse_fond): Prevent a buffer overrun
+       caused by a font including too many (> 63) strings to store
+       names[] table.
 
-       * src/winfonts/winfnt.c (winfnt_driver_class): Remove all casts and
-       update affected functions.
-       (FNT_Size_Select): Fix number of arguments.
+2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-2011-11-30  Werner Lemberg  <wl@gnu.org>
+       * src/base/ftobjs.c (Mac_Read_POST_Resource): Use unsigned long
+       variables to read the lengths in POST fragments.  Suggested by
+       Mateusz Jurczyk <mjurczyk@google.com>.
 
-       [type42] Remove casts.
+2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       * src/type42/t42driver.c (t42_driver_class): Remove all casts and
-       update affected functions.
+       Fix Savannah bug #43539.
 
-       * src/type42/t42objs.c, src/type42/t42objs.h: Updated for t42driver
-       changes.
+       * src/base/ftobjs.c (Mac_Read_POST_Resource): Fix integer overflow
+       by a broken POST table in resource-fork.
 
-2011-11-30  Werner Lemberg  <wl@gnu.org>
+2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       [type1] Remove casts.
+       Fix Savannah bug #43538.
 
-       * src/type1/t1driver.c (t1_driver_class): Remove all casts and
-       update affected functions.
+       * src/base/ftobjs.c (Mac_Read_POST_Resource): Fix integer overflow
+       by a broken POST table in resource-fork.
 
-       * 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.
+2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-2011-11-27  Werner Lemberg  <wl@gnu.org>
+       * src/base/ftobjs.c (Mac_Read_POST_Resource): Avoid memory leak
+       by a broken POST table in resource-fork.  Return after freeing
+       the buffered POST table when it is found to be broken.
 
-       [bdf] Fix Savannah bug #34896.
+2014-11-25  Werner Lemberg  <wl@gnu.org>
 
-       ENCODING now covers the whole Unicode range.
+       */*: s/Invalid_Argument/Invalid_Size_Handle/ where appropriate.
 
-       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).
+2014-11-25  Werner Lemberg  <wl@gnu.org>
 
-       * 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.
+       */*: s/Invalid_Argument/Invalid_Stream_Handle/ where appropriate.
 
-2011-11-27  Werner Lemberg  <wl@gnu.org>
+2014-11-25  Werner Lemberg  <wl@gnu.org>
 
-       [bdf] Improve tracing.
+       */*: s/Invalid_Argument/Invalid_Library_Handle/ where appropriate.
 
-       * src/bdf/bdflib.c (DBGMSG1, DBGMSG2): New macros.
-       (_bdf_parse_glyphs): Use them.
+2014-11-25  Werner Lemberg  <wl@gnu.org>
 
-2011-11-26  Werner Lemberg  <wl@gnu.org>
+       */*: s/Invalid_Argument/Invalid_Outline/ where appropriate.
 
-       Improve tracing.
+2014-11-25  Werner Lemberg  <wl@gnu.org>
 
-       * src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c
-       (PCF_Face_Done): Remove tracing message.
+       */*: s/Invalid_Argument/Invalid_Face_Handle/ where appropriate.
 
-       * 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.
+2014-11-24  Werner Lemberg  <wl@gnu.org>
 
-       * src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c
-       (T42_Open_Face): Improve tracing.
+       [Savannah bug #43682] Adjust some renderer callbacks.
 
-2011-11-26  Werner Lemberg  <wl@gnu.org>
+       * src/raster/ftraster.c (ft_black_set_mode): Change return type to
+       `int' to stay in sync with `FT_Renderer_SetModeFunc' prototype.
 
-       [cid] Fix error code.
+       * src/smooth/ftgrays.c (gray_raster_set_mode): New dummy function
+       for orthogonality.
+       (ft_grays_raster): Use it.
 
-       * src/cid/cidparse.c (cid_parser_new): Do it.
+2014-11-25  Werner Lemberg  <wl@gnu.org>
 
-2011-11-26  Werner Lemberg  <wl@gnu.org>
+       [Savannah bug #43682] Properly handle missing return errors.
 
-       [cff] Fix error code.
+       The functions in this patch *do* return non-trivial errors that must
+       be taken care of.
 
-       * src/cff/cffload.c (cff_font_load): Do it.
+       * src/autofit/afloader.c (af_loader_load_g), src/base/ftobjs.c
+       (FT_Render_Glyph_Internal), src/base/ftoutln.c (FT_Outline_Render),
+       src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_endchar>,
+       src/psaux/psobjs.c (ps_parser_load_field_table), src/psaux/t1decode
+       (t1_decoder_parse_charstrings) <op_endchar>, src/truetype/ttgload.c
+       (load_truetype_glyph <subglyph loop>, tt_loader_init,
+       TT_Load_Glyph), src/truetype/ttgxvar.c (TT_Set_MM_Blend),
+       src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Do it.
 
-2011-11-26  Werner Lemberg  <wl@gnu.org>
+2014-11-25  Werner Lemberg  <wl@gnu.org>
 
-       Add new error code FT_Err_Missing_Module.
+       [Savannah bug #43682] Add/remove `void' casts to some functions.
 
-       Previously, FreeType misleadingly returned
-       FT_Err_Unknown_File_Format if a module was missing (or a test was
-       missing completely).
+       We use a cast to indicate that we intentionally ignore a function's
+       return value.  However, this doesn't apply to API functions where
+       errors can only happen for trivially invalid input.
 
-       * include/freetype/fterrdef.h (FT_Err_Missing_Module): Define.
+       * src/base/ftstroke.c (FT_Glyph_Stroke, FT_Glyph_StrokeBorder),
+       src/base/ftsynth.c (FT_GlyphSlot_Embolden), src/cff/cffgload.c
+       (cff_slot_load), src/pfr/pfrdrivr.c (pfr_get_kerning),
+       src/type1/t1load.c (parse_encoding), src/type42/t42parse.c
+       (t42_parse_encoding): Do it.
 
-       * 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.
+2014-11-25  Werner Lemberg  <wl@gnu.org>
 
-       * 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'.
+       [Savannah bug #43682] Change some signatures to `void' return type.
 
-2011-11-25  Werner Lemberg  <wl@gnu.org>
+       * include/internal/pshints.h (PSH_Globals_SetScaleFunc),
+       include/internal/sfnt.h (TT_Get_Metrics_Func),
+       src/pshinter/pshglob.c (psh_globals_set_scale),
+       src/pshinter/pshrec.c (ps_hints_init), src/sfnt/ttmtx.c
+       (tt_face_get_metrics), src/truetype/ttinterp.c (TT_Goto_CodeRange,
+       TT_Set_CodeRange, TT_Clear_CodeRange, TT_Done_Context,
+       TT_Save_Context): Do it.
 
-       [bdf] Add more error messages.
+       * src/pshinter/pshglob.h, src/pshinter/pshrec.h, src/sfnt/ttmtx.h,
+       src/truetype/ttgload.c (TT_Hint_Glyph), src/truetype/ttinterp.c
+       (TT_Run_Context), src/truetype/ttinterp.h, src/truetype/ttobjs.c
+       (tt_size_run_fpgm, tt_size_run_prep): Updated.
 
-       * 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.
+2014-11-24  Werner Lemberg  <wl@gnu.org>
 
-2011-11-24  Werner Lemberg  <wl@gnu.org>
+       Remove all code related to FT_MAX_CHARMAP_CACHEABLE.
 
-       * include/freetype/fterrors.h: Remove dead code.
+       This is no longer used.
 
-2011-11-15  Werner Lemberg  <wl@gnu.org>
+       * src/base/ftobjs.c, src/cache/ftccmap.c, src/cff/cffobjs.c,
+       src/sfnt/ttcmap.c: Do it.
 
-       * docs/releases: Updated.
+2014-11-24  Werner Lemberg  <wl@gnu.org>
 
-2011-11-15  Werner Lemberg  <wl@gnu.org>
+       [sfnt] Fix Savannah bug #43680.
 
-       * Version 2.4.8 released.
-       =========================
+       This adds an additional constraint to make the fix from 2013-01-25
+       really work.
 
+       * src/sfnt/ttsbit.c (tt_sbit_decoder_load_image) <index_format==4>:
+       Check `p' before `num_glyphs'.
 
-       Tag sources with `VER-2-4-8'.
+2014-11-24  Werner Lemberg  <wl@gnu.org>
 
-       * docs/CHANGES: Updated.
+       [truetype] Fix Savannah bug #43679.
 
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.4.8.
+       * src/truetype/ttpload.c (tt_face_load_hdmx): Check minimum size of
+       `record_size'.
 
-       * 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/.
+2014-11-24  Jarkko Pöyry  <jarkko.poyry@gmail.com>
 
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 8.
+       [cff, pfr, psaux, winfonts] Fix Savannah bug #43676.
 
-       * builds/unix/configure.raw (version_info): Set to 14:0:8.
+       Don't cast cmap init function pointers to an incompatible type.
 
-2011-11-13  Chris Liddell  <chris.liddell@artifex.com>
+       Without this patch, the number of parameters between declaration and
+       the real signature differs.  Calling such a function results in
+       undefined behavior.
 
-       Add FT_Get_PS_Font_Value() API.
+         ISO/IEC 9899:TC3 (Committee Draft September 7, 2007)
+           6.5.2.2 Function calls
+             9 If the function is defined with a type that is not
+               compatible with the type (of the expression) pointed to by
+               the expression that denotes the called function, the
+               behavior is undefined.
 
-       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).
+       On certain platforms (c -> js with emscripten) this causes
+       termination of execution or invalid calls because in the emscripten
+       implementation, function pointers of different types are stored in
+       different pointer arrays.  Incorrect pointer type here results in
+       indexing of an incorrect array.
 
-       * include/freetype/internal/services/svpsinfo.h
-       (PS_GetFontValueFunc): New typedef.
-       (PSInfo): Add `ps_get_font_value'.
-       (FT_DEFINE_SERVICE_PSINFOREC): Updated.
+       * src/cff/cffcmap.c (cff_cmap_encoding_init, cff_cmap_unicode_init),
+       src/pfr/pfrcmap.c (pfr_cmap_init), src/psaux/t1cmap.c
+       t1_cmap_standard_init, t1_cmap_expert_init, t1_cmap_custom_init,
+       t1_cmap_unicode_init), src/winfonts/winfnt.c (fnt_cmap_init): Fix
+       signature.
 
-       * 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.
+2014-11-24  Werner Lemberg  <wl@gnu.org>
 
-       * src/base/fttype1.c (FT_Get_PS_Font_Value): New function.
+       [sfnt] Fix Savannah bug #43672.
 
-       * src/type1/t1driver.c (t1_ps_get_font_value): This new function
-       does the real job.
-       (t1_service_ps_info): Add it.
+       * src/sfnt/ttkern.c (tt_face_load_kern): Use correct value for
+       minimum table length test.
 
-       * 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.
+2014-11-24  Werner Lemberg  <wl@gnu.org>
 
-2011-11-08  Braden Thomas  <bthomas@apple.com>
+       [type1, type42] Another fix for Savannah bug #43655.
 
-       [cid] Various loading fixes.
+       * src/type1/t1load.c (parse_charstrings), src/type42/t42parse.c
+       (t42_parse_charstrings): Add another boundary testing.
 
-       * 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.
+2014-11-24  Werner Lemberg  <wl@gnu.org>
 
-2011-11-05  Werner Lemberg  <wl@gnu.org>
+       [docmaker] Formatting, copyright, improved documentation.
 
-       * README: We use copyright ranges also.
+       * src/tools/docmaker/*: No code changes besides trivial
+       modifications.
 
-       According to
+2014-11-22  Werner Lemberg  <wl@gnu.org>
 
-         http://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html
+       [bdf] Fix Savannah bug #43660.
 
-       this should be mentioned explicitly.
+       * src/bdf/bdflib.c (_bdf_parse_glyphs) <"ENDFONT">: Check
+       `_BDF_GLYPH_BITS'.
 
-2011-10-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-11-22  Werner Lemberg  <wl@gnu.org>
 
-       [raccess] Supplement for previous fix.
+       [type42] Allow only embedded TrueType fonts.
 
-       * 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.
+       This is a follow-up to Savannah bug #43659.
 
-2011-10-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/type42/t42objs.c (T42_Face_Init): Exclusively use the
+       `truetype' font driver for loading the font contained in the `sfnts'
+       array.
 
-       [raccess] Hide raccess_rule_by_darwin_vfs() on native Mac OS X.
+2014-11-22  Werner Lemberg  <wl@gnu.org>
 
-       * src/base/ftrfork.c (raccess_rule_by_darwin_vfs): Do not
-       compile on native Mac OS X because it is not used.
+       [type42] Fix Savannah bug #43659.
 
-2011-10-25  Werner Lemberg  <wl@gnu.org>
+       * src/type42/t42objs.c (T42_Open_Face): Initialize `face->ttf_size'.
 
-       [truetype] Fix MD instruction for twilight zone.
+       * src/type42/t42parse.c (t42_parse_sfnts): Always set
+       `face->ttf_size' directly.  This ensures a correct stream size in
+       the call to `FT_Open_Face', which follows after parsing, even for
+       buggy input data.
+       Fix error messages.
 
-       * src/truetype/ttinterp.c (Ins_MD): Without this fix, the MD
-       instruction applied to original coordinates of twilight points
-       always returns zero.
+2014-11-22  Werner Lemberg  <wl@gnu.org>
 
-2011-10-18  Werner Lemberg  <wl@gnu.org>
+       [cff] Fix Savannah bug #43658.
 
-       * Version 2.4.7 released.
-       =========================
+       * src/cff/cf2ft.c (cf2_builder_lineTo, cf2_builder_cubeTo): Handle
+       return values of point allocation routines.
 
+2014-11-22  Werner Lemberg  <wl@gnu.org>
 
-       Tag sources with `VER-2-4-7'.
+       [sfnt] Fix Savannah bug #43656.
 
-       * docs/CHANGES: Updated.
+       * src/sfnt/ttcmap.c (tt_cmap4_validate): Fix order of validity
+       tests.
 
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.4.7.
+2014-11-21  Werner Lemberg  <wl@gnu.org>
 
-       * 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/.
+       [type1, type42] Fix Savannah bug #43655.
 
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 7.
+       * src/type1/t1load.c (parse_charstrings), src/type42/t42parse.c
+       (t42_parse_charstrings): Fix boundary testing.
 
-       * builds/unix/configure.raw (version_info): Set to 13:2:7.
+2014-11-21  Werner Lemberg  <wl@gnu.org>
 
-2011-10-15  Kal Conley  <kcconley@gmail.com>
+       * src/pcf/pcfread.c (pcf_get_metrics): Sanitize invalid metrics.
 
-       Fix handling of transformations if no renderer is present.
+2014-11-21  Werner Lemberg  <wl@gnu.org>
 
-       * src/base/ftobjs.c (FT_Load_Glyph): Thinko.
+       [ftlcdfil] Obey flow direction.
 
-2011-10-15  Kal Conley  <kcconley@gmail.com>
+       * src/base/ftlcdfil.c (_ft_lcd_filter_fir, _ft_lcd_filter_legacy):
+       Handle `up' flow.
 
-       Fix conditions for autohinting.
+2014-11-21  Werner Lemberg  <wl@gnu.org>
 
-       * src/base/ftobjs.c (FT_Load_Glyph): Handle
-       FT_LOAD_IGNORE_TRANSFORM.
+       * src/base/ftbitmap.c (FT_Bitmap_Convert): Improve.
 
-2011-10-07  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       This commit completes argument checks and adds support for different
+       flow directions.
 
-       [gxvalid] Fix a bug to detect too large offset in morx table.
+2014-11-21  Werner Lemberg  <wl@gnu.org>
 
-       * src/gxvalid/gxvmorx2.c
-       (gxv_morx_subtable_type2_ligActionIndex_validate): Fix a bug
-       that too large positive offset cannot be detected.
+       * src/base/ftbitmap.c (FT_Bitmap_Copy): Improve.
 
-2011-10-01  Braden Thomas  <bthomas@apple.com>
+       This commit adds argument checks and support for different flow
+       directions.
 
-       Handle some border cases.
+2014-11-20  Werner Lemberg  <wl@gnu.org>
 
-       * include/freetype/config/ftstdlib.h (FT_USHORT_MAX): New macro.
+       * src/base/ftbitmap.c (FT_Bitmap_New): Check argument.
 
-       * src/base/ftbitmap.c (FT_Bitmap_Convert): Protect against invalid
-       value of `target->rows'.
+2014-11-19  Werner Lemberg  <wl@gnu.org>
 
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add check for
-       flex start.
+       Change some fields in `FT_Bitmap' to unsigned type.
 
-       * src/raster/ftrend1.c (ft_raster1_render): Check `width' and
-       `height'.
+       This doesn't break ABI.
 
-       * src/truetype/ttgxvar.c (TT_Vary_Get_Glyph_Deltas): Protect against
-       invalid values in `localpoints' array.
+       * include/ftimage.h (FT_Bitmap): Make `rows', `width', `num_grays',
+       `pixel_mode', and `palette_mode' unsigned types.
 
-2011-10-01  Werner Lemberg  <wl@gnu.org>
+       * src/base/ftbitmap.c: Updated.
+       (FT_Bitmap_Copy): Fix casts.
 
-       [psnames] Handle zapfdingbats.
-       Problem reported by Nicolas Rougier <Nicolas.Rougier@inria.fr>.
+       * src/cache/ftcsbits.c, src/raster/ftraster.c, src/sfnt/pngshim.c:
+       Updated.
 
-       * src/tools/glnames.py (adobe_glyph_list): Add data from AGL's
-       `zapfdingbats.txt' file.
+2014-11-19  Werner Lemberg  <wl@gnu.org>
 
-       * src/psnames/pstables.h: Regenerated.
+       Make `FT_Bitmap_Convert' correctly handle negative `pitch' values.
 
-2011-09-27  Simon Bünzli  <zeniko@gmail.com>
+       * src/base/ftbitmap.c (FT_Bitmap_Convert): Always use positive value
+       for the pitch while copying data.
+       Correctly set pitch sign in target bitmap.
 
-       Fix Savannah bug #34189.
+2014-11-19  Werner Lemberg  <wl@gnu.org>
 
-       * src/type1/t1load.c (T1_Open_Face): Initialize
-       `face->len_buildchar'.
+       Minor code improvement in `FT_Bitmap_Embolden'.
 
-2011-09-26  Werner Lemberg  <wl@gnu.org>
+       * src/base/ftbitmap.c (FT_Bitmap_Embolden) <FT_PIXEL_MODE_GRAY[24]>:
+       Fix thinko.
 
-       [cff] Dump SIDs while tracing.
+2014-11-19  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * src/cff/cffobjs.c (cff_face_init): Do it.
+       * src/base/fttrigon.c: Use dedicated `FT_Angle' for arctan table.
 
-       * src/cff/cffparse.c (cff_parser_run) [FT_DEBUG_LEVEL_TRACE]
-       <cff_kind_string>: Identify as SID.
+2014-11-19  Behdad Esfahbod  <behdad@behdad.org>
 
-2011-09-17  Werner Lemberg  <wl@gnu.org>
+       Avoid compiler warnings on x86-64 for `FT_MulFix'.
 
-       Remove unused FT_ALIGNMENT macro.
+       `FT_MulFix' takes `FT_Long' parameters as defined in `freetype.h',
+       but several inline implementations of it in `ftcalc.h' take
+       `FT_Int32' arguments.  This is causing compiler warnings on x86-64:
+       If parameters of type `FT_Fixed' (= `FT_Long') are passed to the
+       inline implementation of this function, integer values are truncated
+       from 64bit to 32bit.
 
-       * builds/unix/ftconfig.in, builds/vms/ftconfig.h,
-       include/freetype/config/ftconfig.h: Do it.
+       * include/internal/ftcalc.h (FT_MulFix) [FT_MULFIX_ASSEMBLER]: Add
+       casts.
 
-2011-09-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
+2014-11-15  Werner Lemberg  <wl@gnu.org>
 
-       [smooth] Slightly optimize conic and cubic flatterners.
+       [sfnt] Fix Savannah bug #43597.
 
-       * src/smooth/ftgrays.c (gray_render_conic, gray_render_cubic): Move
-       out some code from the main loop to speed it up.
+       * src/sfnt/pngshim.c (Load_SBit_Png): Protect against too large
+       bitmaps.
 
-2011-09-11  Tomas Hoger  <thoger@redhat.com>
+2014-11-12  Werner Lemberg  <wl@gnu.org>
 
-       Slightly improve LZW_CLEAR handling.
+       [sfnt] Fix Savannah bug #43591.
 
-       * 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.
+       * src/sfnt/ttsbit.c (tt_sbit_decoder_init): Protect against addition
+       and multiplication overflow.
 
-2011-09-11  Tomas Hoger  <thoger@redhat.com>
+2014-11-12  Werner Lemberg  <wl@gnu.org>
 
-       Add explicit LZW decompression stack size limit.
+       [sfnt] Fix Savannah bug #43590.
 
-       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:
+       * src/sfnt/ttload.c (check_table_dir, tt_face_load_font_dir):
+       Protect against addition overflow.
 
-         http://code.google.com/p/libarchive/source/browse/trunk/libarchive/archive_read_support_filter_compress.c?r=3635#121
+2014-11-12  Werner Lemberg  <wl@gnu.org>
 
-       This patch adds explicit stack size limit, enforced when stack is
-       realloced.
+       [sfnt] Fix Savannah bug #43589.
 
-       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/sfnt/sfobjs.c (woff_open_font): Protect against addition
+       overflow.
 
-       * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): Implement it.
+2014-11-12  Werner Lemberg  <wl@gnu.org>
 
-2011-09-11  Tomas Hoger  <thoger@redhat.com>
+       [sfnt] Fix Savannah bug #43588.
 
-       Protect against loops in the prefix table.
+       * src/sfnt/ttcmap.c (tt_cmap8_validate, tt_cmap10_validate,
+       tt_cmap12_validate, tt_cmap13_validate, tt_cmap14_validate): Protect
+       against overflow in additions and multiplications.
 
-       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.
+2014-11-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * 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.
+       [base] CORDIC improvements.
 
-2011-09-09  Werner Lemberg  <wl@gnu.org>
+       The scaling between the hypotenuse and its CORDIC approximation is
+       based on regression analysis. The smaller padding for `theta' is
+       justifed by its maximum error of less than 6.
 
-       Better tracing of metrics.
+       * src/base/fttrigon.c (ft_trig_downscale): Borrow code from
+       ./ftcalc.c (ft_multo64), change linear intercept.
+       (ft_trig_pseudo_polarize): Decrease `theta' padding.
 
-       * src/base/ftobjs.c (FT_Request_Size, FT_Select_Size): Decorate with
-       FT_TRACE.
+2014-11-09  Werner Lemberg  <wl@gnu.org>
 
-2011-09-07  Werner Lemberg  <wl@gnu.org>
+       * src/base/ftstroke.c (ft_stroker_inside): Fix border intersections.
 
-       Fix Savannah bug #33816.
+       One more place to check whether `radius' is zero.
 
-       * 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.
+       Problem reported by Marco Wertz <marco.wertz@gmx.de>.
 
-2011-08-30  Werner Lemberg  <wl@gnu.org>
+2014-11-07  Werner Lemberg  <wl@gnu.org>
 
-       Better tracing of metrics.
+       [bdf] Fix Savannah bug #43535.
 
-       * src/base/ftobjs.c (FT_Select_Metrics, FT_Request_Metrics):
-       Decorate with FT_TRACE.
+       * src/bdf/bdflib.c (_bdf_strncmp): New macro that checks one
+       character more than `strncmp'.
+       s/ft_strncmp/_bdf_strncmp/ everywhere.
 
-2011-08-25  Werner Lemberg  <wl@gnu.org>
+2014-11-06  Werner Lemberg  <wl@gnu.org>
 
-       [cff] Better tracing of the parsing process.
+       [pcf] Fix Savannah bug #43548.
 
-       * src/cff/cffload.c (cff_subfont_load, cff_font_load): Decorate with
-       FT_TRACE.
+       * src/pcf/pcfread.c (pcf_get_encodings): Add sanity checks for row
+       and column values.
 
-       * 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.
+2014-11-06  Werner Lemberg  <wl@gnu.org>
 
-       * src/cff/cffparse.h (CFF_Field_Handler) [FT_DEBUG_LEVEL_TRACE]: Add
-       `id' member.
+       [pcf] Fix Savannah bug #43547.
 
-       * src/cff/cfftoken.h: Add IDs to all fields.
+       * src/pcf/pcfread.c (pcf_read_TOC): Check `size' and `offset'
+       values.
 
-2011-08-16  Werner Lemberg  <wl@gnu.org>
+2014-11-06  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #34022.
+       * src/pcf/pcfread.c (pcf_read_TOC): Avoid memory leak.
 
-       * README, docs/INSTALL: Remove references to UPGRADE.UNIX.
+2014-11-03  Infinality  <infinality@infinality.net>
 
-2011-08-15  Werner Lemberg  <wl@gnu.org>
+       * src/truetype/ttsubpix.c (COMPATIBILITY_MODE_Rules): Updated.
 
-       Fix Savannah bug #34018.
+       The previous commit deteriorates rendering of DejaVu and similar
+       fonts; this gets compensated with this rule.
 
-       * docs/UPGRADE.UNIX: Removed.  Obsolete.
+2014-11-03  Werner Lemberg  <wl@gnu.org>
 
-2011-08-15  David Bevan  <david.bevan@pb.com>
+       * src/truetype/ttinterp.c (Ins_DELTAP): Fix subpixel hinting.
 
-       Fix Savannah bug #33992.
+       Before this patch, it was impossible to ever call DELTAP[123] in
+       subpixel hinting mode as described in the ClearType whitepaper; it
+       only worked if in `compatibility mode'.  However, compatibility mode
+       essentially disables SHPIX, completely ruining hinting of
+       ttfautohint output, for example.
 
-       * src/base/ftstroke.c (FT_Stroker_ParseOutline): Fix border case.
+       We now follow the whitepaper more closely so that DELTAP[123]
+       instructions for touched points in the non-subpixel direction are
+       executed.
 
-2011-08-12  Werner Lemberg  <wl@gnu.org
+2014-10-31  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       [truetype] Fix degenerate case in S{P,F,DP}VTL opcodes.
+       [smooth] Improve code readability.
 
-       * src/truetype/ttinterp.c (Ins_SxVTL): Handle p1 == p2 specially.
-       (Ins_SDPVTL): Handle v1 == v2 specially.
+       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code.
 
-2011-08-09  Werner Lemberg  <wl@gnu.org>
+2014-10-31  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       Fix Savannah bug #33975.
+       [smooth] Reduce outline translations during rendering.
 
-       * src/cff/cffparse.c (cff_parse_font_matrix): Fix typo.
+       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Translate origin
+       virtually by modifying cbox, actually translate outline if cumulative
+       shift is not zero.
 
-2011-07-29  Werner Lemberg  <wl@gnu.org>
+2014-10-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * Version 2.4.6 released.
-       =========================
+       [smooth] Fix Savannah bug #35604 (cont'd).
 
+       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove checks and
+       casts that became unnecessary after the variable type upgrades.
 
-       Tag sources with `VER-2-4-6'.
+2014-10-29  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * docs/CHANGES: Updated.
+       [smooth] Improve code readability.
 
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.4.6.
+       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code.
 
-       * 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/.
+2014-10-29  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 6.
+       Unify hypotenuse approximations.
 
-       * builds/unix/configure.raw (version_info): Set to 13:1:7.
+       * include/internal/ftcalc.h (FT_HYPOT): Move macro from here...
+       * include/internal/ftobjs.h: ... to here, next to required `FT_ABS'.
+       * src/smooth/ftgrays.c (gray_render_cubic): Use it here.
 
-2011-07-29  Werner Lemberg  <wl@gnu.org>
+2014-10-25  Werner Lemberg  <wl@gnu.org>
 
-       [cff] Add some more tracing infos.
+       [cff] Test valid darkening parameter macros in `ftoption.h'.
 
-       * src/cff/cffparse.c (cff_parse_font_matrix, cff_parse_font_bbox,
-       cff_parse_cid_ros): Add tracing.
+       We no longer need an otherwise unused typedef that can cause a gcc
+       warning.
+       Problem reported by Alexei.
 
-2011-07-22  Dirk Müller  <dmueller@suse.de>
+       * src/cff/cffobjs.c (cff_driver_init): Use
+       `CFF_CONFIG_OPTION_DARKENING_PARAMETER_XXX' macros directly.
+       (SET_DARKENING_PARAMETERS): Removed.
+       Compile time tests are now ...
 
-       [psaux, type1] Fix null pointer dereferences.
+       * devel/ftoption.h, include/config/ftoption.h: ... here.
 
-       Found with font fuzzying.
+2014-10-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Check
-       `decoder->buildchar'.
+       Improve flat corner definition.
 
-       * src/type1/t1load.c (t1_load_keyword): Check `blend->num_designs'.
+       * include/internal/ftcalc.h (FT_HYPOT): Macro to approximate Euclidean
+       distance with the alpha max plus beta min algorithm.
+       * src/base/ftcalc.c (ft_corner_is_flat): Use it instead of Taxicab
+       metric.
 
-2011-07-20  Chris Morgan  <cmorgan@cybexintl.com>
+2014-10-23  David Weiß  <David.Weiss@ptvgroup.com>
 
-       Add FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT.
+       [build] Improve property file for vc2010.
 
-       Useful for embedded systems which don't need file stream support.
+       User-defined properties should be empty by default to prevent linker
+       failures.
 
-       * src/base/ftsystem.c, src/base/ftobjs.c (FT_Stream_New): Implement
-       it.
+       * builds/windows/vc2010/freetype.user.props,
+       builds/windows/vc2010/freetype.vcxproj:
+       s/OptionsDirectory/UserOptionDirectory/.
+       Comment out all user options.
 
-2011-07-20  Elton Chung  <elton328@gmail.com>
+2014-10-23  Werner Lemberg  <wl@gnu.org>
 
-       * src/base/ftpatent.c (FT_Face_SetUnpatentedHinting): Fix typo.
+       [cff] Work around bug in preprocessor of MSVC 2010.
 
-2011-07-16  Steven Chu  <steven.f.chu@gmail.com>
+       We have been hit by
 
-       [truetype] Fix metrics on size request for scalable fonts.
+         https://connect.microsoft.com/VisualStudio/feedback/details/718976/msvc-pr
 
-       * src/truetype/ttdriver.c (tt_size_request): Fix copying metrics
-       from TT_Size to FT_Size if scalable font.
+       * devel/ftoption.h, include/config/ftoption.h: Replace
+       `CFF_CONFIG_OPTION_DARKENING_PARAMETERS' with eight macros
+       `CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4}'.
 
-       See
+       * src/cff/cffobjs.c (SET_DARKENING_PARAMETERS): Removed.  We no
+       longer need double expansion.
+       (SET_DARKENING_PARAMETERS_0): Renamed to ...
+       (SET_DARKENING_PARAMETERS): ... this.
+       Update call.
 
-         http://lists.gnu.org/archive/html/freetype-devel/2011-07/msg00049.html
+2014-10-20  Werner Lemberg  <wl@gnu.org>
 
-       for some comparison images.
+       [sbit] Minor fixes.
 
-2011-07-14  Matthias Drochner  <M.Drochner@fz-juelich.de>.
+       * src/sfnt/ttsbit.c (tt_face_load_sbit) [TT_SBIT_TABLE_TYPE_SBIX]:
+       Accept overlay format also, but emit warning message in that case.
+       (tt_sbit_decoder_load_metrics): Add missing newline to error
+       message.
+       (tt_sbit_load_sbix_image): Add `rgbl' graphic type (as used on iOS
+       7.1) to the list of unsupported formats.
 
-       [psaux] Fix potential sign extension problems.
+2014-10-19  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       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.
+       [truetype] Clean up bytecode rounding.
 
-       * src/psaux/t1decode.c (Fix2Int): New macro.
-       Use it where appropriate.
+       Zero distance does not have to be treated specially if you follow
+       specifications and check the sign as the very last step of rounding.
 
-2011-07-14  Werner Lemberg  <wl@gnu.org>
+       * src/truetype/ttinterp.c (Round_None, Round_To_Grid,
+       Round_Down_To_Grid, Round_Up_To_Grid, Round_To_Double_Grid): Use
+       macros when available, do not check for non-zero distance.
+       (Round_To_Half_Grid, Round_Super, Round_Super_45): Ditto, return phase
+       if sign changed.
 
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
-       <op_callothersubr>: Better handling of subroutine index 0.
-       From Matthias Drochner <M.Drochner@fz-juelich.de>.
+2014-10-18  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-2011-07-10  Алексей Подтележников  <apodtele@gmail.com>
+       [truetype] Unwrap engine compensation settings.
 
-       [psaux] Optimize previous commit.
+       * src/truetype/ttobjs.c (tt_size_init_bytecode): Updated.
 
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
-       <op_callothersubr>: Move error check down to avoid testing twice for
-       good cases.
+2014-10-18  David Weiß  <David.Weiss@ptvgroup.com>
 
-2011-07-08  Werner Lemberg  <wl@gnu.org>
+       [build] Add property file to vc2010 project.
 
-       [psaux] Add better argument check for `callothersubr'.
+       This simplifies custom build configurations, especially for
+       automated build environments.
 
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
-       <op_callothersubr>: Reject negative arguments.
+       * builds/windows/vc2010/freetype.user.props: New configuration file.
 
-2011-07-07  Werner Lemberg  <wl@gnu.org>
+       * builds/windows/vc2010/freetype.vcxproj: Include
+       `freetype.user.props' and use its data fields.
 
-       [sfnt] Try harder to find non-zero values for ascender and descender.
+       * builds/windows/vc2010/index.html: Updated.
 
-       * src/sfnt/sfobjs.c (sfnt_load_face): Consult `OS/2' table in case
-       the `hhea' table's values are zero.
+2014-10-18  Werner Lemberg  <wl@gnu.org>
 
-2011-07-03  Werner Lemberg  <wl@gnu.org>
+       [autofit] Add blue-zone support for Telugu.
 
-       Fix previous commit.
+       This essentially moves the Telugu script from the `Indic' hinter to
+       the `Latin' hinter.
 
-       We want to unset FT_FACE_FLAG_SCALABLE only if there are bitmap
-       strikes in the font.
+       Note that this is a first shot and quite certainly needs
+       refinements.
 
-       * src/truetype/ttobjs.c (tt_face_init): Implement it.
+       * src/autofit/afblue.dat: Add blue zone data for Telugu.
 
-       * docs/CHANGES: Updated.
+       * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
 
-2011-07-02  Just Fill Bugs  <mozbugbox@yahoo.com.au>
+       * src/autofit/afscript.h: Add Telugu standard characters and move
+       data out of AF_CONFIG_OPTION_INDIC block.
 
-       Fix Savannah bug #33246.
+       * src/autofit/afranges.c: Move Telugu data out of
+       AF_CONFIG_OPTION_INDIC block.
 
-       * src/truetype/ttobjs.c (tt_check_single_notdef): New function.
-       (tt_face_init): Use it to test FT_FACE_FLAG_SCALABLE.
+       * src/autofit/afstyles.h: Update Telugu data; in particular, use
+       AF_WRITING_SYSTEM_LATIN.
 
-2011-07-02  Werner Lemberg  <wl@gnu.org>
+2014-10-18  David Wimsey  <david@wimsey.us>
 
-       * docs/CHANGES: Updated.
+       [cmake] Add iOS build support.
+       From Savannah patch #8497.
 
-2011-07-02  David Bevan  <david.bevan@pb.com>
+       * builds/cmake/iOS.cmake: New file.  Universal binaries are built
+       with both 32 and 64 bit arm architectures.
 
-       [ftstroke] Major revision.
+       * CMakeLists.txt (IOS_PLATFORM): New variable for running the iOS
+       toolchain.  Possible values are `OS' to build on iOS, or
+       `SIMULATOR' to build on APPLE.
 
-       The main problems
-       -----------------
+2014-10-16  Behdad Esfahbod  <behdad@behdad.org>
+           Werner Lemberg  <wl@gnu.org>
 
-         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.
+       [cff] Add `CFF_CONFIG_OPTION_DARKENING_PARAMETERS' config macro.
 
-         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.
+       * devel/ftoption.h, include/config/ftoption.h
+       (CFF_CONFIG_OPTION_DARKENING_PARAMETERS): New macro.
 
-       The main fixes
-       --------------
+       * src/cff/cffobjs.c (SET_DARKENING_PARAMETERS,
+       SET_DARKENING_PARAMETERS_0): New macros.
+       (cff_driver_init): Use new macros.
 
-         o The behaviour of FT_STROKER_LINEJOIN_BEVEL has been corrected.
+2014-10-14  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-         o A new line join style, FT_STROKER_LINEJOIN_MITER_FIXED, has been
-           introduced to support PostScript and PDF miter joins.
+       [truetype] Limit delta shift range.
 
-         o FT_STROKER_LINEJOIN_MITER_VARIABLE has been introduced as an
-           alias for FT_STROKER_LINEJOIN_MITER.
+       The valid range for delta shift is zero through six.  Negative values
+       are invalid according to
 
-       Additionally, a variety of stroking errors have been fixed.  These
-       would cause various artifacts (including points `at infinity'),
-       especially when stroking poor quality fonts.
+         https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html#delta%20shift
 
-       See
+       * src/truetype/ttobjs.h (delta_shift, delta_base): Make unsigned.
+       * src/truetype/ttinterp.h (DO_SDS): Throw an error if `delta_shift'
+       is out of range.
+       (Ins_DELTAP, Ins_DELTAC): Optimize for valid `delta_shift'.
 
-         http://lists.gnu.org/archive/html/freetype-devel/2011-07/msg00001.html
+2014-10-16  Werner Lemberg  <wl@gnu.org>
 
-       for example documents.  The FreeType stroker now produces results
-       very similar to that produced by GhostScript and Distiller for these
-       fonts.
+       A better fix for Savannah bug #43392.
+       Suggested by Doug Felt <dougfelt@gmail.com>.
 
-       Other problems
-       --------------
+       * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Set
+       `vertAdvance' to zero...
 
-       The following problems have been resolved:
+       * src/truetype/ttgload.c (TT_Load_Glyph): ... and set here a default
+       value for `vertAdvance' based on `linearVertAdvance' in case
+       `vertAdvance' is zero.  Note that the previous computed ad-hoc value
+       for `linearVertAdvance' was apparently not tested in a real-life
+       situation.
 
-         o Inside corners could be generated incorrectly.  Intersecting the
-           inside corner could cause a missing triangular area and other
-           effects.
+2014-10-14  David Weiß  <David.Weiss@ptvgroup.com>
 
-           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'.
+       [build] Better optimization settings for vc2010 solution file.
 
-         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.
+       * builds/windows/vc2010/freetype.sln,
+       builds/windows/vc2010/freetype.vcxproj: Updated.
 
-         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.)
+2014-10-14  Werner Lemberg  <wl@gnu.org>
 
-         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.
+       [autofit] Adjust Devenagari character range.
 
-         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.
+       * src/autofit/afranges.c (af_deva_uniranges): Omit characters that
+       are common to all other Indic scripts.
 
-         o Cubics with close control points could be mishandled.  All eight
-           cases are now distinguished correctly.
+2014-10-12  Werner Lemberg  <wl@gnu.org>
 
-       Other improvements
-       ------------------
+       [sfnt] Fix Savannah bug #43392.
 
-       o Borders for cubic curves could be too `flat'.
-         FT_SMALL_CUBIC_THRESHOLD has been reduced a little to prevent
-         this.
+       * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Don't let
+       vertical metrics uninitialized.
 
-       o The handling and use of movable points has been simplified a
-         little.
+2014-10-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       o Various values are now computed only if the results are actually
-         needed.
+       [base] Small bbox correction.
 
-       o The directions of the outer and inner borders have been swapped,
-         as recommended by Graham Asher.
+       * src/base/ftbbox.c (FT_Outline_Get_BBox): Start from nonsense bbox
+       instead of initial point that could be `off' in conic outlines.
 
-       * src/base/ftstroke.c: Revised.
-       * include/freetype/ftstroke.h: Updated.
+2014-10-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-2011-06-30  İsmail Dönmez <ismail@namtrac.org>
+       [base] Fix Savannah bug #43356.
 
-       * builds/toplevel.mk: We use git, not CVS, thus skip `.gitignore'.
+       * src/base/ftbbox.c (BBox_Move_To, BBox_Conic_To): Update bbox in case
+       of implicit `to'.
+       (BBox_Line_To): New emitter that does not update bbox.
 
-2011-06-29  Werner Lemberg  <wl@gnu.org>
+2014-10-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       Fix Savannah bug #33663.
+       [base] Introduce and use new macro `FT_UPDATE_BBOX'
 
-       * src/bdf/bdflib.c (_bdf_parse_glyphs): Handle negative values for
-       ENCODING correctly.
+       * src/base/ftbbox.c (FT_UPDATE_BBOX): New macro.
+       (FT_Outline_Get_BBox): Use it here.
 
-       * docs/CHANGES: Document it.
+2014-10-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-2011-06-24  Werner Lemberg  <wl@gnu.org>
+       [base] Significant optimization of `ft_div64by32'
 
-       * Version 2.4.5 released.
-       =========================
+       We shift as many bits as we can into the high register, perform
+       32-bit division with modulo there, then work through the remaining
+       bits with long division. This optimization is especially noticeable
+       for smaller dividends that barely use the high register.
 
+       * src/base/ftcalc.c (ft_div64by32): Updated.
 
-       Tag sources with `VER-2-4-5'.
+2014-10-02  Dave Arnold  <darnold@adobe.com>
 
-       * docs/CHANGES: Updated.
+       [cff] Fix Savannah bug #43271.
 
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.4.5
+       * src/cff/cf2font.c (cf2_computeDarkening): Change overflow
+       detection to use logarithms and clamp `scaledStem'.
 
-       * 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/.
+2014-10-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5.
+       * src/base/ftcalc.c: Remove miscellaneous type casts.
 
-       * builds/unix/configure.raw (version_info): Set to 13:0:7.
+2014-10-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-2011-06-20  Werner Lemberg  <wl@gnu.org>
+       [base] Use more common `FT_MSB' implementation with masks.
 
-       * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Fix change
-       from 2011-05-04.
+       * src/base/ftcalc.c (FT_MSB): Updated.
 
-2011-06-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-09-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       [gxvalid] make the `prop' validation tracing verbose.
+       [base] Clean up.
 
-       * src/gxvalid/gxvprop.c: Add tracing messages for errors.
+       * src/base/ftcalc.c (FT_MOVE_SIGN): New macro for frequently used
+       code.
 
-2011-06-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-09-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       [autogen.sh] Reflect environment variable LIBTOOLIZE.
+       [base] Avoid unnecessary long division.
 
-2011-06-18  Werner Lemberg <wl@gnu.org>
+       This applies to `FT_MulDiv' but not to `FT_DivFix', where overflows or
+       lack thereof are predicted accurately.
 
-       Update license documentation.
+       * src/base/ftcalc.c (ft_div64by32): Improve readability.
+       (FT_MulDiv, FT_MulDiv_No_Round) [!FT_LONG64]: Use straight division
+       when multiplication stayed within 32 bits.
 
-       * docs/GPL.TXT: Renamed to...
-       * docs/GPLv2.TXT: This.
+2014-09-24  Werner Lemberg  <wl@gnu.org>
 
-       * docs/LICENSE.TXT: Updated.
+       [autofit] Minor clean-ups.
 
-2011-06-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/autofit/afhints.c (AF_FLAGS): Remove obsolete values.
 
-       Fix g++4.6 compiler warnings in module drivers.
+       * src/autofit/afhints.c (af_glyph_hints_dump_points,
+       af_glyph_hints_align_strong_points): Updated.
 
-       The background is same with previous commit.
+       * src/autofit/aflatin.c (af_latin_hints_link_segments,
+       af_latin_hints_compute_segments), src/autofit/afcjk.c
+       (af_cjk_hints_link_segments), src/autofit/aflatin2.c
+       (af_latin2_hints_link_segments, af_latin2_hints_compute_segments):
+       There are no longer fake segments since more than 10 years...
 
-       * 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.
+2014-09-22  Werner Lemberg  <wl@gnu.org>
 
-2011-05-27  Werner Lemberg  <wl@gnu.org>
+       [autofit] Minor code streamlining.
 
-       [autofit] Improve tracing of hinting process.
+       * src/autofit/afhints.c (af_axis_hints_new_edge): Remove redundant
+       initialization.
 
-       * src/autofit/aflatin.c (af_latin_hint_edges): Add tracing message
-       `ADJUST'.
+2014-09-19  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-2011-05-26  Werner Lemberg  <wl@gnu.org>
+       * src/base/ftcalc.c: Harmonize code.
 
-       [autofit] Fix trace message.
+2014-09-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * src/autofit/aflatin.c (af_latin_hint_edges): Show correct value in
-       tracing message.
+       [base] Tighten the overflow check in `FT_MulDiv'.
 
-2011-05-24  Daniel Zimmermann  <netzimme@googlemail.com>
+       * src/base/ftcalc.c (FT_MulDiv) [!FT_LONG64]: Updated.
 
-       Reduce warnings for MS Visual Studio 2010.
+2014-09-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * 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.
+       Fix Savannah bug #43153.
 
-2011-05-16  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/psaux/psconv.c (PS_Conv_ToFixed): Add protection against
+       overflow in `divider'.
 
-       Automake component `builds/unix/install-sh' is removed.
+2014-09-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * builds/unix/install-sh: Removed.  It is not needed to
-       include repository, because autogen.sh installs it.
-       * builds/unix/.gitignore: Register install-sh.
+       [base] Tighten the overflow check in `FT_DivFix'.
 
-2011-05-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       This fixes a 13-year old bug. The original overflow check should have
+       been updated when rounding was introduced into this function
+       (c2cd00443b).
 
-       [autofit] Make trace message for CJK bluezone more verbose.
+       * src/base/ftcalc.c (FT_DivFix) [!FT_LONG64]: Updated.
+       * include/freetype.h (FT_DivFix): Updated documentation.
 
-2011-05-08  Just Fill Bugs  <mozbugbox@yahoo.com.au>
-            suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-09-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       [autofit] Add bluezones for CJK Ideographs.
+       [base] Tighten the overflow check in `FT_MulFix'.
 
-       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
+       * src/base/ftcalc.c (FT_MulFix) [!FT_LONG64]: Updated.
 
-       * 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.
+2014-09-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * 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.
+       [truetype] Shortcut ppem calculations for square pixels.
 
-       * docs/CHANGES: Note about CJK bluezone support.
+       * src/truetype/ttinterp.h (TT_ExecContextRec): New field
+       `cur_ppem_func' with a function pointer.
+       * src/truetype/ttinterp.c (TT_RunIns): Initialize `cur_ppem_func'
+       depending on the pixel geometry to either...
+       (Current_Ppem_Stretched): ... this for stretched pixels.
+       (Current_Ppem): ... or this for square pixels.
+       (DO_MPPEM, DO_MPS, Ins_DELTAP, Ins_DELTAC): Use `cur_ppem_func'.
 
-2011-05-06  Werner Lemberg  <wl@gnu.org>
+2014-08-31  Behdad Esfahbod  <behdad@behdad.org>
 
-       [autofit] Remove unused struct member.
+       Don't use `register' keyword.  Fixes compiler warnings.
 
-       * src/autofit/aflatin.h (AF_LatinAxis): Remove `control_overshoot'.
+       * src/base/ftcalc.c (FT_Add64) [!FT_LONG64]: Do it.
+       * src/gzip/inftrees.c (huft_build): Ditto.
+       * src/truetype/ttinterp.c (TT_MulFix14_arm): Ditto.
 
-2011-05-04  Werner Lemberg  <wl@gnu.org>
+2014-08-24  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Simplify.
+       [truetype] Optimize DELTAP and DELTAC.
 
-2011-05-01  Just Fill Bugs  <mozbugbox@yahoo.com.au>
-            Werner Lemberg  <wl@gnu.org>
+       * src/truetype/ttinterp.c (Ins_DELTAP, Ins_DELTAC): Move ppem
+       calculations outside of the loop.
 
-       [autofit] Add more debugging functions.
+2014-08-21  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * src/autofit/afhints.c (af_glyph_hints_get_num_segments,
-       af_glyph_hints_get_segment_offset): New functions.
+       Fix Savannah bug #43033.
 
-2011-05-01  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * include/config/ftconfig.h, builds/unix/ftconfig.in,
+       builds/vms/ftconfig.h [FT_LONG64]: Do not disable the macro when
+       64-bit type is `long'.
 
-       Add new option `--disable-mmap' to configure script.
+2014-08-20  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * 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.
+       [base] Small optimization of `FT_MulFix'.
 
-2011-04-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/base/ftcalc.c (FT_MulFix): Loosen up the condition for direct
+       32-bit calculations.
 
-       [truetype] Always recalculate the sfnt table checksum.
+2014-08-19  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * 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
+       [base] Use unsigned calculation in `FT_MulDiv'.
 
-2011-04-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/base/ftcalc.c (FT_MulDiv): Updated to expand 32-bit range.
 
-       [truetype] Register a set of tricky fonts, NEC FA family.
+2014-08-18  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * 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.
+       [base] Remove truncation in `FT_DivFix'.
 
-2011-04-29  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/base/ftcalc.c (FT_DivFix): Updated.
 
-       [truetype] Fix a bug in the sfnt table checksum getter.
+2014-08-14  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * src/truetype/ttobjs.c (tt_get_sfnt_checksum): Check the
-       return value of face->goto_table() correctly.
+       Minor refactoring.
 
-2011-04-28  Werner Lemberg  <wl@gnu.org>
+       * src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round): Updated.
 
-       [autofit] Improve tracing messages.
+2014-08-14  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * src/autofit/aflatin.c (af_latin_metrics_init_blues,
-       af_latin_align_linked_edge, af_latin_hint_edges): Do it.
+       Turn FT_MSB into a macro when using gcc builtins.
 
-2011-04-25  Kan-Ru Chen  <kanru@kanru.info>
+       * src/base/ftcalc.c, include/internal/ftcalc.h: Updated.
 
-       [truetype] Always check the checksum to identify tricky fonts.
+2014-08-12  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       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
+       [base] Avoid undefined FT_MSB in `BBox_Cubic_Check'.
 
-       * src/truetype/ttobjs.c (tt_check_trickyness): Even when
-       tt_check_trickyness_family() finds no trickyness,
-       tt_check_trickyness_sfnt_ids() is invoked.
+       * src/base/ftbbox.c (BBox_Cubic_Check): Update.
+       (update_cubic_max): Repalce with...
+       (cubic_peak): ... this, which now handles upscaling.
 
-2011-04-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-08-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       [autofit] Add more Indic scripts with hanging baseline.
+       [base] Handle collapsed outlines to avoid undefined FT_MSB.
 
-       * src/autofit/afindic.c (af_indic_uniranges): Tibetan, Limbu,
-       Sundanese, Meetei Mayak, Syloti Nagri and Sharada scripts are
-       added.
+       * src/base/ftoutln.c (FT_Outline_Get_Orientation): Update.
 
-2011-04-21  Behdad Esfahbod  <behdad@behdad.org>
+2014-08-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       Always ignore global advance.
+       [base] Restore FT_MulFix inlining.
 
-       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.
+       * include/freetype.h (FT_MulFix): Unconditionally defined.
 
-       * 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.
+       * src/base/ftcalc.c [FT_MULFIX_ASSEMBLER]: Move code from here...
 
-       * docs/CHANGES: Updated.
+       * include/internal/ftcalc.h [FT_MULFIX_ASSEMBLER]: ... to here,
+       which conditionally replaces the function with an inline version
+       through the macro.
 
-2011-04-21  rainy6144  <rainy6144@gmail.com>
+2014-08-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       [autofit] Blur CJK stems if too many to preserve their gaps.
+       * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Refactor.
 
-       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.
+2014-07-26  Werner Lemberg  <wl@gnu.org>
 
-       * 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.
+       [cff] Fix typo.
 
-2011-04-18  Werner Lemberg  <wl@gnu.org>
+       * src/cff/cf2hints.c (cf2_glyphpath_computeOffset): Use correct
+       offsets in third quadrant.
 
-       Integrate autofitter debugging stuff.
+       Reported by maks <maksqwe1@ukr.net>.
 
-       * devel/ftoption.h, include/freetype/config/ftoption.h
-       (FT_DEBUG_AUTOFIT): New macro.
+2014-07-17  Werner Lemberg  <wl@gnu.org>
 
-       * include/freetype/internal/fttrace.h: Add trace components for
-       autofitter.
+       Fix Savannah bug #42788.
 
-       * src/autofit/aftypes.h (AF_LOG): Removed.
-       (_af_debug): Removed.
+       * src/pfr/pfrobjs.c: Include `ftcalc.h'.
 
-       * src/autofit/*: s/AF_DEBUG/FT_DEBUG_AUTOFIT/.
-       s/AF_LOG/FT_TRACE5/.
-       Define FT_COMPONENT where necessary.
+2014-07-16  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-2011-04-18  Werner Lemberg  <wl@gnu.org>
+       Replace `ft_highpow2' function.
 
-       Synchronize config files.
+       * src/pfr/pfrobjs.c (pfr_face_get_kerning): Use `FT_MSB' instead of
+       `ft_highpow2'.
 
-       * builds/unix/ftconfig.in: Copy missing assembler routines from
-       include/freetype/config/ftconfig.h.
+       * src/base/ftutil.c, include/internal/ftobjs.h (ft_highpow2): Remove
+       it.
 
-2011-04-13  Werner Lemberg  <wl@gnu.org>
+2014-07-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       Fix Savannah bug #33047.
+       * src/base/ftcalc.c (FT_MSB): Utilize gcc builtins.
 
-       Patch submitted by anonymous reporter.
+2014-07-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * src/psaux/psobjs.c (ps_table_add): Use FT_PtrDist for pointer
-       difference.
+       [base] Move assembler code back in the source file.
 
-2011-04-11  Kan-Ru Chen  <kanru@kanru.info>
+       FT_MulFix assembler used to reside in ftcalc.c before f47d263f1b.
 
-       Fix reading of signed integers from files on 64bit platforms.
+       * include/config/ftconfig.h, builds/unix/ftconfig.in,
+       builds/vms/ftconfig.h [FT_MULFIX_ASSEMBLER]: Move code from here...
 
-       Previously, signed integers were converted to unsigned integers, but
-       this can fail because of sign extension.  For example, 0xa344a1eb
-       becomes 0xffffffffa344a1eb.
+       * src/base/ftcalc.c [FT_MULFIX_ASSEMBLER]: ... to here.
 
-       We now do the reverse which is always correct because the integer
-       size is the same during the cast from unsigned to signed.
+2014-07-14  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * 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.
+       [base] Further clean up color bitmap conversion.
 
-       * src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Updated.
+       * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Stop
+       using FT_MulFix and FT_DivFix since all calculations fit into 32 bits.
 
-2011-04-07  Werner Lemberg  <wl@gnu.org>
+2014-07-13  Werner Lemberg  <wl@gnu.org>
 
-       Update Unicode ranges for CJK autofitter; in particular, add Hangul.
+       [truetype] Improve handling of buggy `prep' tables.
 
-       * src/autofit/afcjk.c (af_cjk_uniranges): Update to Unicode 6.0.
+       In case of an error in the `prep' table, no longer try to execute it
+       again and again.  This makes FreeType handle endless loops in buggy
+       fonts much faster.
 
-2011-04-04  Werner Lemberg  <wl@gnu.org>
+       * src/truetype/ttobjs.h (TT_SizeRec): The fields `bytecode_ready'
+       and `cvt_ready' are now negative if not initialized yet, otherwise
+       they indicate the error code of the last run.
 
-       Fix formatting of autofit debug dumps.
+       * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep,
+       tt_size_done_bytecode, tt_size_init_bytecode,
+       tt_size_ready_bytecode, tt_size_init, tt_size_done, tt_size_reset):
+       Updated.
 
-       * src/autofit/afhints.c (af_glyph_hints_dump_points,
-       af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Adjust
-       column widths.
+       * src/truetype/ttgload.c (tt_loader_init): Updated.
+       * src/truetype/ttinterp.c (TT_RunIns): Force reexecution of `fpgm'
+       and `prep' only if we are in the `glyf' table.
 
-2011-03-30  Werner Lemberg  <wl@gnu.org>
+2014-07-12  Werner Lemberg  <wl@gnu.org>
 
-       * src/autofit/aftypes.h (AF_OutlineRec): Removed, unused.
+       * builds/vms/ftconfig.h: Synchronize.
+       Problem reported by Alexei.
 
-2011-03-24  Werner Lemberg  <wl@gnu.org>
+2014-07-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 256.
-       This limit is given on p. 37 of Adobe Technical Note #5014.
+       [base] Clean up bitmap conversion.
 
-2011-03-23  Werner Lemberg  <wl@gnu.org>
+       * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use
+       appropriate FT_DivFix and remove superfluous upscaling.
 
-       * src/truetype/ttpload.c (tt_face_load_loca): Fix mismatch warning.
+2014-07-04  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-2011-03-20  Werner Lemberg  <wl@gnu.org>
+       [base] Small optimization of the ancient code.
 
-       * src/sfnt/sfobjs.c (sfnt_open_font): Check number of TTC subfonts.
+       * src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round): Loosen up the
+       condition for direct 32-bit calculations.
 
-2011-03-19  Werner Lemberg  <wl@gnu.org>
+2014-06-27  Werner Lemberg  <wl@gnu.org>
 
-       More C++ compilation fixes.
+       Fix Apple standard glyph names.
 
-       * src/autofit/afhints.c (af_glyph_hints_dump_points,
-       af_glyph_hints_dump_segments, af_glyph_hints_dump_edges)
-       [__cplusplus]: Protect with `extern "C"'.
+       * src/sfnt/ttpost.c (tt_post_default_names): Synchronize with
+       `tools/glnames.py'
 
-2011-03-18  Werner Lemberg  <wl@gnu.org>
+       Problem reported by Adam Twardoch <adam@fontlab.com>.
 
-       C++ compilation fixes.
+2014-06-17  Werner Lemberg  <wl@gnu.org>
 
-       * src/autofit/aflatin.c (af_latin_hints_apply), src/autofit/afcjk.c
-       (af_cjk_hints_apply): Use cast for `dim'.
+       Partially revert commit from 2014-06-13.
 
-2011-03-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
+       * src/autofit/aflatin.c (af_latin_metrics_init_blues): Move
+       declaration of `p_first' and `p_last' out of the loop.
 
-       A better fix for Savannah bug #32671.
+2014-06-17  Werner Lemberg  <wl@gnu.org>
 
-       * src/smooth/ftgrays.c (gray_render_conic): Clean up code and
-       replace WHILE loop with a more natural DO-WHILE construct.
+       * builds/unix/freetype2.m4: s/AC_PATH_PROG/AC_PATH_TOOL/.
 
-2011-03-16  Werner Lemberg  <wl@gnu.org>.
+       This simplifies cross-compiling.
 
-       * src/base/ftstroke.c (FT_StrokerRec): Remove unused `valid' field.
-       Suggested by Graham Asher.
+2014-06-13  Werner Lemberg  <wl@gnu.org>
 
-2011-03-09  Werner Lemberg  <wl@gnu.org>
+       Fix more compiler warnings.
+       Reported by Wojciech Mamrak <wmamrak@gmail.com>.
 
-       Make FT_Sfnt_Table_Info return the number of SFNT tables.
+       * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
+       Make integer constant unsigned.
 
-       * src/sfnt/sfdriver.c (sfnt_table_info): Implement it.
-       * include/freetype/tttables.h: Update documentation.
-       * docs/CHANGES: Updated.
+       * src/sfnt/ttsbit.c (tt_face_load_strike_metrics)
+       <TT_SBIT_TABLE_TYPE_SBIX>: Fix types.
+       (tt_sbit_decoder_load_compound, tt_face_load_sbix_image): Add proper
+       casts.
 
-2011-03-07  Bram Tassyns  <bramt@enfocus.be>
+2014-06-13  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #27988.
+       Fix compiler warnings.
+       Reported by Wojciech Mamrak <wmamrak@gmail.com>.
 
-       * src/cff/cffobjs.c (remove_style): New function.
-       (cff_face_init): Use it to strip off the style part of the family
-       name.
+       * src/autofit/afglobal.c (af_face_globals_compute_style_coverage),
+       src/autofit/afmodule.c (af_property_set): Fix `signed' vs.
+       `unsigned' issues.
 
-2011-03-07  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/aflatin.c (af_latin_metrics_init_blues): Make compiler
+       happy.
 
-       * docs/CHANGES: Updated.
+       * src/base/ftlcdfil.c (_ft_lcd_filter_fir): Use only four elements
+       for `fir'.
+       Fix `signed' vs. `unsigned' issues.
 
-2011-03-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
+       * src/sfnt/sfobjs.c (WRITE_BYTE): Removed, unused.
+       (WRITE_USHORT, WRITE_ULONG): Add proper casts.
 
-       Quick fix for Savannah bug #32671.
+       * src/truetype/ttgload.c (TT_Get_VMetrics): Add proper casts.
 
-       This isn't the optimal solution yet, but it restores the previous
-       rendering quality (more or less).
+       * src/truetype/ttinterp.c (Ins_DELTAP): Add proper casts for `B1'
+       and `B2'.
 
-       * src/smooth/ftgrays.c (gray_render_conic): Do more splitting.
+2014-05-16  Alexey Petruchik  <alexey.petruchik@gmail.com>
 
-2011-03-06  Werner Lemberg  <wl@gnu.org>
+       [cmake] Add option to build OS X framework.
 
-       Fix autohinting fallback.
+       * CMakeLists.txt: Update accordingly.
 
-       * src/base/ftobjs.c (FT_Load_Glyph): Assure that we only check TTFs,
-       ignoring CFF-based OTFs.
+       * builds/mac/freetype-Info.plist: New file.
 
-2011-02-27  Werner Lemberg  <wl@gnu.org>
+2014-05-13  Pavel Koshevoy  <pkoshevoy@gmail.com>
 
-       Add AF_CONFIG_OPTION_USE_WARPER to control the autofit warper.
+       * CMakeLists.txt (BASE_SRCS): Add missing `ftbdf.c'.
 
-       * devel/ftoption.h, include/freetype/config/ftoption.h
-       (AF_CONFIG_OPTION_USE_WARPER): New macro.
-       * src/autofit/aftypes.h (AF_USE_WARPER): Remove.
+2014-05-11  Werner Lemberg  <wl@gnu.org>
 
-       * src/autofit/*: s/AF_USE_WARPER/AF_CONFIG_OPTION_USE_WARPER/.
+       [autofit] Fix variable initializations.
 
-       * src/autofit/afwarp.c [!AF_CONFIG_OPTION_USE_WARPER]: Replace dummy
-       variable assignment with a typedef.
+       * src/autofit/afhints.c (af_glyph_hints_reload): Assign default
+       values to `in_dir' and `out_dir' for all points.
 
-2011-02-26  Werner Lemberg  <wl@gnu.org>
+2014-05-11  Werner Lemberg  <wl@gnu.org>
 
-       [autofit] Slight simplifications.
+       [autofit] Fix crash with font `CabinSketch-Bold.ttf'.
 
-       * src/autofit/aflatin.c (af_latin_hints_link_segments): Remove
-       test which always returns false.
-       (af_latin_hints_compute_blue_edges): Remove redundant assignment.
+       Problem reported by Ralf S. Engelschall <rse@engelschall.com>.
 
-2011-02-24  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/afhints.c (af_glyph_hints_reload): Fix threshold for
+       finding first non-near point.
+       Properly initialize non-near point deltas.
 
-       * docs/PROBLEMS: Mention rendering differences on different
-       platforms.
-       Suggested and worded by Jason Owen <jason.a.owen@gmail.com>.
+2014-05-01  Werner Lemberg  <wl@gnu.org>
 
-2011-02-24  Werner Lemberg  <wl@gnu.org>
+       [autofit] Add blue-zone support for Devanagari.
 
-       [autofit] Comment out unused code.
+       This essentially moves the Devanagari script from the `Indic' hinter
+       to the `Latin' hinter.  Thanks to Girish Dalvi
+       <girish.dalvi@gmail.com> for guidance with blue zone characters!
 
-       * src/autofit/aflatin.c, src/autofit/aflatin2.c
-       (af_latin_hints_compute_edges): Do it.
+       * src/autofit/afblue.dat: Add blue zone data for Devanagari.
 
-2011-02-24  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
 
-       * src/autofit/afhints.h (AF_GlyphHints): Remove unused field.
+       * src/autofit/afscript.h: Add Devanagari standard characters and
+       move data out of AF_CONFIG_OPTION_INDIC block.
 
-2011-02-20  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/autofit/afranges.c: Move Devanagari data out of
+       AF_CONFIG_OPTION_INDIC block.
+       Move U+20B9, (new) Rupee sign, from Latin to Devanagari.
 
-       [cache] Fix an off-by-one bug in `FTC_Manager_RemoveFaceID'.
-       Found by <ychen1392001@yahoo.com.cn>, see detail in
+       * src/autofit/afstyles.h: Update Devanagari data; in particular, use
+       AF_WRITING_SYSTEM_LATIN.
 
-         http://lists.gnu.org/archive/html/freetype/2011-01/msg00023.html
+2014-05-01  Werner Lemberg  <wl@gnu.org>
 
-       * src/cache/ftccache.c (FTC_Cache_RemoveFaceID): Check the node
-       buckets[cache->p + cache->mask] too.
+       [autofit] Fix handling of neutral blue zones in stems.
 
-2011-02-19  Kevin Kofler  <kevin.kofler@chello.at>
+       * src/autofit/afhints.h (AF_Edge_Flags): New value
+       `AF_EDGE_NEUTRAL'.
 
-       Fall back to autohinting if a TTF/OTF doesn't contain any bytecode.
-       This is Savannah patch #7471.
+       * src/autofit/aflatin.c (af_latin_hints_compute_blue_edges): Trace
+       neutral blue zones with AF_EDGE_NEUTRAL.
+       (af_latin_hint_edges): Skip neutral blue zones if necessary.
 
-       * src/base/ftobjs.c (FT_Load_Glyph): Implement it.
+2014-04-28  Werner Lemberg  <wl@gnu.org>
 
-2011-02-19  John Tytgat  <John.Tytgat@esko.com>
+       [autofit] Introduce neutral blue zones to the latin module.
 
-       [cff] Fix subset prefix removal.
-       This is Savannah patch #7465.
+       Such blue zones match either the top or the bottom of a contour.  We
+       need them for scripts where accent-like elements directly touch the
+       base character (for example, some vowel signs in Devanagari, cf.
+       U+0913 or U+0914).
 
-       * src/cff/cffobjs.c (remove_subset_prefix): Update length after
-       subset prefix removal.
+       * src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_NEUTRAL): New
+       property.
 
-2011-02-13  Bradley Grainger  <bgrainger@logos.com>
+       * src/autofit/afblue.h: Regenerated.
 
-       Add inline assembly version of FT_MulFix for MSVC.
+       * src/autofit/aflatin.h (AF_LATIN_IS_NEUTRAL_BLUE): New macro.
+       (AF_LATIN_BLUE_NEUTRAL): New enumeration value.
 
-       * 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++.
+       * src/autofit/aflatin.c (af_latin_metrics_init_blues,
+       af_latin_hints_compute_blue_edges): Handle neutral blue zones.
 
-2011-02-13  Bradley Grainger  <bgrainger@logos.com>
+2014-04-25  Werner Lemberg  <wl@gnu.org>
 
-       Add project and solution files in Visual Studio 2010 format.
+       * src/autofit/hbshim.c: Partially revert commit from 2014-04-17.
 
-       * 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.
+       Using input glyph coverage data is simply wrong.
 
-2011-02-01  Werner Lemberg  <wl@gnu.org>
+       Problem reported by Nikolaus Waxweiler <madigens@gmail.com> and
+       Mantas Mikulėnas <grawity@gmail.com>.
 
-       * src/autofit/afdummy.c: Include `aferrors.h'.
-       Problem reported by Chris Liddell <chris.liddell@artifex.com>.
+2014-04-23  Werner Lemberg  <wl@gnu.org>
 
-2011-02-01  Werner Lemberg  <wl@gnu.org>
+       * src/raster/ftraster.c (Vertical_Sweep_Span): Use drop-out mode.
 
-       [cff] Ignore unknown operators in charstrings.
-       Patch suggested by Miles.Lau <sunliang_liu@foxitsoftware.com>.
+       This spot has been missed while introducing support for various
+       drop-out modes years ago (including no drop-out mode, which this
+       commit fixes).
 
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings): Emit tracing
-       message for unknown operators and continue instead of exiting with a
-       syntax error.
+       Problem reported by Patrick Thomas <pthomas505@gmail.com>.
 
-2011-02-01  Werner Lemberg  <wl@gnu.org>
+2014-04-22  Werner Lemberg  <wl@gnu.org>
 
-       [truetype] FT_LOAD_PEDANTIC now affects `prep' and `fpgm' also.
+       * src/sfnt/pngshim.c (error_callback): s/longjmp/ft_longjmp/.
 
-       * 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.
+2014-04-20  Werner Lemberg  <wl@gnu.org>
 
-2011-01-31  Werner Lemberg  <wl@gnu.org>
+       [autofit] Fix Savannah bug #42148.
 
-       [truetype] Protect jump instructions against endless loops.
+       The adaptation of the cjk auto-hinter module to blue stringsets in
+       2013-08-25 had three severe bugs.  Mea culpa.
 
-       * src/truetype/interp.c (DO_JROT, DO_JMPR, DO_JROF): Exit with error
-       if offset is zero.
+       1. Contrary to the latin auto-hinter, characters for reference and
+          overshoot values of a blue zone are specified separately.  Due to
+          the screwed-up change it didn't work at all.
 
-2011-01-31  Werner Lemberg  <wl@gnu.org>
+       2. A boolean comparison was erroneously replaced with a cast,
+          causing invalid results with the `^' operator later on.  The
+          visual artifact caused by this problem is the topic of the bug
+          report.
 
-       [truetype] Improve handling of invalid references.
+       3. Two flag values were inverted, causing incorrect assignment of
+          reference and overshoot values.
 
-       * 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.
+       * src/autofit/afblue.dat: Fix CJK bluestrings, introducing a new
+       syntax to have both reference and overshoot characters in a single
+       string.  This is error #1.
+       Add extensive comments.
 
-2011-01-31  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/afblue.hin (AF_BLUE_PROPERTY_CJK_FILL): Removed, no
+       longer used.
+       (AF_BLUE_PROPERTY_CJK_TOP, AF_BLUE_PROPERTY_CJK_HORIZ): Fix values.
+       This is error #3.
 
-       [truetype] Improve handling of stack underflow.
+       * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
 
-       * 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.
+       * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Correct error #1.
+       Use character `|' to separate characters for reference and overshoot
+       values.
+       Improve tracing messages, synchronizing them with the latin
+       auto-hinter.
+       (af_cjk_hints_compute_blue_edges): Fix value of `is_top_right_blue'.
+       This is error #2.
+       (af_cjk_align_linked_edge): Add tracing message.
 
-2011-01-30  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/afcjk.h (AF_CJK_IS_FILLED_BLUE): Removed, no longer
+       used.
 
-       * src/sfnt/ttmtx.c (tt_face_load_hmtx): Fix tracing message.
+2014-04-17  Werner Lemberg  <wl@gnu.org>
 
-2011-01-30  LIU Sun-Liang  <sunliang_liu@foxitsoftware.com>
+       [autofit] More coverage fixes for complex scripts.
 
-       [truetype]: Fix behaviour of MIAP for invalid arguments.
+       * src/autofit/hbshim.c (af_get_coverage): Merge input glyph coverage
+       of GSUB lookups into output coverage.  Otherwise, ligatures are not
+       handled properly.
+       Don't check blue zone characters for default coverage.
 
-       * src/truetype/ttinterp.c (Ins_MIAP): Set reference points even in
-       case of error.
+2014-04-17  Werner Lemberg  <wl@gnu.org>
 
-2011-01-18  Werner Lemberg  <wl@gnu.org>
+       Make `FT_Get_SubGlyph_Info' actually work.
 
-       [truetype] Fix handling of MIRP instruction.
+       * src/base/ftobjs.c (FT_Get_SubGlyph_Info): Return FT_Err_Ok
+       if there is no error.
 
-       Thanks to Greg Hitchcock who explained the issue.
+2014-04-15  Werner Lemberg  <wl@gnu.org>
 
-       * 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.
+       [afblue.pl]: Minor improvements.
 
-2011-01-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/tools/afblue.pl: Allow whitespace before comments.
+       Ignore whitespace in strings.
 
-       Fix ARM assembly code in include/freetype/config/ftconfig.h.
+2014-04-14  Werner Lemberg  <wl@gnu.org>
 
-       * 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.
+       [autofit] Improve coverage handling.
 
-       http://bugreports.qt.nokia.com/browse/QTBUG-6521
+       * src/autofit/hbshim.c (af_get_coverage): Don't exclude glyphs
+       appearing in the GPOS table if we are processing the default
+       coverage.
 
-2011-01-15  Werner Lemberg  <wl@gnu.org>
+2014-04-13  David Weber <weber.aulendorf@googlemail.com>
 
-       [raster] Make bbox handling the same as with Microsoft's rasterizer.
+       [smooth] Fix stand-alone compilation.
 
-       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.
+       * src/smooth/ftgrays.c (FT_BEGIN_STMNT, FT_END_STMNT): Define.
 
-       Thanks to Greg Hitchcock who explained this behaviour.
+2014-04-12  Werner Lemberg  <wl@gnu.org>
 
-       * src/raster/ftrend1.c (ft_raster1_render): Implement it.
+       [autofit] Redesign the recognition algorithm of strong points.
 
-2011-01-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       In particular, local extrema without horizontal or vertical segments
+       are better recognized:
 
-       Copy -mcpu=* & -march=* options from CFLAGS to LDFLAGS.
+         + A                + D
+          \                /
+           \              /
+            \            /
+             \          /
+              \        + C
+               \    /
+              B +/
 
-       * 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.
+       If the distances AB and CD are large, point B wasn't previously
+       detected as an extremum since the `ft_corner_is_flat' function
+       `swallowed' BC regardless of its direction, tagging point B as weak.
+       The next iteration started at B and made `ft_corner_is_flat' swallow
+       point C, tagging it as weak also, et voilà.
 
-2011-01-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       To improve that, another pass gets now performed before calling
+       `ft_corner_is_flat' to improve the `topology' of an outline: A
+       sequence of non-horizontal or non-vertical vectors that point into
+       the same quadrant are handled as a single, large vector.
 
-       Fix off-by-one bug in CFLAGS & LDFLAGS harmonizer.
+       Additionally, distances of near points are now accumulated, which
+       makes the auto-hinter handle them as if they were prepended to the
+       next non-near vector.
 
-       * 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.
+       This generally improves the auto-hinter's rendering results.
 
-2011-01-13  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/afhints.c (af_glyph_hints_reload): Implement it.
 
-       [raster] Add undocumented drop-out rule to the other bbox side also.
+       * src/autofit/afhints.h (AF_FLAGS): Remove no longer used flag
+       `AF_FLAG_NEAR'.
 
-       * src/raster/ftraster.c (Vertical_Sweep_Drop,
-       Horizontal_Sweep_Drop): Implement it.
+2014-04-05  Werner Lemberg  <wl@gnu.org>
 
-2011-01-13  Werner Lemberg  <wl@gnu.org>
+       [autofit] Improve scoring algorithm for identifying stems.
 
-       [raster] Reduce jitter value.
+       Problem reported by Karsten Lücke <karsten.luecke@kltf.de>.
 
-       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.
+       The new algorithm takes care of the width of stems: If the distance
+       between two segments is larger than the largest stem width, the
+       demerits quickly increase for larger distances.  This improves
+       hinting of slanted fonts (especially if the inner parts of serifs
+       have non-horizontal `shoulders'), avoiding false stem links.
 
-       * src/raster/ftraster.c (Set_High_Precision): Implement it.
+       * src/autofit/aflatin.c (af_latin_hints_link_segments): Use largest
+       stem width (if available) to compute better demerits for distances
+       between stems.
+       (af_latin_hints_detect_features): Pass stem width array and array
+       size.
+       (af_latin_metrics_init_widths): Updated to use original algorithm.
+       (af_latin_hints_apply): Updated to use new algorithm.
 
-2011-01-13  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/aflatin.h: Updated.
+       * src/autofit/afcjk.c: Updated.
 
-       [raster] Handle drop-outs at glyph borders according to Microsoft.
+2014-04-03  Werner Lemberg  <wl@gnu.org>
 
-       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.
+       Don't require `gzip' module for `sfnt'.
 
-       Thanks to Greg Hitchcock who explained this behaviour.
+       Reported by Preet <prismatic.project@gmail.com>.
 
-       * src/raster/ftraster.c (Vertical_Sweep_Drop,
-       Horizontal_Sweep_Drop): Implement it.
+       * src/sfnt/sfobjs.c (woff_open_font): Guard use of
+       FT_Gzip_Uncompress with FT_CONFIG_OPTION_USE_ZLIB.
 
-2011-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-03-27  Werner Lemberg  <wl@gnu.org>
 
-       [cache] Fix Savannah bug #31923, patch drafted by Harsha.
+       Fix Savannah bug #38235.
 
-       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
+       Work around a bug in pkg-config version 0.28 and earlier: If a
+       variable value gets surrounded by doublequotes (in particular values
+       for the `prefix' variable), the prefix override mechanism fails.
 
-       * 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.
+       * builds/unix/freetype2.in: Don't use doublequotes.
+       * builds/unix/unix-def.in (freetype.pc): Escape spaces in directory
+       names with backslashes.
 
-2011-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-03-24  Werner Lemberg  <wl@gnu.org>
 
-       [cache] Notice if a cache query induced the node list change.
+       Fix Savannah bug #41946.
 
-       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.
+       Based on a patch from Marek Kašík <mkasik@redhat.com>.
 
-       * 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.
+       * builds/unix/configure.raw (LIBS_CONFIG): Remove.
+       * builds/unix/freetype-config.in (libs): Hard-code value.
+       * builds/unix/unix-def.in: Updated.
 
-       * src/cache/ftccback.h (ftc_snode_compare): Updated to fit with new
-       FTC_Node_CompareFunc type.
-       (ftc_gnode_compare): Ditto.
+2014-03-22  Werner Lemberg  <wl@gnu.org>
 
-       * 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).
+       Another revert for the change from 2014-03-18.
 
-       * 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.
+       Problem reported by Nikolaus Waxweiler <madigens@gmail.com>.
 
-       * 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/base/ftcalc.c (FT_MulFix): Ensure that an `FT_MulFix' symbol
+       gets always exported.
 
-       * 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.
+2014-03-20  Werner Lemberg  <wl@gnu.org>
 
-       * 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.
+       CMakeLists.txt: Another fix for include directories.
 
-2011-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       Problem reported by Taylor Holberton <taylorcholberton@gmail.com>.
 
-       [cache] Fit `FTC_GNode_Compare' to `FTC_Node_CompareFunc'.
+2014-03-19  Werner Lemberg  <wl@gnu.org>
 
-       * 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'.
+       CMakeLists.txt: Fix include directories.
 
-2011-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       Problem reported by Taylor Holberton <taylorcholberton@gmail.com>.
 
-       [cache] Deduplicate the code to get the top node by a hash.
+2014-03-19  Werner Lemberg  <wl@gnu.org>
 
-       There are several duplicated code fragments getting the top node
-       from a cache by a given hash, like:
+       Partially revert last commit.
 
-           idx = hash & cache->mask;
-           if ( idx < cache->p )
-             idx = hash & ( cache->mask * 2 + 1 );
-           pnode = cache->buckets + idx;
+       Found by Alexei.
 
-       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/autofit/aflatin.c (af_latin_metrics_init_blues): Initializing
+       those variables is plain wrong, since we are in a loop.
 
-       * 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.
+2014-03-18  Sean McBride  <sean@rogue-research.com>
+           Werner Lemberg  <wl@gnu.org>
 
-2011-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       Fix clang warnings.
 
-       [cache] inline-specific functions are conditionalized.
+       * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize
+       some variables.
 
-       * 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/base/ftcalc.c (FT_MulFix): Only use code if
+       `FT_MULFIX_INLINED' is not defined.
 
-       * 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.
+       * src/bdf/bdfdrivr.c (bdf_cmap_class), src/cache/ftcbasic.c
+       (ftc_basic_image_family_class, ftc_basic_image_cache_class,
+       ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class),
+       src/cache/ftccmap.c (ftc_cmap_cache_class), src/cache/ftcmanag.c
+       (ftc_size_list_class, ftc_face_list_class), src/pcf/pcfdrivr.c
+       (pcf_cmap_class), src/pfr/pfrdrivr.c (pfr_metrics_service_rec): Make
+       function static.
 
-2011-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/type1/t1driver.c (t1_ps_get_font_value): Remove redundant
+       code.
 
-       [cache] Correct a type mismatch under non-inlined config.
+2014-03-17  Werner Lemberg  <wl@gnu.org>
 
-       * 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'.
+       Fix Savannah bug #41869.
 
-2011-01-06  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       This works around a problem with HarfBuzz (<= 0.9.26), which doesn't
+       validate glyph indices returned by
+       `hb_ot_layout_lookup_collect_glyphs'.
 
-       Update Jamfile to include Bzip2 support.
+       * src/autofit/hbshim.c (af_get_coverage): Guard `idx'.
 
-       * 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)
+       * docs/CHANGES: Updated.
 
-2011-01-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-03-14  Werner Lemberg  <wl@gnu.org>
 
-       Update Symbian project files to include Bzip2 support.
+       * builds/unix/configure.raw: Don't show error messages of `which'.
 
-       Currently, it provides `FT_Stream_OpenBzip2' that returns
-       unimplemented error always, to prevent unresolved symbol
-       error for the applications designed for Unix systems.
+2014-03-09  Alan Coopersmith  <alan.coopersmith@oracle.com>
 
-       * builds/symbian/bld.inf: Include ftbzip2.h.
-       * builds/symbian/freetype.mmp: Include ftbzip2.c.
+       Fix cppcheck 1.64 warning.
 
-2011-01-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/autofit/afglobal.c (af_face_globals_new): Catch NULL pointer
+       dereference in case of error.
 
-       Update classic MacOS makefiles to include Bzip2 support.
+2014-03-09  Sean McBride  <sean@rogue-research.com>
 
-       Currently, it provides `FT_Stream_OpenBzip2' that returns
-       unimplemented error always, to prevent unresolved symbol
-       error for the applications designed for Unix systems.
+       * src/sfnt/ttcmap.c (tt_face_build_cmaps): Remove clang warning.
 
-       * 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.
+2014-03-06  Werner Lemberg  <wl@gnu.org>
 
-2011-01-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * Version 2.5.3 released.
+       =========================
 
-       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.
+       Tag sources with `VER-2-5-3'.
 
-       * 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.
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.5.3.
+
+       * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
+       builds/windows/vc2005/index.html,
+       builds/windows/vc2008/freetype.vcproj,
+       builds/windows/vc2008/index.html,
+       builds/windows/vc2010/freetype.vcxproj,
+       builds/windows/vc2010/index.html,
+       builds/windows/visualc/freetype.dsp,
+       builds/windows/visualc/freetype.vcproj,
+       builds/windows/visualc/index.html,
+       builds/windows/visualce/freetype.dsp,
+       builds/windows/visualce/freetype.vcproj,
+       builds/windows/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.5.2/2.5.3/, s/252/253/.
 
-2011-01-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
 
-       Update pkg-config tools to reflect Bzip2 support.
+       * builds/unix/configure.raw (version_info): Set to 17:2:11.
+       * CMakeLists.txt (VERSION_PATCH): Set to 3.
+       * docs/CHANGES: Updated.
 
-       * builds/unix/freetype-config.in: Include `-lbz2' to
-       --libs output, if built with Bzip2 support.
-       * builds/unix/freetype2.in: Ditto.
+2014-03-06  Werner Lemberg  <wl@gnu.org>
 
-2011-01-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       Fixes for compilation with C++.
 
-       * builds/unix/configure.raw: Remove `SYSTEM_BZ2LIB' macro.
+       * src/autofit/hbshim.c (scripts): Change type to `hb_script_t'.
+       (af_get_coverage): Updated.
+       (COVERAGE): Add cast.
 
-       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.
+2014-03-06  Sean McBride  <sean@rogue-research.com>
 
-2011-01-03  Werner Lemberg  <wl@gnu.org>
+       Remove more clang analyzer warnings.
 
-       */rules.mk: Handle `*pic.c' files.
+       * src/bdf/bdflib.c (_bdf_readstream), src/truetype/ttgload.c
+       (TT_Load_Glyph): Remove dead stores.
 
-2010-12-31  Werner Lemberg  <wl@gnu.org>
+2014-03-05  Werner Lemberg  <wl@gnu.org>
 
-       * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 64.
-       Problem reported by Tom Bishop <wenlin@wenlin.com>.
+       * builds/unix/configure.raw: Simplify.
 
-2010-12-31  Werner Lemberg  <wl@gnu.org>
+2014-03-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       Improve bzip2 support.
+       Fix a bug in configure in library dependency setting
+       Reported in https://bugs.freedesktop.org/show_bug.cgi?id=75652.
 
-       * include/freetype/ftmoderr.h: Add bzip2.
+       * builds/unix/configure.raw: Use `x"${xxx}" != xno' style.
 
-       * docs/INSTALL.ANY, docs/CHANGES: Updated.
+2014-03-04  Werner Lemberg  <wl@gnu.org>
 
-       * src/pcf/README: Updated.
-       * include/freetype/internal/pcftypes.h: Obsolete, removed.
+       Minor fix for `make devel'.
 
-2010-12-31  Joel Klinghed  <the_jk@yahoo.com>
+       * builds/freetype.mk (INCLUDE_FLAGS) [DEVEL_DIR]: Don't use
+       pkg-config for bzip2 since not all GNU/Linux distributions have
+       `bzip2.pc' (and the header file `bzlib.h' is located in /usr/include
+       normally).
 
-       Add bzip2 compression support to handle *.pcf.bz2 files.
+2014-03-04  Sean McBride  <sean@rogue-research.com>
 
-       * builds/unix/configure.raw: Test for libbz2 library.
+       Fix several clang static analyzer dead store warnings.
 
-       * devel/ftoption.h, include/freetype/config/ftoption.h
-       (FT_CONFIG_OPTION_USE_BZIP2): Define.
-       * include/freetype/config/ftheader.h (FT_BZIP2_H): Define.
+       * src/autofit/afhints.c (af_glyph_hints_reload,
+       af_glyph_hints_align_weak_points): Remove unnecessary assignments.
 
-       * include/freetype/ftbzip2.h: New file.
+       * src/bdf/bdflib.c (bdf_font_load): Ditto.
 
-       * src/bzip2/*: New files.
+       * src/pshinter/pshalgo.c (psh_glyph_compute_extrema,
+       psh_glyph_interpolate_other_points): Ditto.
 
-       * 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.
+       * src/type1/t1load.c (T1_Set_MM_Blend): Ditto.
 
-       * docs/formats.txt, modules.cfg: Updated.
+2014-03-03  Werner Lemberg  <wl@gnu.org>
 
-2010-12-25  Harsha  <mm.harsha@gmail.com>
+       Rewrite library option handling in `configure'.
 
-       Apply Savannah patch #7422.
+       o Introduce `auto' value for `--with-XXX' library options; this is
+         now the default.
 
-       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.
+       o First use `pkg-config' for library detection, then fall back to
+         other tests.
 
-       * src/cache/ftcsbits.c (FTC_SNode_New): Initialize sbit widths with
-       value 255.
-       (ftc_snode_compare): Fix condition.
+       * builds/unix/configure.raw (--with-zlib, --with-bzip2, --with-png,
+       --with-harfbuzz): Rewrite.
+       Use new `xxx_reqpriv', `xxx_libpriv', and `xxx_libstaticconf'
+       variables to collect data for `freetype2.pc' and `freetype-config'.
+       (FT2_EXTRA_LIBS): Renamed to ...
+       (ft2_extra_libs): This since it gets no longer substituted.
+       (REQUIRES_PRIVATE, LIBS_PRIVATE, LIBS_CONFIG, LIBSSTATIC_CONFIG):
+       New output variables, replacing `XXX_PKG' and `LIBXXX'.
+       Add notice at the end of `configure' showing the library
+       configuration.
 
-2010-12-13  Werner Lemberg  <wl@gnu.org>
+       * builds/unix/freetype-config.in (--static): New command line
+       option.
+       (libs): Updated.
+       (staticlibs): New variable, to be used if `--static' is given.
+       * docs/freetype-config.1: Document `--static'.
 
-       Fix parameter handling of `FT_Set_Renderer'.
-       Reported by Kirill Tishin <siege@bk.ru>.
+       * builds/unix/freetype2.in, builds/unix/unix-def.in: Updated.
 
-       * src/base/ftobjs.c (FT_Set_Renderer): Increment `parameters'.
+2014-03-01  Werner Lemberg  <wl@gnu.org>
 
-2010-12-09  Werner Lemberg  <wl@gnu.org>
+       Avoid `long long' warnings with older gcc compilers.
+       Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
 
-       [cff] Allow `hlineto' and `vlineto' without arguments.
+       * builds/unix/configure.raw: Don't use gcc's `-pedantic' flag for
+       versions < 4.6.  This is especially needed for Max OS X since this
+       OS runs a gcc variant (or emulation) based on version 4.2.1.
 
-       We simply ignore such instructions.  This is invalid, but it doesn't
-       harm; and indeed, there exist such subsetted fonts in PDFs.
+2014-03-01  Werner Lemberg  <wl@gnu.org>
 
-       Reported by Albert Astals Cid <aacid@kde.org>.
+       * docs/INSTALL.CROSS: Revised and updated.
 
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
-       [cff_op_hlineto]: Ignore instruction if there aren't any arguments
-       on the stack.
+2014-03-01  Werner Lemberg  <wl@gnu.org>
 
-2010-11-28  Werner Lemberg  <wl@gnu.org>
+       Make `make clean' remove `freetype2.pc'.
 
-       * Version 2.4.4 released.
-       =========================
+       This is a generated file at build time, not configure time.
 
+       * builds/unix/unix-def.in (DISTCLEAN): Move `freetype2.pc' to ...
+       (CLEAN): This variable.
 
-       Tag sources with `VER-2-4-4'.
+2014-03-01  Werner Lemberg  <wl@gnu.org>
 
-       * docs/CHANGES: Updated.
+       Use pkg-config for detecting libpng and libbz2 also.
 
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.4.4
+       * builds/unix/configure.raw (HAVE_PKG): New variable.
+       Search for libbz2 using `pkg-config'; s/BZ2/BZIP2/.
+       Search for libpng using `pkg-config'.
+       Fix definition of `LIBHARFBUZZ' variable.
+       * builds/unix/freetype-config.in ($libs): Updated.
+       * builds/unix/freetype2.in: Add `URL' field.
+       Update `Requires.private' and `Libs.private'.
+       * builds/unix/unix-def.in: Updated.
 
-       * 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.4.3/2.4.4/, s/243/244/.
+2014-03-01  Werner Lemberg  <wl@gnu.org>
 
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.
+       Add configure support for HarfBuzz.
 
-       * builds/unix/configure.raw (version_info): Set to 12:2:6.
+       * builds/unix/pkg.m4: New file.
+       * builds/unix/configure.raw: Search for libharfbuzz using
+       `pkg-config'.
+       Add `--without-harfbuzz' option.
+       * builds/unix/freetype-config.in, builds/unix/freetype2.in,
+       builds/unix/unix-def.in (freetype-config, freetype2.pc): Handle
+       HarfBuzz.
 
-2010-11-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
+       * docs/INSTALL.UNIX: Document interdependency of Freetype with
+       HarfBuzz.
 
-       [ftsmooth]: Minor code simplification.
+2014-02-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
-       * src/smooth/ftgrays (gray_render_cubic): Do only one comparison
-       instead of two.
+       [cff] Math simplifications.
 
-2010-11-26  Johnson Y. Yan  <yinsen_yan@foxitsoftware.com>
+       * src/cf2blues.c (cf2_blues_init): Use `FT_MulDiv'.
+       * src/cf2ft.c (cf2_getScaleAndHintFlag): Use simple division.
 
-       [truetype] Better multi-threading support.
+2014-02-28  Dave Arnold  <darnold@adobe.com>
 
-       * src/truetype/ttinterp.c (TT_Load_Context): Reset glyph zone
-       references.
+       [cff] Fix Savannah bug #41697, part 2.
 
-2010-11-23  John Tytgat  <John.Tytgat@esko.com>
+       * src/cff/cf2ft.c (cf2_initLocalRegionBuffer,
+       cf2_initGlobalRegionBuffer): It is possible for a charstring to call
+       a subroutine if no subroutines exist.  This is an error but should
+       not trigger an assert.  Split the assert to account for this.
 
-       * src/psaux/t1decode.c (t1_decoder_parse_charstring): Expand
-       start_point, check_points, add_point, add_point1, close_contour
-       macros.
-       Remove add_contour macro.
-       Return error code from t1_builder_start_point and
-       t1_builder_check_points when there was one (instead of returning 0).
+2014-02-28  Dave Arnold  <darnold@adobe.com>
 
-2010-11-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       [cff] Fix Savannah bug #41697, part 1.
 
-       [truetype] Identify the tricky fonts by cvt/fpgm/prep checksums.
-       Some Latin TrueType fonts are still expected to be unhinted.
-       Fix Savannah bug #31645.
+       * src/cff/cf2hints.c (cf2_hintmap_build): Return when `hintMask' is
+       invalid.  In this case, it is not safe to use the length of
+       `hStemHintArray'; the exception has already been recorded in
+       `hintMask'.
 
-       * src/truetype/ttobjs.c (tt_check_trickyness): Divided to...
-       (tt_check_trickyness_family): this checking family name, and
-       (tt_check_trickyness_sfnt_ids): this checking cvt/fpgm/prep.
-       (tt_get_sfnt_checksum): Function to retrieve the sfnt checksum
-       for specified subtable even if cleared by lazy PDF generators.
-       (tt_synth_sfnt_checksum): Function to calculate the checksum.
+2014-02-26  Werner Lemberg  <wl@gnu.org>
 
-2010-11-18  Werner Lemberg  <wl@gnu.org>
+       [sfnt] Fix Savannah bug #41696.
 
-       [truetype] Fix `loca' handling for inconsistent number of glyphs.
-       Reported by Johnson Y. Yan <yinsen_yan@foxitsoftware.com>.
+       * src/sfnt/ttcmap.c (tt_cmap0_validate, tt_cmap2_validate,
+       tt_cmap4_validate, tt_cmap14_validate): Fix limit tests.
 
-       * src/truetype/ttpload.c (tt_face_load_loca): While sanitizing,
-       handle case where `loca' is the last table in the font.
+2014-02-26  Werner Lemberg  <wl@gnu.org>
 
-2010-11-18  Werner Lemberg  <wl@gnu.org>
+       [winfnt] Fix Savannah bug #41694.
 
-       [sfnt] Ignore all errors while loading `OS/2' table.
-       Suggested by Johnson Y. Yan <yinsen_yan@foxitsoftware.com>.
+       * src/winfonts/winfnt.c (FNT_Load_Glyph): Check glyph offset.
 
-       * src/sfnt/sfobjs.c (sfnt_load_face): Do it.
+2014-02-26  Werner Lemberg  <wl@gnu.org>
 
-2010-11-18  Johnson Y. Yan  <yinsen_yan@foxitsoftware.com>
+       [cff] Fix Savannah bug #41693.
 
-       [type1] Fix matrix normalization.
+       * src/cff/cffload.c (CFF_Load_FD_Select): Reject empty array.
 
-       * src/type1/t1load.c (parse_font_matrix): Handle sign of scaling
-       factor.
+2014-02-26  Werner Lemberg  <wl@gnu.org>
 
-2010-11-18  Werner Lemberg  <wl@gnu.org>
+       [bdf] Fix Savannah bug #41692.
 
-       [type1] Improve guard against malformed data.
-       Based on a patch submitted by Johnson Y. Yan
-       <yinsen_yan@foxitsoftware.com>
+       bdflib puts data from the input stream into a buffer in chunks of
+       1024 bytes.  The data itself gets then parsed line by line, simply
+       increasing the current pointer into the buffer; if the search for
+       the final newline character exceeds the buffer size, more data gets
+       read.
 
-       * src/type1/t1load.c (read_binary_data): Check `size'.
+       However, in case the current line's end is very near to the buffer
+       end, and the keyword to compare with is longer than the current
+       line's length, an out-of-bounds read might happen since `memcmp'
+       doesn't stop properly at the string end.
 
-2010-11-17  Werner Lemberg  <wl@gnu.org>
+       * src/bdf/bdflib.c: s/ft_memcmp/ft_strncmp/ to make comparisons
+       stop at string ends.
 
-       [sfnt] While tracing, output table checksums also.
+2014-02-17  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       * src/sfnt/ttload.c (tt_face_load_font_dir): Do it.
+       [autofit] Fix `make multi' compilation.
 
-2010-11-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/autofit/hbshim.c: Include `afglobal.h' and `aftypes.h'.
 
-       [UVS] Fix `find_variant_selector_charmap', Savannah bug #31545.
+2014-02-19  Werner Lemberg  <wl@gnu.org>
+           Simon Bünzli  <zeniko@gmail.com>
 
-       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.
+       Fix Savannah bug #32902.
 
-       * src/base/ftobjs.c (Fix find_variant_selector_charmap):
-       Returns UVS cmap correctly.
+       Patch taken from
 
-2010-11-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
+         https://code.google.com/p/sumatrapdf/source/browse/trunk/ext/_patches/freetype2.patch?spec=svn8620&r=8620#87
 
-       [ftsmooth] Improve rendering.
+       with slight modifications.
 
-       * src/smooth/ftsmooth.c (gray_render_conic): Since version 2.4.3,
-       cubic deviations have been estimated _after_ UPSCALE, whereas
-       conic ones have been evaluated _before_ UPSCALE, which produces
-       inferior rendering results.  Fix this.
-       Partially undo change from 2010-10-15 by using ONE_PIXEL/4; this has
-       been tested with demo images sent to the mailing list.  See
+       * src/type1/t1parse.c (T1_Get_Private_Dict): Add heuristic test to
+       handle fonts that incorrectly use \r at the beginning of an eexec
+       block.
 
-         http://lists.gnu.org/archive/html/freetype-devel/2010-10/msg00055.html
+2014-02-19  Simon Bünzli  <zeniko@gmail.com>
 
-       and later mails in this thread.
+       Fix Savannah bug #41590.
 
-2010-10-28  Werner Lemberg  <wl@gnu.org>
+       * src/type1/t1load.c (parse_encoding): Protect against invalid
+       number.
 
-       [ftraster] Minor fixes.
+2014-02-12  Dave Arnold  <darnold@adobe.com>
 
-       Reported by Tom Bishop <wenlin@wenlin.com>.
+       [cff] Optimize by using `FT_MulDiv'.
+       Suggested by Alexei.
 
-       * src/raster/ftraster.c (ULong): Remove unused typedef.
-       (TWorker): Remove unused variable `precision_mask'.
+       * src/cff/cf2font.c (cf2_computeDarkening): Do it.
 
-2010-10-28  Werner Lemberg  <wl@gnu.org>
+2014-02-12  Werner Lemberg  <wl@gnu.org>
 
-       [ftraster] Fix rendering.
+       Fix Savannah bug #41465.
 
-       Problem reported by Tom Bishop <wenlin@wenlin.com>; see
-       thread starting with
+       * builds/unix/unix-def.in (CLEAN): Add `freetype-config'.
+       (DISTCLEAN): Remove `freetype-config'.
 
-         http://lists.gnu.org/archive/html/freetype/2010-10/msg00049.html
+2014-02-08  Sean McBride  <sean@rogue-research.com>
 
-       * src/raster/ftraster.c (Line_Up): Replace FMulDiv with SMulDiv
-       since the involved multiplication exceeds 32 bits.
+       Fix clang static analyzer and compiler warnings.
 
-2010-10-25  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/autofit/afhints.c (af_glyph_hints_align_weak_points),
+       src/autofit/afloader (af_loader_load_g) <FT_GLYPH_FORMAT_COMPOSITE>,
+       src/base/ftcalc.c (FT_MSB), src/base/ftoutln.c
+       (FT_Outline_Decompose), src/bdf/bdfdrivr.c (bdf_interpret_style),
+       src/cff/cffparse.c (cff_parse_integer), src/cid/cidparse.c
+       (cid_parser_new), src/pfr/pfrload.c (pfr_phy_font_load),
+       src/raster/ftraster.c (Decompose_Curve), src/sfnt/sfdriver.c
+       (sfnt_get_ps_name), src/sfnt/ttcmap.c (tt_cmap12_next,
+       tt_cmap13_next), src/smooth/ftgrays.c (gray_hline): Remove dead
+       code.
 
-       Revert a change of `_idx' type in `FTC_CACHE_LOOKUP_CMP'.
+       * src/autofit/afmodule.c (af_property_get_face_globals,
+       af_property_set, af_property_get), src/base/ftbitmap.c
+       (ft_gray_for_premultiplied_srgb_bgra): Make functions static.
 
-       * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Revert
-       the type of `_idx' from FT_PtrDist (by previous change)
-       to original FT_UFast, to match with FT_CacheRec.
+       * src/base/ftobjs.c (ft_remove_renderer): Protect against
+       library == NULL.
+       (ft_property_do): Make function static.
 
-2010-10-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/base/ftrfork.c: Include `ftbase.h'.
 
-       [cache] Change the hash types to FT_PtrDist.
+       * src/sfnt/ttsbit.c (tt_face_load_sbix_image)
+       [!FT_CONFIG_OPTION_USE_PNG], src/type1/t1gload.c
+       (T1_Compute_Max_Advance): Avoid compiler warning.
 
-       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
-       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
-       ILP32 and LP64 are not changed.  The hash value in
-       the cache subsystem is not reverted to the memory
-       address, so using signed type FT_PtrDist is safe.
+       * src/truetype/ttinterp.c (TT_New_Context): Reduce scope of
+       variable.
 
-       * 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'.
-       * src/cache/ftccmap.c (FTC_CMAP_HASH): Ditto.
+2014-02-08  Werner Lemberg  <wl@gnu.org>
 
-       * src/cache/ftccache.h (FTC_NodeRec): The type of the
-       member `hash' is changed from FT_UInt32 to FT_PtrDist.
+       Fix Windows build directories.
 
-       * src/cache/ftccache.h (FTC_Cache_Lookup): The type of the
-       argument `hash' is changed from FT_UInt32 to FT_PtrDist.
-       (FTC_Cache_NewNode): Ditto.
-       * src/cache/ftccache.c (ftc_cache_add): Ditto.
-       (FTC_Cache_Lookup): Ditto.  (FTC_Cache_NewNode): Ditto.
-       * src/cache/ftcglyph.h (FTC_GCache_Lookup): Ditto.
-       * src/cache/ftcglyph.c (FTC_GCache_Lookup): Ditto.
+       The build target is now `windows' instead of `win32'.
 
-       * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): The type
-       of the internal variable `hash' is changed to FT_PtrDist
-       from FT_UInt32.  (FTC_ImageCache_LookupScaler): Ditto.
-       (FTC_SBitCache_Lookup): Ditto.
-       (FTC_SBitCache_LookupScaler): Ditto.
-       * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto.
-       * 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.
+       Problem reported by Nickolas George <darknova.clan@gmail.com>.
 
-2010-10-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * builds/modules.mk: Don't use `win32' and `win16' (!) but
+       `windows'.
 
-       [cache] Hide internal macros incompatible with LLP64.
+       * builds/windows/detect.mk, builds/windows/win32-def.mk:
+       s/win32/windows/.
 
-       `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.
+2014-02-08  Eugen Sawin  <esawin@mozilla.com>
 
-       For the history of these macros, see the investigation:
-       http://lists.gnu.org/archive/html/freetype/2010-10/msg00022.html
+       Fix Savannah bug #41507.
 
-2010-10-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap)
+       [!FT_CONFIG_OPTION_USE_PNG] <17, 17, 19>: Fix error handling.
 
-       Change the type of `FT_MEM_VAL' from FT_ULong to FT_PtrDist.
+2014-02-08  Dave Arnold  <darnold@adobe.com>
 
-       On LLP64 platforms (e.g. Win64), unsigned long (32-bit)
-       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.
+       [cff] Fix minor performance bug.
 
-       * src/base/ftdbgmem.c (FT_MEM_VAL): Change the type of the
-       return value from FT_ULong to FT_PtrDist.
-       (ft_mem_table_resize): The type of hash is changed to
-       FT_PtrDist.  (ft_mem_table_get_nodep): Ditto.
+       * src/cff/cf2font.c (cf2_font_setup): Darkening amount and blue zone
+       calculations are now cached and not recomputed on each glyph.
 
-2010-10-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-02-05  Werner Lemberg  <wl@gnu.org>
 
-       Replace "%lx" for memory address by "%p", LLP64 platforms.
+       Fix problems with perl 5.8.8 as distributed with current MinGW.
 
-       On LLP64 platforms (e.g. Win64), long (32-bit) cannot cover
-       the memory address (64-bit).  Also the casts from the pointer
-       type to long int should be removed to preserve the address
-       correctly.
+       * src/tools/afblue.pl: Work-around for Perl bug #63402.
+       (string_re): Avoid `possessive quantifiers', which have been
+       introduced in Perl version 5.10.
 
-       * src/raster/ftraster.c (New_Profile): Replace "%lx" by "%p".
-       (End_Profile) Ditto.
-       * src/truetype/ttinterp.c (Init_Context): Ditto.
+2014-02-04  Werner Lemberg  <wl@gnu.org>
 
-2010-10-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
+       Fix compilation with MinGW.
 
-       Fix thinko in spline flattening.
+       Right now, compilation out of the box with latest MinGW is broken
+       due to bugs in header files of mingwrt 4.0.3 in strict ANSI mode,
+       cf.
 
-       FT_MAX_CURVE_DEVIATION is dependent on the value of ONE_PIXEL.
+         https://sourceforge.net/p/mingw/bugs/2024/
+         https://sourceforge.net/p/mingw/bugs/2046/
 
-       * src/smooth/ftgrays.c (FT_MAX_CURVE_DEVIATION): Remove it and
-       replace it everywhere with ONE_PIXEL/8.
+       * builds/unix/configure.raw: Don't set `-ansi' flag for MinGW.
 
-2010-10-13  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-02-04  Werner Lemberg  <wl@gnu.org>
 
-       [raccess] Skip unrequired resource access rules by Darwin VFS.
+       [autofit] Minor fix.
 
-       When a resource fork access rule by Darwin VFS could open the
-       resource fork but no font is found in it, the rest of rules
-       by Darwin VFS are skipped.  It reduces the warnings of the
-       deprecated resource fork access method by recent Darwin kernel.
-       Fix MacPorts ticket #18859:
-               http://trac.macports.org/ticket/18859
+       * src/autofit/afcjk.c (af_cjk_metrics_init_widths),
+       src/autofit/aflatin.c (af_latin_metrics_init_widths): Fix handling
+       of alternative standard characters.
+       This also fixes a compilation warning in non-debug mode.
 
-       * 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,
-       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.
-       If it is TRUE, the Darwin VFS rules are skipped.
+2014-02-03  Werner Lemberg  <wl@gnu.org>
 
-2010-10-13  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       [cff] Fix Savannah bug #41363.
 
-       [raccess] Grouping resource access rules based on Darwin VFS.
+       * src/cff/cf2ft.c (cf2_checkTransform): Convert assertion into
+       parameter check.
+       (cf2_decoder_parse_charstrings): Call `cf2_checkTransform' only if
+       we are scaling the outline.
+       (cf2_getPpemY): Remove problematic assertion.
 
-       MacOS X/Darwin kernel supports a few tricky methods to access
-       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.
-       To determine whether the rule index is for Darwin VFS, a local
-       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.
+2014-01-26  Werner Lemberg  <wl@gnu.org>
 
-       * src/base/ftrfork.c (FT_RFork_Rule): New enum type to identify
-       the rules to access the resource fork.
-       (raccess_guess_rec): New structure to bind the rule function and
-       rule enum type.
-       (FT_Raccess_Guess): The list of the rule functions is replaced by
-       (raccess_guess_table): This.  This is exposed to be used by other
-       intra module functions.
-       (raccess_rule_by_darwin_vfs): A function to return a boolean
-       if the rule specified by the rule index is based on Darwin VFS.
+       [autofit] Introduce two more slots for standard characters.
 
-2010-10-13  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       This is useful for OpenType features like `c2sc' (caps to small
+       caps) that don't have lowercase letters by definition, or other
+       features that mainly operate on numerals.
 
-       Prevent to open a FT_Stream for zero-sized file on non-Unix.
+       * src/autofit/afscript.h: Add more standard characters.
 
-       builds/unix/ftsystem.c prevents to open an useless stream from
-       zero-sized file and returns FT_Err_Cannot_Open_Stream, but the
-       stream drivers for ANSI C, Amiga and VMS return useless streams.
-       For cross-platform consistency, all stream drivers should act
-       same.
+       * src/autofit/aftypes.h: Update use of `SCRIPT' macro.
+       (AF_ScriptClassRec): Add members to hold two more standard
+       characters.
+       (AF_DEFINE_SCRIPT_CLASS): Updated.
 
-       * src/base/ftsystem.c (FT_Stream_Open): If the size of the opened
-       file is zero, FT_Err_Cannot_Open_Stream is returned.
-       * builds/amiga/src/base/ftsystem.c (FT_Stream_Open): Ditto.
-       * src/vms/ftsystem.c (FT_Stream_Open): Ditto.
+       * src/autofit/afglobal.c, src/autofit/afglobal.h,
+       * src/autofit/afpic.c, src/autofit/afranges.h, src/autofit/hbshim.c:
+       Update use of `SCRIPT' macro.
 
-2010-10-12  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/afcjk.c (af_cjk_metrics_init_widths),
+       src/autofit/aflatin.c (af_latin_metrics_init_widths): Scan two more
+       standard characters.
 
-       Fix Savannah bug #31310.
+2014-01-24  Werner Lemberg  <wl@gnu.org>
 
-       * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against
-       invalid `runcnt' values.
+       Fix Savannah bug #41320.
 
-2010-10-08  Chris Liddell  <chris.liddell@artifex.com>
+       * src/autofit/aflatin.c (af_latin_metrics_init_blues)
+       <AF_LATIN_IS_LONG_BLUE>: Avoid negative index of `last'.
 
-       Fix Savannah bug #31275.
+2014-01-23  Werner Lemberg  <wl@gnu.org>
 
-       * src/sfnt/ttpost.c: Include FT_INTERNAL_DEBUG_H.
+       Fix Savannah bug #41310.
 
-2010-10-06  Werner Lemberg  <wl@gnu.org>
+       * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap) <glyph_format==5>:
+       Don't check metrics, which this format doesn't have.
+       This is another correction to the commit from 2013-11-21.
 
-       [truetype] Improve error handling of `SHZ' bytecode instruction.
-       Problem reported by Chris Evans <scarybeasts@gmail.com>.
+2014-01-23  Werner Lemberg  <wl@gnu.org>
 
-       * src/truetype/ttinterp.c (Ins_SHZ): Check `last_point'.
+       Fix Savannah bug #41309.
 
-2010-10-05  Werner Lemberg  <wl@gnu.org>
+       * src/type1/t1load.c (t1_parse_font_matrix): Properly handle result
+       of `T1_ToFixedArray'.
 
-       Fix Savannah bug #31253.
-       Patch submitted by an anonymous reporter.
+       * src/cid/cidload.c (cid_parse_font_matrix): Synchronize with
+       `t1_parse_font_matrix'.
 
-       * configure: Use `awk' instead of `sed' to manipulate output of `ls
-       -id'.
+       * src/type42/t42parse.c (t42_parse_font_matrix): Synchronize with
+       `t1_parse_font_matrix'.
+       (t42_parse_encoding): Synchronize with `t1_parse_encoding'.
 
-2010-10-03  Werner Lemberg  <wl@gnu.org>
+       * src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_BBOX>,
+       <T1_FIELD_TYPE_MMOX>: Properly handle result of `ps_tofixedarray'.
 
-       * Version 2.4.3 released.
-       =========================
+2014-01-22  Werner Lemberg  <wl@gnu.org>
 
+       * src/autofit/hbshim.c (af_get_coverage): Fix memory leaks.
 
-       Tag sources with `VER-2-4-3'.
+2014-01-16  Werner Lemberg  <wl@gnu.org>
 
-       * docs/CHANGES: Updated.
+       [autofit] Improve tracing of style coverages.
 
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.4.3
+       * include/internal/fttrace.h: Add `afglobal' for tracing style
+       coverages.
 
-       * 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.4.2/2.4.3/, s/242/243/.
+       * src/autofit/afglobal.c: Include FT_INTERNAL_DEBUG_H.
+       (FT_COMPONENT): Define.
+       (af_face_globals_compute_style_coverage): Trace `gstyles' array
+       data.
 
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
+2014-01-09  Werner Lemberg  <wl@gnu.org>
 
-       * builds/unix/configure.raw (version_info): Set to 12:1:6.
+       Fix Savannah bug #41158.
 
-2010-10-03  Werner Lemberg  <wl@gnu.org>
+       * builds/unix/install.mk (install): Create man page directory.
 
-       Avoid `configure' issues with symbolic links.
-       Based on a patch from Alexander Stohr <Alexander.Stohr@gmx.de>.
+2014-01-08  Chongyu Zhu  <lembacon@gmail.com>
 
-       * configure: Compare directories using `ls -id'.
-       Check existence of `reference' subdirectory before creating it.
+       [arm] Fix Savannah bug #41138, part 2.
 
-2010-10-02  Werner Lemberg  <wl@gnu.org>
+       * builds/unix/ftconfig.in (FT_MulFix_arm), include/config/ftconfig.h
+       (FT_MulFix_arm), src/truetype/ttinterp.c (TT_MulFix14_arm): Fix
+       preprocessor conditionals for `add.w'.
 
-       Fix Savannah bug #31088 (sort of).
+2014-01-08  Werner Lemberg  <wl@gnu.org>
 
-       * src/sfnt/ttload.c (tt_face_load_maxp): Always allocate at least 64
-       function entries.
+       [autofit] Fix Savannah bug #41138, part 1.
 
-2010-10-02  Werner Lemberg  <wl@gnu.org>
+       * src/tools/afblue.pl <Handling #endif>: Produce correct auxiliary
+       enumeration names for generated `#else'.
 
-       [smooth] Fix splitting of cubics for negative values.
+       * src/autofit/afblue.h: Regenerated.
 
-       Reported by Róbert Márki <gsmiko@gmail.com>; see
-       http://lists.gnu.org/archive/html/freetype/2010-09/msg00019.html.
+2014-01-06  Werner Lemberg  <wl@gnu.org>
 
-       * src/smooth/ftgrays.c (gray_render_cubic): Fix thinko.
+       Add manual page for `freetype-config'.
+       Contributed by Nis Martensen <nis.martensen@web.de>.
 
-2010-10-01  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * docs/freetype-config.1: New file.
 
-       Fix Savannah bug #31040.
+       * builds/unix/unix-def.in (mandir): Define.
+       * builds/unix/install.mk (install, uninstall): Handle manpage.
 
-       * src/truetype/ttinterp.c (free_buffer_in_size): Remove.
-       (TT_RunIns): Updated.
+2014-01-05  Werner Lemberg  <wl@gnu.org>
 
-2010-09-20  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       [autofit] Minor fixes for `afblue.pl'.
 
-       [sfnt] Make error message filling NULL names less verbose.
+       * src/tools/afblue.pl (aux_name): Don't use `reverse'.
+       <Handling #endif>: Use proper indentation for generated `#else'.
 
-       * src/sfnt/ttpost.c (load_format_20): Showing 1 summary message
-       when we fill `post' names by NULL, instead of per-entry message.
+       * src/autofit/afblue.h: Regenerated.
 
-2010-09-20  Graham Asher  <graham.asher@btinternet.com>
-           David Bevan  <david.bevan@pb.com>
+2014-01-04  Werner Lemberg  <wl@gnu.org>
 
-       [smooth] Fix and improve spline flattening.
+       [autofit] Fix Indic scripts.
 
-       This fixes the flattening of cubic, S-shaped curves and speeds up
-       the handling of both the conic and cubic arcs.
+       Split the single, incorrect Indic entry into separate scripts so
+       that the covered ranges are the same: Bengali, Devanagari, Gujarati,
+       Gurmukhi, Kannada, Limbu, Malayalam, Oriya, Sinhala, Sundanese,
+       Syloti Nagri, Tamil, Telugu, and Tibetan.  At the same time, remove
+       entries for Meetai Mayak and Sharada – the Unicode ranges were
+       incorrect (and nobody has complained about that), fonts are scarce
+       for those scripts, and the Indic auto-hinter support is rudimentary
+       anyways.
 
-       See the discussions on the freetype-devel mailing list in late
-       August and September 2010 for details.
+       * src/autofit/afscript.h: Updated, using AF_CONFIG_OPTION_INDIC and
+       AF_CONFIG_OPTION_CJK.
 
-       * src/smooth/ftgrays.c (FT_MAX_CURVE_DEVIATION): New macro.
-       (TWorker): Remove `conic_level' and `cubic_level' elements.
-       (gray_render_conic): Simplify algorithm.
-       (gray_render_cubic): New algorithm; details are given in the code
-       comments.
-       (gray_convert_glyph): Remove heuristics.
+       * src/autofit/afstyles.h (STYLE_DEFAULT_INDIC): New auxiliary macro.
+       Use it, together with AF_CONFIG_OPTION_INDIC and
+       AF_CONFIG_OPTION_CJK, to update.
 
-2010-09-19  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/afranges.c [AF_CONFIG_OPTION_INDIC]: Updated.
+       [!AF_CONFIG_OPTION_INDIC, !AF_CONFIG_OPTION_CJK]: Removed.
+       Sort entries by tags.
 
-       Minor fixes.
+2014-01-03  Werner Lemberg  <wl@gnu.org>
 
-       * src/cff/cffload.c (cff_charset_compute_cids): `charset->sids[i]'
-       is `FT_UShort'.
-       (cff_index_access_element): Don't use additions in comparison.
-       * src/sfnt/ttpost.c (load_format_20): Make `post_limit' of type
-       `FT_Long'.
-       Don't use additions in comparison.
-       Improve tracing messages.
-       (load_format_25, load_post_names): Make `post_limit' of type
-       `FT_Long'.
+       [autofit] Thinko.
 
-2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/autofit/hbshim.c (af_get_char_index): Similar to
+       `af_get_coverage', reject glyphs which are not substituted.
 
-       [cff] Truncate the element length at the end of the stream.
-       See Savannah bug #30975.
+2014-01-03  Werner Lemberg  <wl@gnu.org>
 
-       * 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
-       similarly.
+       [autofit] Fix handling of default coverages.
 
-2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       With this commit, the implementation of coverage handling is
+       completed.
 
-       [cff] Ignore CID > 0xFFFFU.
-       See Savannah bug #30975.
+       * src/autofit/hbshim.c (af_get_coverage): Exit early if nothing to
+       do.
+       Reject coverages which don't contain appropriate glyphs for blue
+       zones.
 
-       * src/cff/cffload.c (cff_charset_compute_cids): Ignore CID if
-       greater than 0xFFFFU.  CFF font spec does not mention maximum CID in
-       the font, but PostScript and PDF spec define that maximum CID is
-       0xFFFFU.
+2014-01-03  Werner Lemberg  <wl@gnu.org>
 
-2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       [autofit] Fix handling of default coverages.
 
-       [cff] Make trace message in` cff_charset_load' verbose.
-       See Savannah bug #30975.
+       * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
+       First handle non-default coverages, then the default coverage of the
+       default script, and finally the other default coverages.
 
-       * src/cff/cffload.c (cff_charset_load): Report the original `nleft'
-       and truncated `nleft'.
+2014-01-03  Werner Lemberg  <wl@gnu.org>
 
-2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       [autofit] Fix scaling of HarfBuzz shaping.
 
-       [cff] Correct `max_cid' from CID array length to max CID.
-       See Savannah bug #30975.
+       * src/autofit/hbshim.c (af_get_char_index): Scale to units per EM.
 
-       * src/cff/cffload.c (cff_charset_compute_cids): Don't increment
-       max_cid after detecting max CID.  The array CFF_Charset->cids is
-       allocated by max_cid + 1.
-       (cff_charset_cid_to_gindex): Permit CID is less than or equal to
-       CFF_Charset->max_cid.
-       * src/cff/cffobjs.c (cff_face_init): FT_Face->num_glyphs is
-       calculated as CFF_Charset->max_cid + 1.
+2014-01-03  Werner Lemberg  <wl@gnu.org>
 
-2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       [autofit] Better ftgrid support.
 
-       [truetype] Sanitize the broken offsets in `loca'.
-       See Savannah bug #31040.
+       * src/autofit/afhints.c (af_glyph_hints_get_segment_offset): Add
+       parameters `is_blue' and `blue_offset'.
 
-       * src/truetype/ttpload.c (tt_face_get_location): If `pos1', the
-       offset to the requested entry in `glyf' exceeds the end of the
-       table, return offset=0, length=0.  If `pos2', the offset to the next
-       entry in `glyf' exceeds the end of the table, truncate the entry
-       length at the end of `glyf' table.
+2014-01-01  Werner Lemberg  <wl@gnu.org>
 
-2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       [autofit] Remove some styles.
 
-       [sfnt] Prevent overrunning in `post' table parser.
-       See Savannah bug #31040.
+       * src/autofit/afcover.h: Remove coverages for alternative fractions,
+       denominators, numerators, and fractions.
 
-       * 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'.
-       (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/autofit/afstyles.h (META_STYLE_LATIN): Updated.
 
-2010-09-17  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2014-01-01  Werner Lemberg  <wl@gnu.org>
 
-       [truetype] Don't duplicate size->twilight structure to be freed.
-       See Savannah bug #31040 for detail.
+       [autofit] Add more styles.
 
-       * 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
-       pointers.  They can cause the double-free crash when the burst
-       errors occur in TrueType interpreter and `free_buffer_in_size' is
-       invoked repeatedly.
+       * src/autofit/afstyles.h (STYLE_LATIN, META_STYLE_LATIN): New
+       auxiliary macros; use them to define styles for Cyrillic, Greek, and
+       Latin.
 
-2010-09-15  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/afcover.h: Remove coverage for oldstyle figures.
+       Since those digits are used in combination with ordinary letters, it
+       makes no sense to handle them separately.
 
-       Make bytecode debugging with FontForge work again.
+       * src/autofit/afglobal.c (af_face_globals_get_metrics): Don't limit
+       `options' parameter to 4 bits.
 
-       * src/truetype/ttinterp.c (TT_RunIns): Don't call
-       `free_buffer_in_size' in case of error if a debugger is active.
+2014-01-01  Werner Lemberg  <wl@gnu.org>
 
-2010-09-14  Werner Lemberg  <wl@gnu.org>
+       [autofit] Fix style assignments to glyphs.
 
-       Improve tracing messages.
+       * src/autofit/hbshim.c (af_get_coverage)
+       [FT_CONFIG_OPTION_USE_HARFBUZZ]: Scan GPOS coverage of features also
+       so that we can skip glyphs that have both GSUB and GPOS data.
 
-       * src/truetype/ttinterp.c (TT_RunIns): Improve wording of tracing
-       message.
-       * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Add
-       tracing message.
-       * src/truetype/ttgload.c (tt_loader_init): Add tracing message.
-       * src/cache/ftcsbits.c (ftc_snode_load): Emit tracing message if
-       glyph doesn't fit into a small bitmap container.
+2014-01-01  Werner Lemberg  <wl@gnu.org>
 
-2010-09-13  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/hbshim.c: s/{lookups,glyphs}/gsub_{lookups,glyphs}/.
 
-       Fix minor issues reported by <muktha.narayan@wipro.com>.
+2014-01-01  Werner Lemberg  <wl@gnu.org>
 
-       * src/autofit/aflatin.c (af_latin_compute_stem_width): Remove
-       redundant conditional check.
-       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Ditto.
-       * src/cff/cffload.c (cff_encoding_load): Remove conditional check
-       which always evaluates to `true'.
-       * src/pshinter/pshalgo.c (ps_glyph_interpolate_strong_points):
-       Ditto.
-       * src/truetype/ttinterp.c (Ins_IUP): Ditto.
-       * src/cid/cidgload.c (cid_slot_load_glyph): Don't check for NULL if
-       value is already dereferenced.
-       * src/winfonts/winfnt.c (FNT_Load_Glyph): Fix check of `face'.
+       [autofit] Implement and use `af_get_char_index' with HarfBuzz.
 
-2010-08-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/autofit/hbshim.c (COVERAGE) [FT_CONFIG_OPTION_USE_HARFBUZZ]:
+       Redefine to construct HarfBuzz features.
+       (af_get_char_index) [FT_CONFIG_OPTION_USE_HARFBUZZ]: Rewritten.
 
-       Ignore the environmental setting of LIBTOOL.
-       Patch is suggested by Adrian Bunk, to prevent unexpected
-       reflection of environmental LIBTOOL.  See:
-       http://savannah.nongnu.org/patch/?7290
+       * src/autofit/aflatin.c (af_latin_metrics_init_blues): Use
+       `y_offset' to adjust `best_y'.
 
-       * builds/unix/unix-cc.in: LIBTOOL is unconditionally set to
-       $(FT_LIBTOOL_DIR)/libtool.  FT_LIBTOOL_DIR is set to $(BUILD_DIR)
-       by default.
-       * configure: When configured for the building out of source tee,
-       FT_LIBTOOL_DIR is set to $(OBJ_DIR).
+2013-12-31  Werner Lemberg  <wl@gnu.org>
 
-2010-08-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       [autofit] s/AF_STYLE_...._DEFAULT/AF_STYLE_...._DFLT/i.
 
-       [truetype] Decrease the trace level catching the interpreter error.
+2013-12-31  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,
-       from` FT_TRACE7' to `FT_TRACE1'.
+       [autofit] Fix interface of `af_get_char_index'.
 
-2010-08-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/autofit/hbshim.c (af_get_char_index): Return error value.
+       Add argument for y offset (to be used in a yet-to-come patch).
 
-       [truetype] Prevent bytecode reuse after the interpretation error.
+       * src/autofit/hbshim.h, src/autofit/afcjk.c,
+       src/autofit/aflatin.c: Updated.
 
-       * src/truetype/ttinterp.c (free_buffer_in_size): New function to
-       free the buffer allocated during the interpretation of this glyph.
-       (TT_RunIns): Unset FT_Face->size->{cvt_ready,bytecode_ready} if
-       an error occurs in the bytecode interpretation.  The interpretation
-       of invalid bytecode may break the function definitions and referring
-       them in later interpretation is danger.  By unsetting these flags,
-       `fpgm' and `prep' tables are executed again in next interpretation.
+2013-12-30  Werner Lemberg  <wl@gnu.org>
 
-       This fixes Savannah bug #30798, reported by Robert Święcki.
+       [autofit] Don't combine multiple features into one set.
 
-2010-08-29  Werner Lemberg  <wl@gnu.org>
+       Combining them, as originally envisioned, would lead to much more
+       complicated code, as investigations have shown meanwhile.  The major
+       drawback is that we run out of available style slots much earlier.
+       However, this is only a theoretical issue since we don't support a
+       large number of scripts currently.
 
-       [ftraster] Pacify compiler.
+       * src/autofit/afcover.h: Replace `COVERAGE_{1,2,3}' macros with
+       a single-element `COVERAGE' macro, sort the elements by the feature
+       tags, and add entry for `ruby'.
 
-       * src/raster/ftraster.c (ft_black_new) [_STANDALONE_]: `memory' is
-       not used.
+       * src/autofit/aftypes.h: Updated.
+       * src/autofit/hbshim.c: Updated.
 
-2010-08-29  Werner Lemberg  <wl@gnu.org>
+2013-12-28  Werner Lemberg  <wl@gnu.org>
 
-       [cff] Allow SIDs >= 65000.
+       [autofit] Code shuffling to reduce use of cpp macros.
 
-       * src/cff/cffload.c (cff_charset_load): Fix change from 2009-03-20:
-       The threshold for SIDs is not applicable here.  I misinterpreted the
-       `SID values 65000 and above are available for implementation use'
-       sentence in the CFF specification.
+       * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
+       Call `af_get_coverage' unconditionally.
 
-       Problem reported by Ivan Ninčić <inincic@pdftron.com>.
+       * src/autofit/autofit.c: Include `hbshim.c' unconditionally.
 
-2010-08-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/autofit/hbshim.c (af_get_coverage)
+       [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Provide dummy function.
 
-       Force hinting when the font lacks its familyname.
+       * src/autofit/hbshim.h: Provide function declarations
+       unconditionally.
 
-       In Type42 or Type11 font embedded in PostScript & PDF, TrueType sfnt
-       stream may lack `name' table because they are not required.  Hinting
-       for nameless fonts is safer for PDFs including embedded Chinese
-       fonts.  Written by David Bevan, see:
+2013-12-28  Werner Lemberg  <wl@gnu.org>
 
-       http://lists.gnu.org/archive/html/freetype-devel/2010-08/msg00021.html
-       http://lists.freedesktop.org/archives/poppler/2010-August/006310.html
+       [autofit] Add wrapper function for `FT_Get_Char_Index'.
 
-       * src/truetype/ttobjs.c (tt_check_trickyness): If a NULL pointer by
-       nameless font is given, TRUE is returned to enable hinting.
+       Yet-to-come changes will provide HarfBuzz functionality for the new
+       function.
 
-2010-08-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/autofit/hbshim.c (af_get_char_index): New function.
+       * src/autofit/hbshim.h: Updated.
 
-       Register yet another tricky TrueType font.
+       * src/autofit/afcjk.c (af_cjk_metrics_init_widths,
+       af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Updated.
 
-       * src/truetype/ttobjs.c (tt_check_trickyness): Add `HuaTianKaiTi?',
-       a Kaishu typeface paired with `HuaTianSongTi?' by Huatian
-       Information Industry.
+       * src/autofit/aflatin.c (af_latin_metrics_init_widths,
+       af_latin_metrics_init_blues, af_latin_metrics_check_digits):
+       Updated.
 
-2010-08-17  Teijo Kinnunen <Teijo.Kinnunen@nuance.com>
+2013-12-28  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30788.
+       [autofit] Use `global' HarfBuzz font object.
 
-       * src/cache/ftccache.c (FTC_Cache_Clear): Check `cache->buckets' for
-       NULL too.
+       We now use `hb_font' instead of `hb_face' since yet-to-come changes
+       need this.
 
-2010-08-10  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/afglobal.h: Include `hbshim.h'.
+       (AF_FaceGlobalsRec) [FT_CONFIG_OPTION_USE_HARFBUZZ]: New member
+       `hb_font'.
 
-       Try to fix Savannah bug #30717 (and probably #30719 too).
+       * src/autofit/afglobal.c (af_face_globals_new)
+       [FT_CONFIG_OPTION_USE_HARFBUZZ]: Create `hb_font'.
+       (af_face_globals_free) [FT_CONFIG_OPTION_USE_HARFBUZZ]: Destroy
+       `hb_font'.
 
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Add another
-       overflow test for `width' and `height'.
+       * src/autofit/hbshim.h: Include HarfBuzz headers.
 
-2010-08-06  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/hbshim.c: Include `hbshim.h' instead of HarfBuzz
+       headers.
+       (af_get_coverage): Updated.
 
-       * Version 2.4.2 released.
-       =========================
+2013-12-27  Werner Lemberg  <wl@gnu.org>
 
+       [autofit] Handle `DFLT' OpenType script for coverages.
 
-       Tag sources with `VER-2-4-2'.
+       * include/ftautoh.h: Document new `default-script' property.
 
-       * docs/CHANGES: Updated.
+       * src/autofit/hbshim.c (af_get_coverage): Use `AF_FaceGlobals' for
+       type of first parameter.
+       (script_tags): Add one more element.
+       (af_get_coverage): Adjust `script_tags' to handle `DFLT' script tag.
 
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.4.2
+       * src/autofit/hbshim.h: Updated.
 
-       * 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.4.1/2.4.2/, s/241/242/.
+       * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
+       Updated.
 
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.
+       * src/autofit/afglobal.h (AF_SCRIPT_DEFAULT): New macro.
 
-       * builds/unix/configure.raw (version_info): Set to 12:0:6.
+       * src/autofit/afmodule.h (AF_ModuleRec): New `default_script'
+       member.
 
-2010-08-06  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/autofit/afmodule.c (af_property_set, af_property_get): Handle
+       `default-script' property.
+       (af_autofitter_init): Updated.
 
-       Fix Savannah bug #30648.
+2013-12-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       * src/base/ftobjs.c (FT_Done_Library): Specify the order of font
-       drivers during the face closing process.  Type42 faces should be
-       closed before TrueType faces, because a Type42 face refers to
-       another internal TrueType face which is created from sfnt[] array on
-       the memory.
+       [ftrfork] Fix the face order difference between POSIX and Carbon.
 
-2010-08-06  Yuriy Kaminskiy  <yumkam@mail.ru>
+       The fragmented resources in Suitcase and .dfont should be reordered
+       when `POST' resource for Type1 is being restored, but reordering of
+       sfnt resources induces the different face order.  Now the ordering
+       is restricted to `POST' resource only, to prevent the different
+       order issue (e.g. the face index in the fontconfig cache generated
+       with Carbon framework is incompatible with that by FreeType 2
+       without Carbon framework.)  Found by Khaled Hosny and Hin-Tak Leung.
 
-       [raster] Fix valgrind warning.
+       http://lists.gnu.org/archive/html/freetype-devel/2013-02/msg00035.html
+       http://lists.gnu.org/archive/html/freetype-devel/2013-12/msg00027.html
 
-       * src/raster/ftraster.c (Decompose_Curve) <default>: Access point[0]
-       only if we don't hit `limit'.
+       * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Add a switch
+       `sort_by_res_id' to control the fragmented resource ordering.
+       * include/internal/ftrfork.h: Declare new switch.
+       * src/base/ftobjs.c (IsMacResource): Enable the sorting for `POST'
+       resource, and disable the sorting for `sfnt' resource.
 
-2010-08-06  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2013-12-25  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30658.
+       Fix Savannah bug #40997.
 
-       * src/base/ftobjs.c (Mac_Read_POST_Resource): Check that the total
-       length of collected POST segments does not overrun the allocated
-       buffer.
+       * src/bdf/bdfdrivr.c (BDF_Face_Init): Only use OR operator to
+       adjust face flags since FT_FACE_FLAG_EXTERNAL_STREAM might already
+       be set.
+       * src/cff/cffobjs.c (cff_face_init): Ditto.
+       * src/cid/cidobjs.c (cid_face_init): Ditto.
+       * src/pcf/pcfread.c (pcf_load_font): Ditto.
+       * src/pfr/pfrobjs.c (pfr_face_init): Ditto.
+       * src/type1/t1objs.c (T1_Face_Init): Ditto.
+       * src/type42/t42objs.c (T42_Face_Init): Ditto.
+       * src/winfonts/winfnt.c (FNT_Face_Init): Ditto.
 
-2010-08-06  Yuriy Kaminskiy  <yumkam@mail.ru>
+2013-12-21  Werner Lemberg  <wl@gnu.org>
 
-       Fix conditional usage of FT_MulFix_i386.
-       With -ansi flag, gcc does not define `i386', only `__i386__'.
+       [autofit] Introduce `coverages'.
 
-       * include/freetype/config/ftconfig.h, builds/unix/ftconfig.in:
-       s/i386/__i386__/.
+       Coverages are the interface to the HarfBuzz library to acces
+       OpenType features for handling glyphs not addressable by the cmap.
 
-2010-08-05  Werner Lemberg  <wl@gnu.org>
+       Right now, compilation of HarfBuzz is only added to the development
+       build.  A solution for standard build mode will be delayed until
+       HarfBuzz gets split into two libraries to avoid mutual dependencies
+       between FreeType and HarfBuzz.
 
-       Fix Savannah bug #30657.
+       Note that this is only a first step in handling coverages, basically
+       providing the framework only.  Code for handling selected OpenType
+       features (this is, actually using the data in `afcover.h') will
+       follow.
 
-       * src/truetype/ttinterp.c (BOUNDSL): New macro.
-       Change `BOUNDS' to `BOUNDSL' where appropriate.
+       * devel/ftoption.h, include/config/ftoption.h
+       (FT_CONFIG_OPTION_USE_HARFBUZZ): New macro.
 
-       * src/truetype/ttinterp.h (TT_ExecContextRec): Fix type of
-       `cvtSize'.
+       * src/autofit/hbshim.c, src/autofit/hbshim.h, src/autofit/afcover.h:
+       New files.
 
-2010-08-05  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/afscript.h: Add HarfBuzz script name tags.
 
-       Fix Savannah bug #30656.
+       * src/autofit/afstyles.h: Add default coverage enumeration values.
 
-       * src/type42/t42parse.c (t42_parse_sfnts): Protect against negative
-       string_size.
-       Fix comparison.
+       * src/autofit/aftypes.h: Update use of `SCRIPT' and `STYLE' macros.
+       (AF_Coverage): New enumeration (generated by `afcover.h').
+       (AF_StyleClassRec): New member `coverage'.
+       (AF_DEFINE_STYLE_CLASS): Updated.
 
-2010-08-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * include/internal/fttrace.h: Add `afharfbuzz' for tracing coverage
+       data.
 
-       [cff] Don't use any values in decoder after parsing error.
+       * src/autofit/afglobal.h: Update use of `SCRIPT' and `STYLE' macros.
+       (AF_SCRIPT_FALLBACK): Renamed to ...
+       (AF_STYLE_FALLBACK): ... this.
 
-       * src/cff/cffgload.c (cff_slot_load): Skip the evaluations
-       of the values in decoder, if `cff_decoder_parse_charstrings'
-       returns any error.
+       * src/autofit/afglobal.c: Include `hbshim.c'.
+       Update use of `SCRIPT' and `STYLE' macros.
+       (af_face_globals_compute_style_coverage)
+       [FT_CONFIG_OPTION_USE_HARFBUZZ]: Call `af_get_coverage'.
+       Update.
 
-2010-08-04  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/afmodule.h (AF_ModuleRec):
+       s/fallback_script/fallback_style/.
 
-       Fix Savannah bug #30644.
+       * src/autofit/afmodule.c (af_property_set): Adapt handling of
+       `fallback-script' property to set a fallback style.
+       (af_property_get, af_autofitter_init): Updated.
 
-       * src/base/ftstream.c (FT_Stream_EnterFrame): Fix comparison.
+       * src/autofit/afpic.c: Update use of `SCRIPT' and `STYLE' macros.
 
-2010-08-04  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/afranges.h: Update use of `SCRIPT' macro.
 
-       `make devel' fails if FT_CONFIG_OPTION_OLD_INTERNALS is set.
+       * src/autofit/autofit.c [FT_CONFIG_OPTION_USE_HARFBUZZ]: Include
+       `hbshim.c'.
 
-       * devel/ftoption.h: Synchronize with
-       include/freetype/config/ftoption.h.
+       * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `hbshim.c'.
+       (AUTOF_DRV_H): Add `afcover.h'.
 
-2010-08-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * builds/freetype.mk (INCLUDE_FLAGS) [DEVEL_DIR]: Use pkg-config for
+       all libraries needed by FreeType.
 
-       [cff] Improve stack overflow test.
+2013-12-21  Werner Lemberg  <wl@gnu.org>
 
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings): Check stack
-       after execution of operations too.
+       Fix Savannah bug #40975 (sort of).
 
-2010-07-18  Werner Lemberg  <wl@gnu.org>
+       * src/truetype/ttinterp.c (Ins_IP): Fix sign typo to make FreeType
+       behave the same as the Windows TrueType engine for the invalid case.
 
-       Add reference counters and to FT_Library and FT_Face objects.
+2013-12-21  Werner Lemberg  <wl@gnu.org>
 
-       * include/freetype/freetype.h (FT_Reference_Face): New function.
-       * include/freetype/ftmodapi.h (FT_Rererence_Library): New function.
+       [autofit] Make PIC mode work actually.
 
-       * include/freetype/internal/ftobjs.h (FT_Face_InternalRec,
-       FT_LibraryRec): New field `refcount'.
+       * src/autofit/afpic.h (AFModulePIC): Fix array sizes to fit the
+       enumeration values automatically generated by including `afscript.h'
+       and friends.
 
-       * src/base/ftobjs.c (FT_Open_Face, FT_New_Library): Handle
-       `refcount'.
-       (FT_Reference_Face, FT_Reference_Library): Implement new functions.
-       (FT_Done_Face, FT_Done_Library): Handle `refcount'.
+       * src/autofit/afpic.c (autofit_module_class_pic_init): Updated.
 
-       * docs/CHANGES: Updated.
+2013-12-21  Werner Lemberg  <wl@gnu.org>
 
-2010-07-18  Werner Lemberg  <wl@gnu.org>
+       Fix PIC linking.
 
-       * Version 2.4.1 released.
-       =========================
+       * include/internal/ftrfork.h (CONST_FT_RFORK_RULE_ARRAY_BEGIN): Fix
+       generated function name.
 
+       * src/base/basepic.c (FT_Init_Table_raccess_guess_table): Rename
+       to ...
+       (FT_Init_Table_ft_raccess_guess_table): ... this so that the
+       function name correctly corresponds to what the macro framework
+       expects.
 
-       Tag sources with `VER-2-4-1'.
+       * src/psnames/rules.mk (PSNAMES_DRV_SRC_S): Use correct file name so
+       that PIC functions are compiled also.
 
-       * docs/CHANGES: Updated.
+2013-12-21  Werner Lemberg  <wl@gnu.org>
 
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.4.1.
+       [base] Add missing dependencies to Makefile.
 
-       * 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.4.0/2.4.1/, s/240/241/.
+       * src/base/rules.mk (BASE_SRC): Add `basepic.c' and `ftpic.c'.
+       (BASE_H): Add `basepic.h'.
 
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
+2013-12-20  Werner Lemberg  <wl@gnu.org>
 
-       * builds/unix/configure.raw (version_info): Set to 11:1:5.
+       [autofit] Fix PIC compilation.
 
-2010-07-17  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/afcjk.c (af_cjk_metrics_init_widths),
+       src/autofit/aflatin.c (af_latin_metrics_init_widths)
+       [FT_CONFIG_OPTION_PIC]: Declare `globals'.
 
-       [cff] Final try to fix `hintmask' and `cntrmask' limit check.
+       * src/autofit/afglobal.c: Always call AF_DEFINE_SCRIPT_CLASS, and
+       AF_DEFINE_STYLE_CLASS.
 
-       Problem reported by Tobias Wolf <towolf@gmail.com>.
+       * src/autofit/afpic.c: Include `afglobal.h'.
+       (autofit_module_class_pic_init): Typo.
 
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
-       <cff_op_hintmask>: Sigh.  I'm apparently too silly to fix this
-       correctly in less than three tries.
+       * src/autofit/aftypes.h (AF_DEFINE_SCRIPT_CLASS,
+       AF_DEFINE_STYLE_CLASS): Don't use the same identifier for macro
+       parameter and structure member.
 
-2010-07-12  Werner Lemberg  <wl@gnu.org>
+2013-12-20  Werner Lemberg  <wl@gnu.org>
 
-       * Version 2.4.0 released.
-       =========================
+       [autofit] Introduce `styles'.
 
+       This is the new top-level structure for handling glyph input data;
+       scripts are now defined separately.
 
-       Tag sources with `VER-2-4-0'.
+       * src/autofit/aftypes.h (SCRIPT): Updated.
+       (AF_ScriptClassRec): Move `blue_stringset' and `writing_system'
+       members to ...
+       (AF_Style_ClassRec): ... this new structure.
+       (AF_Style): New enumeration.
+       (AF_StyleMetricsRec): Replace `script' enumeration with
+       `style_class' pointer.
+       (AF_DEFINE_SCRIPT_CLASS, AF_DECLARE_SCRIPT_CLASS): Updated.
+       (AF_DEFINE_STYLE_CLASS, AF_DECLARE_STYLE_CLASS): New macros.
 
-       * docs/CHANGES: Updated.
+       * src/autofit/afstyles.h: New file, using data from `afscript.h'.
+       * src/autofit/afscript.h: Updated.
 
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.4.0.
+       * src/autofit/afcjk.c (af_cjk_metrics_init_widths,
+       af_cjk_metrics_init_blues, af_cjk_hint_edges): Updated.
 
-       * 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.12/2.4.0/, s/2312/240/.
+       * src/autofit/afglobal.c (SCRIPT): Updated.
+       (STYLE): Redefine macro to load `afstyles.h'.
+       (af_script_names) [FT_DEBUG_LEVEL_TRACE]: Replace with...
+       (af_style_names): ... this array.
+       (af_face_globals_compute_script_coverage): Renamed to...
+       (af_face_globals_compute_style_coverage): ... this.
+       Updated.
+       (af_face_globals_new, af_face_globals_free,
+       af_face_globals_get_metrics): Updated.
 
-       * include/freetype/freetype.h (FREETYPE_MINOR): Set to 4.
-       (FREETYPE_PATCH): Set to 0.
+       * src/autofit/afglobal.h (SCRIPT): Updated.
+       (STYLE): Redefine macro to load `afstyles.h'.
+       (AF_SCRIPT_FALLBACK): Update definition.  This will get more
+       refinements with later on.
+       (AF_SCRIPT_UNASSIGNED): Replace with...
+       (AF_STYLE_UNASSIGNED): ... this macro.
+       (AF_FaceGlobalsRec): Updated.
 
-       * builds/unix/configure.raw (version_info): Set to 11:0:5.
+       * src/autofit/aflatin.c (af_latin_metrics_init_widths,
+       af_latin_metrics_init_blues, af_latin_metrics_scale_dim,
+       af_latin_hint_edges): Updated.
 
-2010-07-12  Werner Lemberg  <wl@gnu.org>
+       * src/autofit/aflatin2.c (af_latin2_metrics_init_widths): Updated.
+       (af_ltn2_uniranges): Removed.
 
-       Remove C++ warnings.
+       * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
+       Updated.
 
-       */*: Initialize pointers where necessary to make g++ happy.
+       * src/autofit/afpic.c (autofit_module_class_pic_init): Updated.
+       * src/autofit/afpic.h (AF_STYLE_CLASSES_GET): New macro.
+       (AFModulePIC): Add `af_style_classes' and `af_style_classes_rec'
+       members.
 
-2010-07-12  malc  <av1474@comtv.ru>
-           Richard Henderson  <rth@redhat.com>
+       * src/autofit/afranges.h: Updated.
 
-       Fix type-punning issues with C++.
+       * src/autofit/rules.mk (AUTOF_DRV_H): Add `afstyles.h'.
 
-       * include/freetype/internal/ftmemory.h (FT_ASSIGNP) [__cplusplus]:
-       Emulate a `typeof' operator with an inline template which uses
-       `static_cast'.
+2013-12-19  Werner Lemberg  <wl@gnu.org>
 
-2010-07-11  Werner Lemberg  <wl@gnu.org>
+       [autofit] Factor scripts and uniranges out of writing system files.
 
-       Fix C++ compilation issue.
+       * src/autofit/afranges.c, src/autofit/afranges.h: New files.
 
-       * src/tools/apinames.c (names_dump) <OUTPUT_WATCOM_LBC>: Fix
-       type of `dot' variable.
+       * src/autofit/afscript.h: Extend `SCRIPT' macro with more
+       parameters, taking data from the writing system files.
 
-2010-07-10  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/autofit/aftypes.h: Updated.
 
-       Fix another case reported in Savannah bug #30373.
-       Permit a face for Type1, Type42 and CFF without charmap,
-       patch by Tor Andersson.
+       * src/autofit/afglobal.c: Include `afranges.h'.
+       Load `afscript.h' to call AF_DEFINE_SCRIPT_CLASS.
+       * src/autofit/afglobal.c: Include `afranges.h'.
+       Load `afscript.h' to call AF_DECLARE_SCRIPT_CLASS.
 
-       * src/type1/t1objs.c (T1_Face_Init): Reset the error if it
-       is FT_Err_No_Unicode_Glyph_Name.
-       * src/type42/t42objs.c (T42_Face_Init): Ditto.
-       * src/cff/cffobjs.c (cff_face_init): Ditto.
+       * src/autofit/afcjk.c, src/autofit/afcjk.h: Updated.
+       * src/autofit/afdummy.c, src/autofit/afdummy.h: Updated.
+       * src/autofit/afindic.c, src/autofit/afindic.h: Updated.
+       * src/autofit/aflatin.c, src/autofit/aflatin.h: Updated.
+       * src/autofit/aflatn2.c, src/autofit/aflatn2.h: Updated.
 
-2010-07-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/autofit/afpic.c: Updated.
 
-       Use defined macros to set {platform,encoding}_id.
+       * src/autofir/autofit.c: Include `afranges.c'.
+       * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afranges.c'.
 
-       * src/bdf/bdfdrivr.c: Include ttnameid.h and use macros to
-       set charmap.{platfom,encoding}_id.
-       * src/pcf/pcfdrivr.c: Ditto.
-       * src/winfonts/winfnt.c: Ditto.
-       * src/type1/t1objs.c: Ditto.
-       * src/type42/t42objs.c: Ditto.
-       * src/cff/cffobjs.c: Ditto.
-       * src/pfr/pfrobjs.c: Ditto.
+2013-12-18  Werner Lemberg  <wl@gnu.org>
 
-2010-07-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       [autofit] More code orthogonality.
 
-       Fix Savannah bug #30373.
-       Too serious check of errors by `FT_CMap_New' since 2010-07-04
-       is fixed. Reported by Tor Andersson.
+       * src/autofit/aftypes.h (AF_StyleMetrics): Replace `script_class'
+       pointer to an `AF_ScriptClass' structure with `script' index of type
+       `AF_Script'.
+       Move some code around.
 
-       * include/freetype/fterrdef.h
-       (PSnames_Err_No_Unicode_Glyph_Name): New error code to
-       indicate the Unicode charmap synthesis failed because
-       no Unicode glyph name is found.
+       * src/autofit/afcjk.c: Include `afpic.h'.
+       (af_cjk_metrics_init_widths, af_cjk_metrics_init_blues,
+       af_cjk_hint_edges): Updated.
 
-       * src/psnames/psmodule.c (ps_unicodes_init): Return
-       PSnames_Err_No_Unicode_Glyph_Name when no Unicode glyph name
-       is found in the font.
-       * src/cff/cffcmap.c (cff_cmap_unicode_init): Return
-       CFF_Err_No_Unicode_Glyph_Name when no SID is available.
+       * src/autofit/aflatin.c: Include `afpic.h'.
+       (af_latin_metrics_init_widths, af_latin_metrics_init_blues,
+       af_latin_metrics_scale_dim, af_latin_hint_edges): Updated.
 
-       * src/type1/t1objs.c (T1_Face_Init): Proceed if `FT_CMap_New'
-       is failed by the lack of Unicode glyph name.
-       * src/type42/t42objs.c (T42_Face_Init): Ditto.
-       * src/cff/cffobjs.c (cff_face_init): Ditto.
+       * src/autofit/afglobal.c (af_face_globals_get_metrics): Updated.
 
-2010-07-09  Ken Sharp  <ken.sharp@artifex.com>
+       * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
+       Updated.
 
-       Make ftraster.c compile in stand-alone mode with MSVC compiler.
+2013-12-18  Werner Lemberg  <wl@gnu.org>
 
-       * src/raster/ftmisc.h (FT_Int64) [_WIN32, _WIN64]: Fix typedef
-       since there is no `inttypes.h' for MSVC.
+       [autofit] s/ScriptMetrics/StyleMetrics/.
 
-2010-07-08  Werner Lemberg  <wl@gnu.org>
+2013-12-18  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30361.
+       [autofit] s/script_{metrics,hints}/style_{metrics,hints}/
 
-       * src/truetype/ttinterp.c (Ins_IUP): Fix bounds check.
+2013-12-18  Werner Lemberg  <wl@gnu.org>
 
-2010-07-06  Werner Lemberg  <wl@gnu.org>
+       [autofit] s/gscripts/gstyles/.
 
-       Pacify compiler.
+2013-12-18  Werner Lemberg  <wl@gnu.org>
 
-       * src/cff/cffload.c (cff_index_get_pointers): Initialize
-       `new_bytes'.
+       [autofit] s/glyph_scripts/glyph_styles/.
 
-2010-07-05  Eugene A. Shatokhin  <spectre@ispras.ru>
+       This is the first commit of a series to create a new top-level
+       structure (a `style') for handling scripts, writing_systems, and
+       soon-to-be-added coverages.
 
-       Fix Savannah bug #27648.
+2013-12-17  Werner Lemberg  <wl@gnu.org>
 
-       * src/base/ftobjs.c (ft_remove_renderer, FT_Add_Module): Call
-       `raster_done' only if we have an outline glyph format.
+       [autofit] s/AF_Script_/AF_WritingSystem_/ where appropriate.
 
-2010-07-05  Werner Lemberg  <wl@gnu.org>
+2013-12-11  Infinality  <infinality@infinality.net>
 
-       Fix Savannah bug #30030.
+       [truetype] Simplify logic of rendering modes.
 
-       * builds/win32/*/freetype.vcproj: Add ftxf86.c.
+       This patch unifies the subpixel and non-subpixel cases.
 
-2010-07-05  Werner Lemberg  <wl@gnu.org>
+       * src/truetype/ttinterp.h (TT_ExecContextRec): Remove
+       `grayscale_hinting'; all code should refer to `grayscale' instead.
+       Remove unused `native_hinting' member.
+       Rename `subpixel_hinting' member to `subpixel.
 
-       [cff] Next try to fix `hintmask' and `cntrmask' limit check.
+       * src/truetype/ttgload.c (TT_LOADER_SET_PP): Updated.
+       (tt_loader_init): Updated.
 
-       Problem reported by malc <av1474@comtv.ru>.
+       * src/truetype/ttinterp.c (Ins_GETINFO): Simplify.
+       Updated.
 
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
-       <cff_op_hintmask>: It is possible that there is just a single byte
-       after the `hintmask' or `cntrmask', e.g., a `return' instruction.
+2013-12-11  Werner Lemberg  <wl@gnu.org>
 
-2010-07-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       [documentation] Add section how to include FreeType header files.
+       Problem reported by David Kastrup <dak@gnu.org>.
 
-       Restrict the number of the charmaps in a rogue-compatible mode.
-       Fix for Savannah bug #30059.
+       Surprisingly, a description how to do that was completely missing in
+       the API reference.
 
-       * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Replace `16' the
-       minimum character code passed by a legacy rogue client by...
-       * include/freetype/config/ftoption.h (FT_MAX_CHARMAP_CACHEABLE):
-       This.  It is undefined when FT_CONFIG_OPTION_OLD_INTERNALS is
-       undefined (thus the rogue client compatibility is not required).
+       * include/freetype.h, include/ftchapters.h: New documentation
+       section `header_inclusion'.
 
-       * src/cff/cffobjs.c (cff_face_init): Abort the automatic
-       selection or synthesis of Unicode cmap subtable when the charmap
-       index exceeds FT_MAX_CHARMAP_CACHEABLE.
-       * src/sfnt/ttcmap.c (tt_face_build_cmaps): Issue error message
-       when the charmap index exceeds FT_MAX_CHARMAP_CACHEABLE.
+2013-12-10  Werner Lemberg  <wl@gnu.org>
 
-       * src/base/ftobjs.c (find_unicode_charmap): When Unicode charmap
-       is found after FT_MAX_CHARMAP_CACHEABLE, ignore it and search
-       earlier one.
-       (find_variant_selector_charmap): When UVS charmap is found after
-       FT_MAX_CHARMAP_CACHEABLE, ignore it and search earlier one.
-       (FT_Select_Charmap): When a charmap matching with requested
-       encoding but after FT_MAX_CHARMAP_CACHEABLE, ignore and search
-       earlier one.
-       (FT_Set_Charmap): When a charmap matching with requested
-       charmap but after FT_MAX_CHARMAP_CACHEABLE, ignore and search
-       earlier one.
-       (FT_Get_Charmap_Index): When a requested charmap is found
-       after FT_MAX_CHARMAP_CACHEABLE, return the inverted charmap
-       index.
+       [autofit] s/DFLT/NONE/, s/dflt/none/.
 
-2010-07-04  Werner Lemberg  <wl@gnu.org>
+2013-12-10  Werner Lemberg  <wl@gnu.org>
 
-       TrueType hinting is no longer patented.
+       [autofit] s/AF_SCRIPT_NONE/AF_SCRIPT_UNASSIGNED/.
 
-       * include/freetype/config/ftoption.h, devel/ftoption.h
-       (TT_CONFIG_OPTION_BYTECODE_INTERPRETER): Define.
-       (TT_CONFIG_OPTION_UNPATENTED_HINTING): Undefine.
+2013-12-10  Werner Lemberg  <wl@gnu.org>
 
-       * docs/CHANGES, docs/INSTALL, include/freetype/freetype.h: Updated.
-       * docs/TRUETYPE, docs/PATENTS: Removed.
+       [truetype] Fix scaling of vertical phantom points.
 
-2010-07-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       * src/truetype/ttgload.c (load_truetype_glyph): Scale pp3.x and
+       pp4.x also.
 
-       Check error value by `FT_CMap_New'.
+2013-12-10  Werner Lemberg  <wl@gnu.org>
 
-       * src/cff/cffobjs.c (cff_face_init): Check error value by
-       `FT_CMap_New'.
-       * src/pfr/pfrobjs.c (pfr_face_init): Ditto.
-       * src/type1/t1jobjs.c (T1_Face_Init): Ditto.
-       * src/type42/t42jobjs.c (T42_Face_Init): Ditto.
+       [truetype] Fix positioning of composite glyphs.
+       Problem reported by Nigel Tao <nigeltao@golang.org>.
 
-2010-07-03  Werner Lemberg  <wl@gnu.org>
+       * src/truetype/ttgload.c (TT_Hint_Glyph): Remove code that shifts
+       the glyph (component) by a fractional value computed from the LSB
+       phantom point.  This is wrong, since the horizontal phantom points
+       get rounded horizontally later on.
 
-       Make ftgrays.c compile stand-alone again.
+2013-12-08  Werner Lemberg  <wl@gnu.org>
 
-       * src/smooth/ftgrays.c [_STANDALONE_]: Include `stddef.h'.
-       (FT_INT_MAX, FT_PtrDist)[_STANDALONE_]: Define.
+       * Version 2.5.2 released.
+       =========================
 
-2010-07-02  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       Additional fix for Savannah bug #30306.
+       Tag sources with `VER-2-5-2'.
 
-       * src/base/ftobjs.c (Mac_Read_POST_Resource): If the type of the
-       POST fragment is 0, the segment is completely ignored.  The declared
-       length of the segment is not cared at all.  According to Adobe
-       Technical Note 5040, type 0 segment is a comment only and should not
-       be loaded for the interpreter.  Reported by Robert Święcki.
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.5.2.
+
+       * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
+       builds/windows/vc2005/index.html,
+       builds/windows/vc2008/freetype.vcproj,
+       builds/windows/vc2008/index.html,
+       builds/windows/vc2010/freetype.vcxproj,
+       builds/windows/vc2010/index.html,
+       builds/windows/visualc/freetype.dsp,
+       builds/windows/visualc/freetype.vcproj,
+       builds/windows/visualc/index.html,
+       builds/windows/visualce/freetype.dsp,
+       builds/windows/visualce/freetype.vcproj,
+       builds/windows/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.5.1/2.5.2/, s/251/252/.
 
-2010-07-01  Werner Lemberg  <wl@gnu.org>
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.
 
-       [truetype] Protect against code range underflow.
+       * builds/unix/configure.raw (version_info): Set to 17:1:11.
+       * CMakeLists.txt (VERSION_PATCH): Set to 2.
+       * docs/CHANGES: Updated.
 
-       * src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF): Don't allow
-       negative IP values.
+2013-12-07  Werner Lemberg  <wl@gnu.org>
 
-2010-07-01  Werner Lemberg  <wl@gnu.org>
+       [truetype] Next round in phantom point handling.
 
-       [truetype] Add rudimentary tracing for bytecode instructions.
+       Greg Hitchcock provided very interesting insights into the
+       complicated history of the horizontal positions of the TSB and BSB
+       phantom points.
 
-       * src/truetype/ttinterp.c (opcode_name) [FT_DEBUG_LEVEL_TRACE]: New
-       array.
-       (TT_RunIns): Trace opcodes.
+       * src/truetype/ttgload.c (TT_LOADER_SET_PP)
+       [TT_CONFIG_OPTION_SUBPIXEL_HINTING]: Use `subpixel_hinting' and
+       `grayscale_hinting' flags as conditionals for the x position of TSB
+       and BSB.
 
-2010-06-30  Werner Lemberg  <wl@gnu.org>
+2013-12-05  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30263.
+       * builds/freetype.mk (FT_CC): Removed.  Unused.
 
-       * src/smooth/ftgrays.c (gray_render_span): Use cast to `unsigned
-       int' to avoid integer overflow.
+2013-12-04  Werner Lemberg  <wl@gnu.org>
 
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use smaller
-       threshold values for `width' and `height'.  This is not directly
-       related to the bug fix but makes sense anyway.
+       [sfnt] Fix handling of embedded bitmap strikes.
 
-2010-07-01  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       This corrects the commit from 2013-11-21.  Problem reported by
+       Andrey Panov <panov@canopus.iacp.dvo.ru>.
 
-       Initial fix for Savannah bug #30306.
+       * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Fix logic to
+       detect excessive bytes for bit-aligned bitmaps.
 
-       * src/base/ftobjs.c (Mac_Read_POST_Resource): Check `rlen', the
-       length of fragment declared in the POST fragment header, and prevent
-       an underflow in length calculation.  Some fonts set the length to
-       zero in spite of the existence of a following 16bit `type'.
-       Reported by Robert Święcki.
+2013-12-03  Werner Lemberg  <wl@gnu.org>
 
-2010-07-01  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       [truetype] Remove dead code.
 
-       Additional fix for Savannah bug #30248 and #30249.
+       Reported by Nigel Tao <nigeltao@golang.org>.
 
-       * src/base/ftobjs.c (Mac_Read_POST_Resource): Check the buffer size
-       during gathering PFB fragments embedded in LaserWriter PS font for
-       Macintosh.  Reported by Robert Święcki.
+       * include/internal/tttypes.h (TT_LoaderRec): Remove unused
+       `preserve_pps' field.
+       * src/truetype/ttgload.c (TT_Hint_Glyph): Updated.
 
-2010-06-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
+2013-12-03  Werner Lemberg  <wl@gnu.org>
 
-       Minor optimizations by avoiding divisions.
+       [truetype] Fix phantom point handling.
 
-       * src/sfnt/ttkern.c (tt_face_load_kern, tt_face_get_kerning):
-       Replace divisions with multiplication in comparisons.
+       This is a further improvement to the changes from 2013-11-06.
 
-2010-06-29  Werner Lemberg  <wl@gnu.org>
+       * src/truetype/ttgload.c (TT_Hint_Glyph): Horizontal phantom points
+       are rounded horizontally, vertical ones are rounded vertically.
+       (TT_LOADER_SET_PP): The horizontal position of vertical phantom
+       points in pre-ClearType mode is zero, as shown in the OpenType
+       specification.
 
-       Fix minor tracing issues.
+2013-12-02  Werner Lemberg  <wl@gnu.org>
 
-       * src/cff/cffgload.c, src/truetype/ttgload.c: Adjust tracing levels.
+       [truetype] Fix change from 2013-11-20.
 
-2010-06-27  Werner Lemberg  <wl@gnu.org>
+       Problem reported by Akira Kakuto <kakuto@fuk.kindai.ac.jp>.
 
-       [cff] Really fix `hintmask' and `cntrmask' limit check.
+       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Protect call to
+       `Update_Max' with both a TT_USE_BYTECODE_INTERPRETER guard and a
+       `IS_HINTED' clause.
+       Also remove redundant check using `maxSizeOfInstructions' – in
+       simple glyphs, the bytecode data comes before the outline data, and
+       a validity test for this is already present.
 
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
-       <cff_op_hintmask>: Fix thinko and handle tracing also.
+2013-11-27  Werner Lemberg  <wl@gnu.org>
 
-2010-06-27  Werner Lemberg  <wl@gnu.org>
+       [autofit] Fix use of dumping functions in `ftgrid' demo program.
 
-       Fix valgrind warning.
+       * src/autofit/afhints.c (AF_DUMP) [FT_DEBUG_AUTOFIT]: New macro.
+       (af_glyph_hints_dump_points, af_glyph_hints_dump_segments,
+       af_glyph_hints_dump_edges) [FT_DEBUG_AUTOFIT]: Add parameter to
+       handle output to stdout.
+       Use AF_DUMP.
+       (af_glyph_hints_dump_points, af_glyph_hints_dump_segments,
+       af_glyph_hints_dump_edges) [!FT_DEBUG_AUTOFIT]: Removed.
 
-       * src/base/ftoutln.c (FT_Outline_Get_Orientation): Initialize
-       `result' array.
+2013-11-25  Werner Lemberg  <wl@gnu.org>
 
-2010-06-27  Werner Lemberg  <wl@gnu.org>
+       * Version 2.5.1 released.
+       =========================
 
-       [cff] Fix memory leak.
 
-       * src/cff/cffgload.c (cff_operator_seac): Free charstrings even in
-       case of errors.
+       Tag sources with `VER-2-5-1'.
 
-2010-06-27  Werner Lemberg  <wl@gnu.org>
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.5.1.
+
+       * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
+       builds/windows/vc2005/index.html,
+       builds/windows/vc2008/freetype.vcproj,
+       builds/windows/vc2008/index.html,
+       builds/windows/vc2010/freetype.vcxproj,
+       builds/windows/vc2010/index.html,
+       builds/windows/visualc/freetype.dsp,
+       builds/windows/visualc/freetype.vcproj,
+       builds/windows/visualc/index.html,
+       builds/windows/visualce/freetype.dsp,
+       builds/windows/visualce/freetype.vcproj,
+       builds/windows/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.5.0/2.5.1/, s/250/251/.
 
-       [cff] Protect against invalid `hintmask' and `cntrmask' operators.
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
 
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
-       <cff_op_hintmask>: Ensure that we don't exceed `limit' while parsing
-       the bit masks of the `hintmask' and `cntrmask' operators.
+       * builds/unix/configure.raw (version_info): Set to 17:0:11.
+       * CMakeLists.txt (VERSION_PATCH): Set to 1.
+       * docs/CHANGES, docs/release: Updated.
 
-2010-06-26  Werner Lemberg  <wl@gnu.org>
+2013-11-23  Werner Lemberg  <wl@gnu.org>
 
-       Fix PFR change 2010-06-24.
+       [truetype]: Add tricky font names `hkscsiic.ttf' and `iicore.ttf'.
 
-       * src/pfr/pfrgload.c (pfr_glyph_load_simple): Really protect against
-       invalid indices.
+       * src/truetype/ttobjs.c (TRICK_NAMES_MAX_CHARACTERS,
+       TRICK_NAMES_COUNT): Updated.
+       (trick_names): Add family name for the two fonts.
 
-2010-06-26  Werner Lemberg  <wl@gnu.org>
+2013-11-23  Werner Lemberg  <wl@gnu.org>
 
-       Improve PFR tracing messages.
+       * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Typo.
 
-       * src/pfr/pfrgload.c (pfr_glyph_load_rec): Emit tracing messages for
-       simple and compound glyph offsets.
+2013-11-21  Werner Lemberg  <wl@gnu.org>
 
-2010-06-26  Werner Lemberg  <wl@gnu.org>
+       [sfnt] Typo.
 
-       Fix last PFR change.
+       Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
 
-       * src/pfr/pfrobjs.c (pfr_face_init): Fix rejection logic.
+       * src/sfnt/sfobjs.c (sfnt_load_face): Return correct `bsize->width'
+       value if the font lacks an `OS/2' table.
 
-2010-06-26  Werner Lemberg  <wl@gnu.org>
+2013-11-21  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30262.
+       [sfnt] Improve handling of buggy embedded bitmap strikes.
 
-       * src/sfnt/ttload.c (tt_face_load_maxp): Limit `maxComponentDepth'
-       arbitrarily to 100 to avoid stack exhaustion.
+       We are now able to successfully load `AppleMyoungJo.ttf'.
+       Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
 
-2010-06-26  Werner Lemberg  <wl@gnu.org>
+       * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Don't trust glyph
+       format.
 
-       Add some memory checks (mainly for debugging).
+2013-11-20  Werner Lemberg  <wl@gnu.org>
 
-       * src/base/ftstream.c (FT_Stream_EnterFrame): Exit with error
-       if the frame size is larger than the stream size.
+       [truetype] Don't trust `maxp's `maxSizeOfInstructions'.
 
-       * src/base/ftsystem.c (ft_ansi_stream_io): Exit with error if
-       seeking a position larger than the stream size.
+       Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>; see
 
-2010-06-25  Werner Lemberg  <wl@gnu.org>
+         http://lists.nongnu.org/archive/html/freetype-devel/2013-08/msg00005.html
 
-       Fix Savannah bug #30261.
+       for details.
 
-       * src/pfr/pfrobjs.c (pfr_face_init): Reject fonts which contain
-       neither outline nor bitmap glyphs.
+       * src/base/ftobjs.c (FT_Load_Glyph): Check size of `fpgm' and `prep'
+       tables also for setting `autohint'.
 
-2010-06-25  Werner Lemberg  <wl@gnu.org>
+       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use code from
+       `TT_Process_Composite_Glyph' for handling unreliable values of
+       `maxSizeOfInstructions'.
 
-       Fix Savannah bug #30254.
+2013-11-16  Werner Lemberg  <wl@gnu.org>
 
-       * src/cff/cffload.c (cff_index_get_pointers): Do sanity check for
-       first offset also.
+       [sfnt] Fix `OS/2' table version 5 support.
 
-2010-06-25  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       We now follow the `official' announcement from Microsoft (on the
+       OpenType mailing list, which unfortunately hasn't a public archive).
 
-       Initial fix for Savannah bug #30248 and #30249.
+       * include/freetype/tttables.h (TT_OS2):
+       s/usLowerPointSize/usLowerOpticalPointSize/,
+       s/usUpperPointSize/usUpperOpticalPointSize/.
 
-       * src/base/ftobjs.c (Mac_Read_POST_Resource): Check the error during
-       reading a PFB fragment embedded in LaserWriter PS font for Macintosh.
-       Reported by Robert Święcki.
+       * src/sfnt/ttload.c (tt_face_load_os2): Update, and set correct
+       default values.
 
-2010-06-24  Werner Lemberg  <wl@gnu.org>
+2013-11-13  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30247.
+       * builds/unix/ft2unix.h: Remove.  No longer necessary.
 
-       * src/pcf/pcfread.c (pcf_get_metrics): Disallow (invalid) fonts with
-       zero metrics.
+       * builds/unix/install.mk (install): Updated.
 
-2010-06-24  Graham Asher  <graham.asher@btinternet.com>
+2013-11-13  Werner Lemberg  <wl@gnu.org>
 
-       * src/smooth/ftgrays.c (gray_render_cubic): Fix algorithm.
-       The previous version was too aggressive, as demonstrated in
-       http://lists.gnu.org/archive/html/freetype-devel/2010-06/msg00020.html.
+       Simplify header file hierarchy.
 
-2010-06-24  Werner Lemberg  <wl@gnu.org>
+       This large patch changes the header file directory layout from
+       `include/freetype/...' to `include/...', effectively removing one
+       level.  Since the file `ft2build.h' is also located in `include'
+       (and it stays there even after installation), all FreeType header
+       files are now in a single directory.
 
-       */*: Use module specific error names where appropriate.
+       Applications that use (a) `freetype-config' or FreeType's
+       `pkg-config' file to get the include directory for the compiler, and
+       (b) the documented way for header inclusion like
 
-2010-06-24  Werner Lemberg  <wl@gnu.org>
+         #include <ft2build.h>
+         #include FT_FREETYPE_H
+         ...
 
-       Fix Savannah bug #30236.
+       don't need any change to the source code.
 
-       * src/sfnt/ttcmap.c (tt_face_build_cmaps): Improve check for pointer
-       to `cmap_table'.
+       * include/freetype/*: Move up to...
+       * include/*: ... this directory.
 
-2010-06-24  Werner Lemberg  <wl@gnu.org>
+       * builds/amiga/include/freetype/*: Move up to...
+       * builds/amiga/include/*: ... this directory.
 
-       Fix Savannah bug #30235.
+       */*: Essentially do `s@/freetype/@/@' where appropriate.
 
-       * src/pfr/pfrgload.c (pfr_glyph_load_simple): Protect against
-       invalid indices if there aren't any coordinates for indexing.
+       * CMakeList.txt: Simplify.
+       * builds/unix/freetype-config.in, builds/unix/freetype2.in: For
+       `--cflags', return a single directory.
+       * builds/unix/install.mk (install): No longer try to remove `cache'
+       and `internal' subdirectories; instead, remove the `freetype'
+       subdirectory.
 
-2010-06-24  Werner Lemberg  <wl@gnu.org>
+2013-11-12  Werner Lemberg  <wl@gnu.org>
 
-       [bdf]: Font properties are optional.
+       [truetype] Fix last `truetype' commit.
 
-       * src/bdf/bdflib.c (_bdf_readstream): Use special error code to
-       indicate a redo operation.
-       (_bdf_parse_start): Handle `CHARS' keyword here too and pass current
-       input line to `_bdf_parse_glyph'.
+       * src/truetype/ttgload.c (tt_get_metrics): Preserve stream position.
+       Return error value.
+       (load_truetype_glyph): Updated.
 
-2010-06-23  Werner Lemberg  <wl@gnu.org>
+2013-11-10  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30220.
+       * docs/CMAKE: New dummy file.
 
-       * include/freetype/fterrdef.h
-       (BDF_Err_Missing_Fontboundingbox_Field): New error code.
+2013-11-08  Dave Arnold  <darnold@adobe.com>
 
-       * src/bdf/bdflib.c (_bdf_parse_start): Check for missing
-       `FONTBOUNDINGBOX' field.
-       Avoid memory leak if there are multiple `FONT' lines (which is
-       invalid but doesn't hurt).
+       [cff] Fix for hints that touch.
 
-2010-06-21  Werner Lemberg  <wl@gnu.org>
+       * src/cff/cf2hints.c (cf2_hintmap_insertHint): Fix condition for
+       finding index value of insertion point.
 
-       Fix Savannah bug #30168.
+2013-11-06  Werner Lemberg  <wl@gnu.org>
 
-       * src/pfr/pfrgload.c (pfr_glyph_load_compound): Limit the number of
-       subglyphs to avoid endless recursion.
+       [truetype] Fix handling of phantom points in composite glyphs.
+       Problem reported by Nigel Tao <nigeltao@golang.org>.
 
-2010-06-20  Werner Lemberg  <wl@gnu.org>
+       This is a follow-up commit to the previous one.
 
-       Fix Savannah bug #30145.
+       * src/truetype/ttgload.c (load_truetype_glyph): Call
+       `tt_get_metrics' after loading the glyph header.
 
-       * src/psaux/psobjs.c (t1_builder_add_contour): Protect against
-       `outline == NULL' which might happen in invalid fonts.
+2013-11-06  Werner Lemberg  <wl@gnu.org>
 
-2010-06-19  Werner Lemberg  <wl@gnu.org>
+       [truetype] Improve emulation of vertical metrics.
 
-       Fix Savannah bug #30135.
+       This commit also improves the start values of vertical phantom
+       points.  Kudos to Greg Hitchcock for help.
 
-       * src/bdf/bdflib.c (_bdf_list_join): Don't modify value in static
-       string `empty'.
-       (_bdf_parse_glyph): Avoid memory leak in case of error.
+       * src/truetype/ttgload.c (TT_Get_VMetrics): Add parameter to pass
+       `yMax' value.  Replace code with fixed Microsoft definition.
+       (tt_get_metrics): Updated.
+       (TT_LOADER_SET_PP): Add explanation how to initialize phantom
+       points, taken from both the OpenType specification and private
+       communication with Greg (which will eventually be added to the
+       standard).
+       Fix horizontal position of `pp3' and `pp4'.
 
-2010-06-15  Werner Lemberg  <wl@gnu.org>
+       * src/truetype/ttgload.h: Updated.
 
-       Fix Savannah bug #30108.
+       * src/truetype/ttdriver.c (tt_get_advances): Updated.
 
-       * src/autofit/afglobal.c (af_face_globals_compute_script_coverage):
-       Properly mask AF_DIGIT bit in comparison.
+       * docs/CHANGES: Updated.
 
-2010-06-11  Werner Lemberg  <wl@gnu.org>
+2013-11-05  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30106.
+       * builds/windows/vc2010/freetype.vcxproj: s/v110/v100/.
+       PlatformToolSet version 110 is for VC2012.
 
-       Point numbers for FreeType's implementation of hinting masks are
-       collected before the final number of points of a glyph has been
-       determined; in particular, the code for handling the `endchar'
-       opcode can reduce the number of points.
+       Problem reported (with solution) by Dave Arnold <darnold@adobe.com>.
 
-       * src/pshinter/pshalgo.c (psh_glyph_find_strong_points): Assure that
-       `end_point' is not larger than `glyph->num_points'.
+2013-11-05  Werner Lemberg  <wl@gnu.org>
 
-2010-06-11  Werner Lemberg  <wl@gnu.org>
+       [truetype] Correctly reset point tags for glyph components.
+       Problem reported by Nigel Tao <nigeltao@golang.org>.
 
-       [cff]: Improve debugging output.
+       * src/truetype/ttgload.c (TT_Process_Composite_Glyph): Fix loop.
 
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
-       <cff_op_hintmask>: Implement it.
+2013-11-02  Werner Lemberg  <wl@gnu.org>
 
-2010-06-10  Graham Asher  <graham.asher@btinternet.com>
+       [truetype] Fix GETINFO opcode handling of subpixel hinting bits.
 
-       ftgrays: Speed up rendering of small cubic splines.
+       * src/truetype/ttinterp.c (Ins_GETINFO): Don't request bit 6 set to
+       get info on subpixel hinting.
 
-       * src/smooth/ftgrays.c (gray_render_cubic): Implement new,
-       simplified algorithm to find out whether the spline can be replaced
-       with two straight lines.  See this thread for more:
+       * docs/CHANGES: Updated.
 
-         http://lists.gnu.org/archive/html/freetype-devel/2010-06/msg00000.html
+2013-11-02  Werner Lemberg  <wl@gnu.org>
 
-2010-06-09  Werner Lemberg  <wl@gnu.org>
+       Fix Savannah bug #40451.
 
-       Fix Savannah bug #30082.
+       Simply apply the patch from the bug report.
 
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
-       <cff_op_callothersubr>: Protect against stack underflow.
+       * builds/unix/ftconfig.in, builds/vms/ftconfig.h,
+       include/freetype/config/ftconfig.h: The used #pragma directives only
+       work with gcc versions 4.6 and higher.
 
-2010-06-08  Werner Lemberg  <wl@gnu.org>
+2013-11-01  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30053.
+       * docs/CHANGES: Updated.
 
-       * src/cff/cffparse.c (cff_parse_real): Handle border case where
-       `fraction_length' has value 10.
+2013-11-01  Werner Lemberg  <wl@gnu.org>
 
-2010-06-07  Werner Lemberg  <wl@gnu.org>
+       [truetype] Minor code refactoring.
 
-       Fix Savannah bug #30052.
-       This bug has been introduced with commit 2415cbf3.
+       Two benefits: The allocated FDEF (and IDEF) array gets slightly
+       smaller, and the `ttdebug' demo program has access to function
+       numbers without additional costs.
 
-       * src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Protect
-       against endless loop in case of corrupted font header data.
+       Fortunately, no changes to FontForge are necessary – this is the
+       only external TrueType debugger I know of, but others may exist and
+       should check the code accordingly.
 
-2010-05-26  Werner Lemberg  <wl@gnu.org>
+       * src/truetype/ttinterp.h (TT_CallRec): Replace `Cur_Restart' and
+       `Cur_End' with a pointer to the corresponding `TT_DefRecord'
+       structure.
 
-       Remove unused variable.
-       Found by Graham.
+       * src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF, Ins_ENDF,
+       Ins_CALL, Ins_LOOPCALL, Ins_UNKNOWN, TT_RunIns <Invalid_Opcode>):
+       Updated.
 
-       * src/autofit/afhints.c (af_glyph_hints_reload): Remove unused
-       variable `first' in first block.
+2013-10-27  Werner Lemberg  <wl@gnu.org>
 
-2010-05-22  Werner Lemberg  <wl@gnu.org>
+       [sfnt] Implement support for `OS/2' table version 5.
 
-       Fix various memory problems found by linuxtesting.org.
+       See
 
-       * src/base/ftgxval.c (FT_TrueTypeGX_Free, FT_ClassicKern_Free),
-       src/base/ftotval.c (FT_OpenType_Free), src/base/ftpfr.c
-       (ft_pfr_check): Check `face'.
+         http://typedrawers.com/discussion/470/new-microsoft-size-specific-design-selection-mechanism
 
-       * src/base/ftobjs.c (FT_Get_Charmap_Index): Check `charmap' and
-       `charmap->face'.
-       (FT_Render_Glyph): Check `slot->face'.
-       (FT_Get_SubGlyph_Info): Check `glyph->subglyphs'.
+       for the announcement.
 
-2010-05-22  Werner Lemberg  <wl@gnu.org>
+       * include/freetype/tttables.h (TT_OS2): Add fields
+       `usLowerPointSize' and `usUpperPointSize'.  Since FreeType returns
+       this structure only as a pointer through `FT_Get_Sfnt_Table', there
+       shouldn't be any ABI problems.
 
-       autofit: Remove dead code.
-       Suggested by Graham.
+       * src/sfnt/ttload.c (tt_face_load_os2): Implement it.
 
-       * src/autofit/afhints.c (af_glyph_hints_compute_inflections):
-       Removed.
-       (af_glyph_hints_reload): Remove third argument.
-       Update all callers.
+       * docs/CHANGES: Updated.
 
-2010-05-21  Bram Tassyns  <bramt@enfocus.be>
+2013-10-24  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #27987.
+       * README.git, docs/CHANGES, docs/INSTALL: Updated.
 
-       * src/cff/cffobjs.c (remove_subset_prefix): New function.
-       (cff_face_init): Use it to adjust `cffface->family_name'.
+2013-10-24  John Cary  <cary@txcorp.com>
 
-2010-05-20  Werner Lemberg  <wl@gnu.org>
+       Provide cmake support.
 
-       TrueType: Make FreeType ignore maxSizeOfInstructions in `maxp'.
+       * CMakeLists.txt: New file.
 
-       Acroread does the same.
+2013-10-23  Kenneth Miller  <kennethadammiller@yahoo.com>
+           Werner Lemberg  <wl@gnu.org>
 
-       * src/truetype/ttgload.c (TT_Process_Composite_Glyph): Call
-       `Update_Max' to adjust size of instructions array if necessary and
-       add a rough safety check.
+       Provide support for x64 builds in Visual C++ project files.
 
-       (load_truetype_glyph): Save `loader->byte_len' before recursive
-       call.
+       * src/builds/win32: Renamed to...
+       * src/builds/windows: This.
 
-       * src/truetype/ttinterp.h, src/truetype/ttinterp.c (Update_Max):
-       Declare it as FT_LOCAL.
+       * src/builds/windows/vc2010/*: Updated to handle x64 target.
 
-2010-05-18  Hongbo Ni  <hongbo@njstar.com>
+       * src/builds/windows/*.mk, docs/INSTALL.GNU: s/win32/windows/ where
+       appropriate.
 
-       Apply Savannah patch #7196.
+2013-10-22  Werner Lemberg  <wl@gnu.org>
 
-       * src/cff/cffgload.c (cff_slot_load): Prevent crash if CFF subfont
-       index is out of range.
+       * src/base/md5.c, src/base/md5.h: Updated to recent version.
 
-2010-05-11  Werner Lemberg  <wl@gnu.org>
+       * src/base/ftobjs.c: Updated; `md5.c' no longer uses `free'.
 
-       * docs/formats.txt: Give pointer to PCF documentation.
-       Information provided by Alan Coopersmith
-       <alan.coopersmith@oracle.com>.
+       The canonical URL to get updates for this file is
 
-2010-05-10  Ken Sharp  <ken.sharp@artifex.com>
+         http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/popa3d/popa3d/md5/
 
-       Fix Savannah bug #29846.
+       as the author told me in private communication.
 
-       Previously we discovered fonts which used `setcurrentpoint' to set
-       the initial point of a contour to 0,0.  This caused FreeType to
-       raise an error, because the `setcurrentpoint' operator is only
-       supposed to be used with the results from an OtherSubr subroutine.
+2013-10-19  Werner Lemberg  <wl@gnu.org>
 
-       This was fixed by simply ignoring the error and carrying on.
+       [autofit] s/SMALL_TOP/X_HEIGHT/.
 
-       Now we have found a font which uses setcurrentpoint to actually
-       establish a non-zero point for a contour during the course of a
-       glyph program.  FWIW, these files may be produced by an application
-       called `Intaglio' on the Mac, when converting TrueType fonts to
-       Type 1.
+       * src/autofit/afblue.dat: Updated.
 
-       The fix allows the new invalid behaviour, the old invalid behaviour
-       and real proper usage of the operator to work the same way as Adobe
-       interpreters apparently do.
+       * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
 
-       (t1_decoder_parse_charstrings): Make `setcurrentpoint' use the top
-       two elements of the stack to establish unconditionally the current x
-       and y coordinates.
+       * src/autofit/aflatin.c, src/autofit/aflatin.h,
+       src/autofit/atlatin2.c: Updated.
 
-       Make the `flex' subroutine handling (OtherSubr 0) put the current
-       x,y coordinates onto the stack, instead of two dummy uninitialised
-       values.
+2013-10-19  Werner Lemberg  <wl@gnu.org>
+
+       * src/autofit/afblue.dat: s/MINOR/DESCENDER/.
+
+       * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
+
+2013-10-16  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Add description strings to script entries.
+
+       Currently, this is unused.
+
+       * src/autofit/afscript.h: Do it.
+       * src/autofit/afglobal.c, src/autofit/afpic.c,
+       src/autofit/aftypes.h: Updated.
+
+2013-10-16  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Improve tracing message for extra light flag.
+
+       * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Do it.
+
+2013-10-15  Chongyu Zhu  <lembacon@gmail.com>
+
+       [arm] Fix thumb2 inline assembly under LLVM.
+
+       When using `ADD' with an immediate operand, the instruction is
+       actually `ADD Rd, Rn, #<imm12>', that is, the maximum of the
+       immediate operand cannot exceed 4095.  It will fail to compile with
+       LLVM.
+
+       However, in GCC, due to some legacy compatibility considerations,
+       `ADD.W' will be automatically emitted when the immediate operand is
+       larger than 4095.
+
+       * builds/unix/ftconfig.in, include/freetype/config/ftconfig.h
+       (FT_MulFix_arm) [__GNUC__]: Support clang compiler.
+
+       * src/truetype/ttinterp.c (TT_MulFix14_arm) [__GNUC__]: Ditto.
+
+2013-10-12  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Improve tracing of `latin' hinter.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init_blues): Report blue
+       zone types.
+       (af_latin_metrics_scale_dim): Report scaling changes due to x height
+       alignment.
+       Report scaled stroke width and blue zone values.
+
+2013-10-03  Dave Arnold  <darnold@adobe.com>
+
+       * src/cff/cf2font.c (cf2_computeDarkening): Avoid division by zero.
+
+       Note that the old code avoided using a region of the piecewise
+       linear function where the slope was zero.  The recovery was to use a
+       different section of the function, which produced a different,
+       incorrect amount of darkening.
+
+2013-10-02  Darrell Bellert  <darrell.bellert@hl.konicaminolta.us>
+
+       * src/sfnt/ttload.c (tt_face_load_pclt): Fix `pclt_fields'.
+
+2013-10-02  Dave Arnold  <darnold@adobe.com>
+
+       * src/cff/cf2font.c (cf2_computeDarkening): Initialize darkenAmount.
+
+       This line was lost in commit 89ca1fd6 (from 2013-06-25).  The effect
+       is to use a previous darkening amount when producing an unhinted,
+       unscaled outline.  This can cause autohint samples in ftgrid and
+       ftview to be based on darkened CFF outlines instead of unhinted,
+       undarkened ones.
+
+2013-09-29  Dave Arnold  <darnold@adobe.com>
+
+       Fix Savannah bug #39295.
+
+       The bug was caused by switching to the initial hintmap (the one in
+       effect when `moveto' executes) just before drawing the final element
+       in the charstring.  This ensured that the path was closed (in both
+       Character Space and Device Space).  But if the final element was a
+       curve and if the final hintmap was different enough from the initial
+       one, then the curve was visibly distorted.
+
+       The first part of the fix is to draw the final curve using the final
+       hintmap as specified by the charstring.  This corrects the
+       distortion but does not ensure closing in Device Space.  It may
+       require the rasterizer to automatically generate an extra closing
+       line.  Depending on the hintmap differences, this line could be from
+       zero to a couple pixels in length.
+
+       The second part of the fix covers the case where the charstring
+       subpath is closed with an explicit line.  We now modify that line's
+       end point to avoid the distortion.
+
+       Some glyphs in the bug report font (TexGyreHeros-Regular) that show
+       the change are:
+
+         25ppem    S (98)
+         24ppem    eight (52)
+         25.5ppem  p (85)
+
+       Curves at the *end* of a subpath are no longer distorted.  However,
+       some of these glyphs have bad hint substitutions in the middle of a
+       subpath, and these are not affected.
+
+       The patch has been tested with a set of 106 fonts that shipped with
+       Adobe Creative Suite 4, together with 756 Open Source CFF fonts from
+       Google Fonts.  There are 1.5 million glyphs, of which some 20k are
+       changed with the fix.  A sampling of a few hundred of these changes
+       have been examined more closely, and the changes look good (or at
+       least acceptable).
+
+       * src/cff/cf2hints.h (CF2_GlyphPathRec): New element `pathIsClosing'
+       to indicate that we synthesize a closepath line.
+
+       * src/cff/cf2hints.c (cf2_glyphpath_init): Updated.
+       (cf2_glyphpath_pushPrevElem): If closing, use first hint map (for
+       `lineto' operator) and adjust hint zone.
+       For synthesized closing lines, use end point in first hint zone.
+       (cf2_glyphpath_lineTo): Take care of synthesized closing lines.  In
+       particular, shift the detection of zero-length lines from character
+       space to device space.
+       (cf2_glyphpath_closeOpenPath): Remove assertion.
+       Updated.
+
+2013-09-25  Werner Lemberg  <wl@gnu.org>
+
+       * src/autofit/aflatin.c (af_{grek,cyrl}_uniranges): Fix arrays.
+
+2013-09-25  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [bdf, pcf] Refuse non-zero face_index.
+
+       Suggested by Akira Tagoh, see
+
+         http://lists.gnu.org/archive/html/freetype/2013-09/msg00030.html
+
+       * src/bdf/bdfdrivr.c (BDF_Face_Init): Return `Invalid_Argument'
+       error if the font could be opened but non-zero `face_index' is
+       given.
+       * src/pcf/pcfdrivr.c (PCF_Face_Init): Ditto.
+
+       * src/type42/t42objs.c (T42_Face_Init): Remove unrequired FT_UNUSED
+       macro for `face_index' because it is validated later.
+
+2013-09-23  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #40090.
+
+       * src/autofit/afcjk.c (af_cjk_metrics_scale): Revert commit
+       306f8c5d (from 2013-08-25) affecting this function.
+
+2013-09-22  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Disunify Cyrillic and Greek handling from Latin.
+
+       * src/autofit/afscript.h: Add Cyrillic and Greek.
+
+       * src/autofit/afblue.dat (AF_BLUE_STRINGSET_GREK,
+       AF_BLUE_STRINGSET_CYRL): Add blue zones for Greek and Cyrillic.
+       (AF_BLUE_STRINGSET_LATN): Fix typo.
+       * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
+
+       * src/autofit/aflatin.c (af_grek_uniranges, af_cyrl_uniranges): New
+       arrays.
+       (af_grek_script_class, af_cyrl_script_class): New scripts.
+       * src/autofit/aflatin.h: Updated.
+
+2013-09-20  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES: Updated.
+
+2013-09-20  Behdad Esfahbod  <behdad@behdad.org>
+
+       Fix vertical size of emboldened glyphs.
+
+       Cf. https://bugzilla.gnome.org/show_bug.cgi?id=686709
+
+       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Adjust `horiBearingY'
+       also.
+
+2013-09-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       * include/freetype/ftoutln.h: Correct FT_Outline_Get_Orientation
+       algorithm description.
+
+2013-09-11  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Improve Hebrew rendering.
+
+       This change introduces a new blue zone property
+       `AF_BLUE_PROPERTY_LATIN_LONG' to make the auto-hinter ignore short
+       top segments.
+
+       * src/autofit/afblue.dat: Fix Hebrew blue strings.
+       Use AF_BLUE_PROPERTY_LATIN_LONG for AF_BLUE_STRING_HEBREW_TOP.
+
+       * src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_LONG): New macro.
+
+       * src/autofit/afblue.c, src/autofit/afblue.h: Updated.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init_blues): Handle
+       `AF_LATIN_IS_LONG_BLUE'.
+
+       * src/autofit/aflatin.h (AF_LATIN_IS_LONG_BLUE): New macro.
+
+2013-08-28  Behdad Esfahbod  <behdad@google.com>
+
+       [sfnt] Fix frame access while reading WOFF table directory.
+
+       * src/sfnt/sfobjs.c (woff_open_font): Using single memory frame
+       while reading the directory entries for the whole loop.
+
+2013-08-29  Werner Lemberg  <wl@gnu.org>
+            Behdad Esfahbod  <behdad@google.com>
+
+       Implement support for WOFF containers.
+
+       We simply synthesize a SFNT from the WOFF, create a memory stream
+       for the new data, and load the SFNT as usual.
+
+       Does NOT add any API to access WOFF metadata or private blocks.
+
+       * include/freetype/internal/tttypes.h (WOFF_HeaderRec,
+       WOFF_TableRec): New structures.
+
+       * include/freetype/tttags.h (TTAG_wOFF): New macro.
+
+       * src/base/ftobjs.c (FT_Open_Face): Set `stream' after calling
+       `open_face'.
+
+       * src/sfnt/sfobjs.c [FT_CONFIG_OPTION_SYSTEM_ZLIB]: Include
+       `FT_GZIP_H'.
+       (WRITE_BYTE, WRITE_USHORT, WRITE_ULONG): New temporary macros for
+       writing to a stream.
+       (sfnt_stream_close, compare_offsets, woff_open_font): New functions.
+       (sfnt_open_font): Handle `TTAG_wOFF'.
+       (sfnt_init_face): Set `stream' after calling `sfnt_open_font'.
+
+       * src/truetype/ttobjs.c (tt_face_init): Set `stream' after calling
+       `sfnt->init_face'.
+
+       * src/base/ftobjs.c (open_face): Use a pointer to FT_Stream as an
+       argument so that a changed stream survives.
+       Update callers.
+
+2013-08-28  Werner Lemberg  <wl@gnu.org>
+
+       [gzip] New function `FT_Gzip_Uncompress'.
+
+       This is modeled after zlib's `uncompress' function.  We need this
+       for WOFF support.
+
+       * include/freetype/ftgzip.h, src/gzip/ftgzip.c (FT_Gzip_Uncompress):
+       New function.
+
+       * src/gzip/rules.mk: Rewrite to better reflect dependencies.
+
+2013-08-28  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Fix `make multi' compilation.
+
+       * src/autofit/afblue.cin, src/autofit/afblue.c: Don't include
+       `afblue.h' but `aftypes.h'.
+       * src/autofit/afcjk.c: Don't include `aftypes.h' but `afglobal.h'.
+
+2013-08-28  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Fix C++ compilation.
+
+       * src/autofit/afglobal.c (af_face_globals_get_metrics),
+       src/autofit/afdummy.c (af_dflt_script_class), src/autofit/afindic.c
+       (af_deva_script_class): Use proper casts.
+
+2013-08-27  Behdad Esfahbod  <behdad@google.com>
+
+       * src/sfnt/ttload.c (tt_face_load_font_dir): Fix sign typos.
+
+2013-08-27  Behdad Esfahbod  <behdad@google.com>
+
+       FT_Open_Face: Improve external stream handling.
+
+       If the font's `clazz->init_face' function wants to swap to new
+       stream, handling of whether original stream was external could
+       result to either memory leak or double free.  Mark externality into
+       face flags before calling `init_face' such that the clazz can handle
+       external streams properly.
+
+       * src/base/ftobjs.c (FT_Open_Face): Move code to set
+       FT_FACE_FLAG_EXTERNAL_STREAM to...
+       (open_face): This function.
+
+2013-08-27  Werner Lemberg  <wl@gnu.org>
+
+       Remove `FT_SqrtFixed' function.
+
+       It's no longer used.
+
+       * include/freetype/internal/ftcalc.h, src/base/ftcalc.c: Do it.
+
+2013-08-27  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] While tracing, report script names instead of ID values.
+
+       * src/autofit/afglobal.c (af_script_names) [FT_DEBUG_LEVEL_TRACE]:
+       New array.
+       * src/autofit/afglobal.h: Updated.
+
+       * src/autofit/afcjk.c (af_cjk_metrics_init_widths,
+       af_cjk_hint_edges): Use `af_script_names'.
+       * src/autofit/aflatin.c (af_latin_metrics_init_widths,
+       af_latin_hint_edges): Ditto.
+
+2013-08-26  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Report used script while hinting a glyph.
+
+       * src/autofit/afcjk.c (af_cjk_hint_edges), src/autofit/aflatin.c
+       (af_latin_hint_edges): Implement it.
+
+2013-08-26  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Add support for Hebrew script.
+
+       * src/autofit/afblue.dat: Add blue strings for Hebrew.
+       * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
+
+       * src/autofit/aflatin.c (af_hebr_uniranges): New array.
+       (af_hebr_script_class): New script.
+       * src/autofit/aflatin.h, src/autofit/afscript.h: Updated.
+
+2013-08-26  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Improve tracing messages.
+
+       * src/autofit/afcjk.c (af_cjk_metrics_init_widths): Mention script
+       ID in tracing message.
+       (af_cjk_metrics_init_blues): Initialize `axis' outside of the inner
+       loop.
+       Improve tracing messages.
+       (af_cjk_hint_edges) [FT_DEBUG_LEVEL_TRACE]: New variable
+       `num_actions' to count hinting actions.
+       Improve tracing messages.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init_widths): Mention
+       script ID in tracing message.
+       (af_latin_metrics_init_blues, af_latin_hint_edges): Improve tracing
+       messages.
+
+2013-08-26  Werner Lemberg  <wl@gnu.org>
+
+       Better tracing of loaded glyphs.
+
+       Previously, the loading of a glyph was traced at level 4, if at all.
+       With this change, all font loading routines emit a tracing message
+       at level 1, making it easier to select tracing output (for example
+       using F2_DEBUG="any:1 afhints:7 aflatin:7").
+
+       * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Add tracing message.
+       * src/cff/cffdrivr.c (cff_glyph_load): Ditto.
+       * src/cff/cffgload.c (cff_decoder_prepare): Improve tracing
+       messages.
+       * src/cid/cidgload.c (cid_load_glyph): Use level 1 for tracing
+       message.
+       * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Ditto.
+       * src/pfr/pfrobjs.c (pfr_slot_load): Add tracing message.
+       * src/truetype/ttgload.c (TT_Load_Glyph): Ditto.
+       * src/type1/t1gload.c (T1_Load_Glyph): Ditto.
+       * src/type42/t42objs.c (T42_GlyphSlot_Load): Ditto.
+       * src/winfonts/winfnt.c (FNT_Load_Glyph): Ditto.
+
+2013-08-26  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Fix script selection.
+
+       * src/autofit/afglobal.c (af_face_globals_get_metrics): Use
+       `AF_SCRIPT_DFLT', not value 0.
+       Simplify code.
+
+       * src/autofit/afscript.h: Sort by script name.
+
+2013-08-26  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Make `dummy' hinter work as expected.
+
+       * src/autofit/afdummy.c (af_dummy_hints_init): Properly set scaling
+       information.
+       (af_dummy_hints_apply): Scale the glyphs.
+
+2013-08-25  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Make `cjk' module use blue stringsets.
+
+       * src/autofit/afcjk.c (AF_CJK_MAX_TEST_CHARACTERS): Removed.
+       (af_cjk_hani_blue_chars): Removed.
+       (AF_CJK_BLUE_TYPE_*): Removed.
+       (af_cjk_metrics_init_blues): Replace AF_CJK_MAX_TEST_CHARACTERS with
+       AF_BLUE_STRING_MAX_LEN.
+       Change loops to use offsets (in file `afblue.h') into the new arrays
+       `af_blue_stringsets' and `af_blue_strings' (in file `afblue.c').
+       Instead of three dimensions (as used in the old blue string array)
+       we now use properties to do the same, saving one loop nesting level.
+
+       * src/autofit/afcjk.h: Remove old enumeration values superseded by
+       the new data in `afblue.h'.
+       (AF_CJK_IS_TOP_BLUE, AF_CJK_IS_HORIZ_BLUE, AF_CJK_IS_FILLED_BLUE,
+       AF_CJK_IS_RIGHT_BLUE): New macros, to be used in
+       `af_cjk_metrics_init_blues'.
+       (AF_CJK_BLUE_IS_RIGHT): Remove this now redundant enum value.
+       (AF_CJK_BLUE_IS_TOP): Renamed to...
+       (AF_CJK_BLUE_TOP): This.
+       (AF_CJK_MAX_BLUES): Remove.
+       (AF_CJKAxisRec): Updated.
+
+2013-08-25  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Typo.
+
+       * src/autofit/afblue.hin, src/autofit/afblue.c (GET_UTF8_CHAR): Use
+       cast.
+
+2013-08-25  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Synchronize `cjk' with `latin' module (and vice versa).
+
+       * src/autofit/afcjk.c (af_cjk_metrics_init_widths): Add tracing
+       messages.
+       (af_cjk_metrics_init_blues): Don't pass blue string array as
+       argument but use the global array directly.
+       Use `outline' directly.
+       Update and add tracing messages.
+       (af_cjk_metrics_init): Simplify code.
+       (af_cjk_metrics_scale_dim): Improve tracing message.
+       (af_cjk_metrics_scale): Synchronize.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init_widths,
+       af_latin_metrics_init_blues): Improve and add tracing messages.
+
+2013-08-25  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Make `latin' module use blue stringsets.
+
+       * src/autofit/aflatin.c (AF_LATIN_MAX_TEST_CHARACTERS): Removed.
+       (af_latin_blue_chars): Removed.
+       (af_latin_metrics_init_blues): Replace AF_LATIN_MAX_TEST_CHARACTERS
+       with AF_BLUE_STRING_MAX_LEN.
+       Change loops to use offsets (in file `afblue.h') into the new arrays
+       `af_blue_stringsets' and `af_blue_strings' (in file `afblue.c').
+       Use `AF_LATIN_IS_SMALL_TOP_BLUE' macro.
+
+       * src/autofit/aflatin.h: Remove old enumeration values superseded by
+       the new data in `afblue.h'.
+       (AF_LATIN_IS_TOP_BLUE): Updated definition.
+       (AF_LATIN_IS_SMALL_TOP_BLUE): New macro.
+       (AF_LATIN_MAX_BLUES): Remove.
+       (AF_LatinAxisRec): Updated.
+
+2013-08-25  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Add blue stringsets.
+
+       * src/autofit/aftypes.h: Include `afblue.h'.
+       (AF_ScriptClassRec): Add `blue_stringset' field.
+       (AF_DEFINE_SCRIPT_CLASS): Updated.
+
+       * src/autofit/autofit.c: Include `afblue.c'.
+
+       * src/autofit/afcjk.c (af_hani_script_class), src/autofit/afdummy.c
+       (af_dflt_script_class), src/autofit/afindic.c
+       (af_deva_script_class), src/autofit/aflatin.c
+       (af_latn_script_class), src/autofit/aflatin2.c
+       (af_ltn2_script_class): Updated.
+
+       * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afblue.c'.
+
+2013-08-25  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Introduce data file for blue strings.
+
+       The idea is to have a central file which gets processed by a Perl
+       script to create proper `.c' and `.h' files using templates.  There
+       are two other reasons to do that:
+
+         . The data file should be easily readable.  We use UTF-8 encoding
+           which then gets converted to single bytes.
+
+         . Since the number of supported scripts will increase soon, the
+           current usage of blue string arrays is a waste of space.  Using
+           the Perl script it is possible to imitate jagged arrays,
+           defining enumeration constants as offsets into the arrays.
+
+       This commit only adds files without changing any functionality.
+
+       * src/autofit/afblue.dat: New data file.
+       * src/tools/afblue.pl: New Perl script for processing `afblue.dat'.
+
+       * src/autofit/afblue.cin, src/autofit/afblue.hin: New template files
+       for...
+       * src/autofit/afblue.c, src/autofit/afblue.c: New source files.
+       To avoid a dependency on Perl, we add them too.
+
+2013-08-19  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Enable new algorithm for `BBox_Cubic_Check'.
+
+       * src/base/ftbbox.c: Enable new BBox_Cubic_Check algorithm, remove
+       the old one.
+       Improve comments.
+
+2013-08-18  Werner Lemberg  <wl@gnu.org>
+
+       * builds/unix/unix-def.in (freetype2.pc): Don't set executable bit.
+
+2013-08-18  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #39804.
+
+       * builds/unix/configure.raw (LIBPNG): Define and export.
+       * builds/unix/freetype-config.in, builds/unix/freetype2.in: Handle
+       libpng.
+
+2013-08-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Clean up BBox_Conic_Check.
+
+       * src/base/ftbbox.c (BBox_Conic_Check): Remove redundant checks for
+       extremum at the segment ends, which are already within the bbox.
+       Slightly modify calculations.
+
+2013-08-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Finish experimental (disabled) BBox_Cubic_Check implementation.
+
+       * src/base/ftbbox.c (BBox_Cubic_Check): Scale arguments to improve
+       accuracy and avoid overflows.
+
+2013-08-13  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Refactor experimental (disabled) BBox_Cubic_Check.
+
+       * src/base/ftbbox.c (BBox_Cubic_Check): Implement the minimum search
+       as the mirror image of the maximum search implemented here...
+       (update_max): New function.
+
+2013-08-06  John Tytgat  <John.Tytgat@esko.com>
+
+       Fix Savannah bug #39702.
+
+       * src/cff/cffload.c (cff_index_get_pointers): Check for `cur_offset
+       != 0'; this stronger test is mandated by the CFF specification.
+       Fix test for INDEX structures which have one or more empty entries
+       at the end.
+
+2013-08-05  Werner Lemberg  <wl@gnu.org>
+
+       Fix gcc pragmas, part 2.
+
+       * src/truetype/ttinterp.c (TT_MulFix14_long_long,
+       TT_DotFix14_long_long): `#pragma gcc diagnostic {push,pop}' has been
+       introduced with gcc version 4.6.
+
+2013-08-05  Werner Lemberg  <wl@gnu.org>
+
+       Fix gcc pragmas.
+
+       * src/truetype/ttinterp.c (TT_MulFix14_long_long,
+       TT_DotFix14_long_long): Older gcc versions don't accept diagnostic
+       pragmas within a function body.
+
+2013-08-05  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #39700.
+
+       * builds/unix/ftconfig.h: Synchronize with
+       `include/freetype/config/ftconfig.h'.
+
+       * builds/vms/ftconfig.h: Ditto.
+       Make the differences to the master `ftconfig.h' file as small as
+       possible for easier maintainance.
+
+2013-08-05  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Improve handling of `near' points.
+
+       Points which are very near to each other are now marked as such.
+       The `weak' flag is then computed by using the `in' vector of the
+       first and the `out' vector of the last point of a group of near
+       points.
+
+       For example, this fixes the rendering of glyph `Oslash' in
+       `Roboto-Thin.ttf'.
+
+       * src/autofit/afhints.h (AF_Flags): New value `AF_FLAGS_NEAR'.
+
+       * src/autofit/afhints.c (af_glyph_hints_reload): Introduce
+       the heuristic value `near_limit' to decide whether the current point
+       is near to the previous one, then set `AF_FLAG_NEAR' accordingly.
+       Store good `in' vector (of last non-near point) in
+       `last_good_in_{x,y}' and use it as an argument to
+       `ft_corner_is_flat' if necessary.
+
+2013-08-02  Werner Lemberg  <wl@gnu.org>
+
+       * include/freetype/ftcffdrv.h: Improve documentation.
+       This is based on blog entries from David Lemon and Dave Arnold (both
+       from Adobe) with kind permission.  Dave also helped in
+       proof-reading.
+
+2013-08-02  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Move declaration of scripts into separate file.
+
+       This has the benefit that we don't need to duplicate the data at
+       different places.
+
+       * src/autofit/afscript.h: New file.
+
+       * src/autofit/aftypes.h (AF_Script): Include `afscript.h' to define
+       the enumeration values.
+
+       * src/autofit/afglobal.c: Include `afscript.h' to get the script
+       specific header files.
+       (af_script_classes): Include `afscript.h' to fill this array.
+
+       * src/autofit/afpic.c: Include `afscript.h' to get the script
+       specific header files.
+       (autofit_module_class_pic_init): Include `afscript.h' for
+       initialization.
+       * src/autofit/afpic.h (AF_SCRIPT_CLASSES_COUNT,
+       AF_SCRIPT_CLASSES_REC_COUNT): Removed.  Use `AF_SCRIPT_MAX' instead.
+
+       * src/autofit/rules.mk (AUTOF_DRV_H): Updated.
+
+2013-08-02  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Move declaration of writing systems into separate file.
+
+       This has the benefit that we don't need to duplicate the data at
+       different places.
+
+       * src/autofit/afwrtsys.h: New file.
+
+       * src/autofit/aftypes.h (AF_WritingSystem): Include `afwrtsys.h' to
+       define the enumeration values.
+
+       * src/autofit/afglobal.c: Include `afwrtsys.h' to get the writing
+       system specific header files.
+       Include `afpic.h'.
+       (af_writing_system_classes): Include `afwrtsys.h' to fill this
+       array.
+
+       * src/autofit/afpic.c: Include `afwrtsys.h' to get the writing
+       system specific header files.
+       (autofit_module_class_pic_init): Include `afwrtsys.h' for
+       initialization.
+       * src/autofit/afpic.h (AF_WRITING_SYSTEM_CLASSES_COUNT,
+       AF_WRITING_SYSTEM_CLASSES_REC_COUNT): Removed.  Use
+       `AF_WRITING_SYSTEM_MAX' instead.
+
+2013-08-02  Werner Lemberg  <wl@gnu.org>
+
+       [sfnt] Fix compilation with g++.
+
+       * src/sfnt/pngshim.c (error_callback, read_data_from_FT_stream): Use
+       cast.
+       (Load_SBit_Png): Pacify compiler.
+
+2013-08-02  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+            Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Fix `make multi'.
+
+       * include/freetype/config/ftconfig.h (FT_LOCAL_ARRAY,
+       FT_LOCAL_ARRAY_DEF): New macros.
+
+       * src/autofit/afglobal.c (af_writing_system_classes,
+       af_script_classes): Use FT_LOCAL_ARRAY_DEF.
+       * src/autofit/afglobal.h: Declare `af_writing_system_classes' and
+       `af_script_classes'.
+       * src/autofit/afloader.c: Include `afpic.h'.
+
+2013-08-01  Werner Lemberg  <wl@gnu.org>
+
+       Another round of cppcheck nitpicks.
+
+       The call was (from the top-level of the FreeType tree):
+
+         cppcheck --force \
+                  --enable=all \
+                  -I /usr/include \
+                  -I /usr/local/include \
+                  -I /usr/lib/gcc/i586-suse-linux/4.7/include \
+                  -I include \
+                  -I include/freetype \
+                  -I include/freetype/config \
+                  -I include/freetype/internal \
+                  -DFT2_BUILD_LIBRARY \
+                  . &> cppcheck.log
+
+       using cppcheck git commit f7e93f99.
+
+       Note that cppcheck still can't handle `#include FOO' (with `FOO' a
+       macro).
+
+       */* Improve variable scopes.
+       */* Remove redundant initializations which get overwritten.
+
+       * src/gxvalid/*: Comment out redundant code or guard it with
+       FT_DEBUG_LEVEL_TRACE.
+
+2013-07-30  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Introduce `writing systems'.
+
+       This patch adds a new top level to the auto-hinter's script class
+       hierarchy.  It defines `writing systems' which can contain multiple
+       scripts.
+
+       For example, the `latin' writing system (in file `aflatin.c') is
+       able to support scripts like Latin, Cyrillic, Armenian, etc., which
+       can be handled similarly.
+
+       Scripts are now named using four-letter OpenType tags.
+
+       * src/autofit/aftypes.h (AF_ScriptClassRec): Move relevant members
+       to...
+       (AF_WritingSystemClassRec): This new structure.  It holds pointers
+       to functions which can be shared among related scripts.
+       (AF_WritingSystem): New enumeration.
+       (AF_Script): Revised values using four-letter tags.
+       (AF_DEFINE_WRITING_SYSTEM_CLASS): New macro.
+       (AF_DEFINE_SCRIPT_CLASS): Updated.
+
+       * src/autofit/afglobal.c (af_writing_system_classes): New global,
+       constant array.
+       (af_script_classes): Updated.
+       (af_face_globals_free): Updated.
+       Remove assertion.
+       (af_face_globals_get_metrics): Updated.
+
+       * src/autofit/afglobal.h (AF_SCRIPT_FALLBACK)
+       [!AF_CONFIG_OPTION_CJK]: Handle this case.
+
+       * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
+       Updated.
+
+       * src/autofit/afpic.c (autofit_module_class_pic_init): Updated;
+       initialize structures for both writing systems and scripts.
+       * src/autofit/afpic.h: Updated.
+       (AF_WRITING_SYSTEM_CLASSES_GET): New macro.
+
+       * src/autofit/afcjk.c (af_cjk_writing_system_class): New writing
+       system.
+       (af_cjk_uniranges): Renamed to...
+       (af_hani_uniranges): This.
+       (af_cjk_script_class): Reduced and renamed to...
+       (af_hani_script_class): This.
+       * src/autofit/afcjk.h: Updated.
+
+       * src/autofit/afdummy.c (af_dummy_writing_system_class): New writing
+       system.
+       (af_dummy_script_class): Reduced and renamed to...
+       (af_dflt_script_class): This.
+       * src/autofit/afdummy.h: Updated.
+
+       * src/autofit/afindic.c (af_indic_writing_system_class): New writing
+       system.
+       (af_indic_uniranges): Renamed to...
+       (af_deva_uniranges): This.
+       (af_indic_script_class): Reduced and renamed to...
+       (af_deva_script_class): This.
+       * src/autofit/afcjk.h: Updated.
+
+       * src/autofit/aflatin.c (af_latin_writing_system_class): New writing
+       system.
+       (af_latin_uniranges): Renamed to...
+       (af_latn_uniranges): This.
+       (af_latin_script_class): Reduced and renamed to...
+       (af_latn_script_class): This.
+       * src/autofit/aflatin.h: Updated.
+
+       * src/autofit/aflatin2.c (af_latin2_writing_system_class): New
+       writing system.
+       (af_latin2_uniranges): Renamed to...
+       (af_ltn2_uniranges): This.
+       Synchronize ranges with `latin'.
+       (af_latin2_script_class): Reduced and renamed to...
+       (af_ltn2_script_class): This.
+       * src/autofit/aflatin2.h: Updated.
+
+2013-07-30  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Variable renaming.
+
+       * src/autofit/aftypes.h (AF_ScriptMetricsRec):
+       s/clazz/script_class/.
+       Update all users.
+
+2013-07-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Ignore libpng-config under cross-building configuration,
+       because it will return the flags for the hosting environment.
+
+       * builds/unix/configure.raw: Ignore libpng-config when
+       `cross_compiling' == yes.
+
+2013-07-30  Behdad Esfahbod  <behdad@google.com>
+
+       Prevent division by zero by a transparent color.
+
+       * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra):
+       Return 0 immediately, when alpha channel is zero.
+
+2013-07-25  Behdad Esfahbod  <behdad@google.com>
+
+       Add FT_FACE_FLAG_COLOR and FT_HAS_COLOR.
+
+       Also disambiguate Google's color bitmap tables.
+
+       * include/freetype/freetype.h (FT_FACE_FLAG_COLOR, FT_HAS_COLOR):
+       New macros.
+
+       * include/freetype/internal/tttypes.h (TT_SbitTableType): Add
+       TT_SBIT_TABLE_TYPE_CBLC.
+
+       * src/sfnt/sfobjs.c (sfnt_load_face): Handle FT_FACE_FLAG_COLOR.
+
+       * src/sfnt/ttsbit.c (tt_face_load_sbit,
+       tt_face_load_strike_metrics, tt_face_load_sbit_image): Handle
+       TT_SBIT_TABLE_TYPE_CBLC.
+
+2013-07-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [sfnt] Fix for `make multi' target.
+
+       * src/sfnt/pngshim.c (Load_SBit_Png): Use FT_LOCAL_DEF().
+
+2013-07-20  Werner Lemberg  <wl@gnu.org>
+
+       * docs/INSTALL.GNU: Updated.
+
+2013-07-20  Behdad Esfahbod  <behdad@google.com>
+
+       [sfnt] Fix `sbix' table version handling.
+
+       * src/sfnt/ttsbit.c (tt_face_load_sbit) [TT_SBIT_TABLE_TYPE_SBIX]:
+       USHORT version numbers are to be considered as `minor'.
+
+2013-07-19  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Fix segment classification for blue zones.
+
+       The old code (essentially unchanged since the very beginning)
+       incorrectly handled this configuration
+
+                      x -o- x
+                       /   \
+                      /     \
+                     /       \
+                    o         o
+
+       as flat and this
+
+                       o               o
+                      /               /
+                    x|              x|
+                     |               |
+                     o---------------o
+
+       as round.  (`o' and `x' are on and off points, respectively).
+
+       This is a major change which should improve the rendering results
+       enormously for many TrueType fonts, especially in the range approx.
+       20-40ppem, fixing the appearance of many overshoots.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init_blues): Look at the
+       first and last points of the segment, not the points right before
+       and after.
+
+2013-07-19  Behdad Esfahbod  <behdad@google.com>
+
+       [sfnt] `sbix' fix-ups.
+
+       * src/sfnt/sfobjs.c (sfnt_load_face): Apple's `sbix' color bitmaps
+       are rendered scaled and then the `glyf' outline rendered on top.  We
+       don't support that yet, so just ignore the `glyf' outline and
+       advertise it as a bitmap-only font.
+
+       * src/sfnt/ttsbit.c (tt_face_load_strike_metrics)
+       [TT_SBIT_TABLE_TYPE_SBIX]: Return metrics in 26.6 units.
+       (tt_face_load_sbix_image): Typo.
+
+2013-07-18  Behdad Esfahbod  <behdad@google.com>
+
+       [sfnt] Add support for Apple's `sbix' color bitmap table.
+
+       * include/freetype/internal/tttypes.h (TT_SBit_MetricsRec): Widen
+       fields to FT_Short and FT_UShort, respectively.
+       (TT_SBitTableType): New enumeration.
+       (TT_FaceRec): Add `sbit_table_type' field.
+
+       * include/freetype/tttags.h (TTAG_sbix): New macro.
+
+       * src/sfnt/pngshim.c (Load_SBit_Png): Pass a more generic
+       FT_GlyphSlot argument instead FT_Bitmap.
+       Add flag to control map and metrics handling.
+       Update all users.
+
+       * src/sfnt/ttsbit.c: Include `ttmtx.h'.
+       (tt_face_load_eblc): Renamed to...
+       (tt_face_load_sbit): This.
+       Handlic `sbix' bitmaps.
+       (tt_face_free_eblc): Renamed to...
+       (tt_face_load_sbit): This.
+       Updated.
+       (tt_face_load_strike_metrics): Handle `sbix' bitmaps.
+       (tt_face_load_sbix_image): New function.
+       (tt_sbit_decoder_alloc_bitmap, tt_sbit_decoder_load_image,
+       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, tt_sbit_decoder_load_bitmap): Don't pass
+       and handle load flags.
+       (tt_sbit_decoder_load_bitmap) [!FT_CONFIG_OPTION_USE_PNG]: Better
+       handle formats 17-19.
+       Move color to grayscale conversion to...
+       (tt_face_load_sbit_image): Here.
+       Handle `sbix' bitmaps.
+
+       * src/sfnt/pngshim.h: Updated.
+       * src/sfnt/ttsbit.h: Updated.
+       * src/sfnt/sfdriver.c: Updated.
+
+2013-07-18  Werner Lemberg  <wl@gnu.org>
+
+       [sfnt] Ignore invalid magic number in `head' or `bhed'.
+
+       Other font engines seem to ignore it also.  Problem reported by
+       Hin-Tak Leung <htl10@users.sourceforge.net>.
+
+       * src/sfnt/ttload.c (check_table_dir): Don't abort but warn only if
+       we have an invalid magic number.
+
+2013-07-16  Werner Lemberg  <wl@gnu.org>
 
-2010-04-14  Ken Sharp  <ken.sharp@artifex.com>
+       [smooth] Fix segfault caused by previous commit.
 
-       Fix Savannah bug #29444.
+       * src/smooth/ftgrays.c (gray_set_cell): Always compute
+       `ras.invalid'.
 
-       * src/psaux/psobjs.c (t1_builder_start_point): Accept (invalid)
-       `lineto' immediately after `hsbw', in accordance with Acrobat, GS,
-       and others.
+2013-07-16  David Turner  <digit@google.com>
 
-2010-04-14  Michał Cichoń  <thedmd@artifexmundi.com>
+       [smooth] Improve performance.
 
-       Fix Savannah bug #27999.
+       Provide a work-around for an ARM-specific performance bug in GCC.
+       This speeds up the rasterizer by more than 5%.
 
-       * src/cache/ftcmanag.c (FTC_Manager_RemoveFaceID): Only remove
-       selected entry, not all.
+       Also slightly optimize `set_gray_cell' and `gray_record_cell' (which
+       also improves performance on other platforms by a tiny bit (<1%).
 
-2010-04-06  Jonathan Kew  <jfkthame@gmail.com>
+       * src/smooth/ftgrays.c (FT_DIV_MOD): New macro.
+       Use it where appropriate.
 
-       Add overflow check to `fvar' table.
+       (gray_record_cell, gray_set_cell, gray_move_to,
+       gray_convert_glyph_inner): Streamline condition handling.
 
-       * src/truetype/ttgxvar.c (TT_Get_MM_Var): Check axis and instance
-       count.
+2013-07-16  David Turner  <digit@google.com>
 
-2010-04-05  Ken Sharp  <ken.sharp@artifex.com>
+       [truetype] Add assembler code for TT_MulFix14 and TT_DotFix14.
 
-       Fix Savannah bug #29335.
+       This patch provides slightly optimized versions for ARM, x86, and
+       x86_64 CPUs if built with GCC.
 
-       * src/raster/ftraster.c (Line_Up): Use slow multiplication to
-       prevent overflow.  This shouldn't have any serious impact on speed,
-       however.
+       Also remove some dead code.
 
-2010-04-05  Werner Lemberg  <wl@gnu.org>
+       * src/truetype/ttinterp.c (TT_MulFix14_arm, TT_MulFix14_long_long,
+       TT_DotFix14_long_long): New functions.
 
-       Add new function `FT_Library_SetLcdFilterWeights'.
+2013-07-16  David Turner  <digit@google.com>
 
-       This is based on code written by Lifter
-       <http://unixforum.org/index.php?showuser=11691>.  It fixes
-       FreeDesktop bug #27386.
+       Optimize FT_MulFix for x86_64 GCC builds.
 
-       * src/base/ftlcdfil.c (FT_Library_SetLcdFilterWeights): New
-       function.
+       This patch provides an optimized `FT_MulFix' implementation for
+       x86_64 machines when FreeType is built with GCC, or compatible
+       compilers like Clang.
+
+       Example:
+         bin/ftbench -p -t 5 -s 14 -f 0008 Arial.ttf
+
+       Before:
+
+         Load                       4.863 us/op
+         Load_Advances (Normal)     4.816 us/op
+         Load_Advances (Fast)       0.028 us/op
+         Render                     2.753 us/op
+         Get_Glyph                  0.463 us/op
+         Get_CBox                   0.077 us/op
+         Get_Char_Index             0.023 us/op
+         Iterate CMap              13.898 us/op
+         New_Face                  12.368 us/op
+         Embolden                   0.028 us/op
+         Get_BBox                   0.302 us/op
+
+       After:
+
+         Load                       4.617 us/op
+         Load_Advances (Normal)     4.645 us/op
+         Load_Advances (Fast)       0.027 us/op
+         Render                     2.789 us/op
+         Get_Glyph                  0.460 us/op
+         Get_CBox                   0.077 us/op
+         Get_Char_Index             0.024 us/op
+         Iterate CMap              13.403 us/op
+         New_Face                  12.278 us/op
+         Embolden                   0.028 us/op
+         Get_BBox                   0.301 us/op
+
+       * builds/unix/ftconfig.in, include/freetype/config/ftconfig.h
+       (FT_MulFix_x86_64): New function.
+
+2013-07-16  David Turner  <digit@google.com>
+
+       Speed up ARMv7 support.
+
+       When building for ARMv7 with thumb2 instructions, the optimized
+       `FT_MulFix_arm' assembly routine was not being used.
+
+       The reason for this is in the `ftconfig.h' header, namely:
+
+       - The assembly routine uses the `smull' instruction which is not
+         available when generating Thumb-1 machine code.  It is available
+         in Thumb-2 mode, though.
+
+       - The header was written a long time ago before Thumb-2 became
+         widely popular (e.g. with Android).  So it simply doesn't use the
+         assembly routine if the `__thumb__' built-in macro is defined.
+
+       - When compiling in Thumb-2 mode, the compiler will define both
+         `__thumb__' and `__thumb2__'.
+
+       By checking for `(__thumb2__ || !__thumb__)', we ensure that the
+       assembly routine is only avoided when generating Thumb-1 code.
 
-       * include/freetype/ftlcdfil.h: Updated.
+       Given that this is performance-sensitive function, this improves
+       `ftbench' as follows on a Galaxy Nexus:
+
+                                  Before (us/op)   After (us/op)
+
+         - loading Arial.ttf glyphs at 14 ppem [1]
+
+             Load                   34.285          33.098
+
+         - same operation with the light auto-hinter [2]
+
+             Load                   31.317          29.590
+
+         - same operation without hinting [3]
+
+             Load                    6.143           5.376
+
+         - loading Arial.ttf advances at 14 ppem [4]
+
+             Load_Advances (normal) 34.216          33.016
+             Load_Advances (fast)    0.176           0.176
+
+         [1] ftbench -t 5 -p -s 14 -b a -f 0008 Arial.ttf
+         [2] ftbench -t 5 -p -s 14 -b a -r 1 -f 0028 Arial.ttf
+         [3] ftbench -t 5 -p -s 14 -b a -f 000a Arial.ttf
+         [4] ftbench -t 5 -p -s 14 -b b -f 0008 Arial.ttf
+
+       * builds/unix/ftconfig.in, include/freetype/config/ftconfig.h
+       (FT_MULFIX_ASSEMBLER): Fix handling for ARMv7.
+
+2013-06-28  Werner Lemberg  <wl@gnu.org>
 
        * docs/CHANGES: Updated.
 
-2010-04-01  John Tytgat  <John.Tytgat@esko.com>
+2013-06-27  Werner Lemberg  <wl@gnu.org>
+
+       * src/winfonts/winfnt.c (FNT_Load_Glyph): Fix bitmap width guard.
+
+2013-06-25  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Add darkening limit to `darkening-parameters'.
+
+       * src/cff/cffdrivr.c (cff_property_set): Add check.
+
+2013-06-25  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Add `darkening-parameters' property.
+
+       * include/freetype/ftcffdrv.h: Document it.
+
+       * src/cff/cffdrivr.c (cff_property_set, cff_property_get): Handle
+       `darkening-parameters' property.
+
+       * src/cff/cf2font.h (CF2_FontRec): Add `darkenParams' array.
+
+       * src/cff/cf2font.c (cf2_computeDarkening): Add `darkenParams'
+       argument and use it.
+       Update all callers.
+
+       * src/cff/cf2ft.c (cf2_decoder_parse_charstrings): Copy
+       `darken_params' values.
+
+       * src/cff/cffobjs.h (CFF_DriverRec): Add `darken_params' array.
+
+       * src/cff/cffobjs.c (cff_driver_init): Set default values for
+       `darken_params'.
+
+2013-06-25  Werner Lemberg  <wl@gnu.org>
+
+       [docmaker] Code shuffling.
+
+       * src/tools/docmaker/tohtml.py (re_url): Move regexp...
+       * src/tools/docmaker/sources.py: ... to this file.
+
+2013-06-25  Werner Lemberg  <wl@gnu.org>
+
+       [docmaker] Remove unused functions.
+
+       * src/tools/docmaker/content.py (DocMarkup.get_start,
+       DocBlock.get_markup_name): Removed.
+       * src/tools/docmaker/tohtml.py (html_quote0, dump_html_code,
+       HtmlFormatter.make_html_words): Removed.
+
+2013-06-25  Werner Lemberg  <wl@gnu.org>
+
+       * builds/freetype.mk (dll): Remove target.
+
+       Problem reported by Jörg Günnewig <joerg.guennewig@googlemail.com>.
+
+2013-06-25  Werner Lemberg  <wl@gnu.org>
+
+       [docmaker] Recognise URLs.
+
+       * src/tools/docmaker/tohtml.py (re_url): New regular expression.
+       (make_html_para): Use it.
+
+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>
 
-       Fix Savannah bug #29404.
+       [cff] s/cf2_getGlyphWidth/cf2_getGlyphOutline/.
 
-       * src/truetype/ttgload.c: Revert change 2752bd1a (check on bit 1
-       of `head' table of TrueType fonts).
+       * src/cff/cf2font.c, src/cff/cf2font.h, src/cff/cf2ft.c: Do it.
 
-2010-03-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+2013-06-06  Dave Arnold  <darnold@adobe.com>
 
-       Fix `multi build' for Tytgat's CFF driver improvement.
+       [cff] Add early exit feature for width-only calls.
 
-       * src/base/cffload.h (cff_index_get_name): Added.
+       This is for `FT_Get_Advance'.
 
-2010-03-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+       There are 7 places where the spec says the width can be defined:
 
-       Remove duplicated inclusion of `FT_OUTLINE_H' in ftobjs.c.
+         hstem/hstemhm
+         vstem/vstemhm
+         cntrmask/hintmask
+         hmoveto
+         vmoveto
+         rmoveto
+         endchar
 
-       * src/base/ftobjs.c: Remove 2nd inclusion of `FT_OUTLINE_H'.
+       * src/cff/cf2intrp.c (cf2_doStems): Exit early for width-only calls,
+       if possible.
 
-2010-03-11  Chris Liddell  <chris.liddell@artifex.com>
+       (cf2_interpT2CharString) <cf2_cmdHSTEM>, <cf2_cmdVSTEM>,
+       <cf2_cmdVMOVETO>, <cf2_cmdENDCHAR>, <cf2_cmdHINTMASK>,
+       <cf2_cmdRMOVETO>, <cf2_cmdHMOVETO>: Exit early for width-only calls.
 
-       Fix Savannah bug #27442.
+2013-06-06  Werner Lemberg  <wl@gnu.org>
 
-       * src/raster/ftraster.c (ft_black_reset): Fix `buffer_size'.
+       Next round of compiler fixes.
 
-2010-03-09  Werner Lemberg  <wl@gnu.org>
+       * 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.
-       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.
-
-       We do this by avoiding memory allocation and file I/O.  This is
-       Savannah patch #7104.
-
-       * src/cff/cfftypes.h: Include PS cmaps service and
-       FT_INTERNAL_POSTSCRIPT_HINTS_H.
-       (CFF_SubFontRec): Remove `num_local_subrs'.
-       (CFF_FontRec): Add `num_strings', `strings', and `string_pool'
-       fields.
-       Remove `string_index' and `num_global_subrs' fields.
-       Use real types instead of `void' for `pshinter' and `psnames' fields.
-
-       * src/cff/cffload.c: Don't include PS cmaps service.
-       (cff_index_get_pointers): Add `pool' parameter which allows to
-       insert an extra NUL character for each String INDEX entry.
-       (cff_index_get_name): Make it a local function.
-       (cff_index_get_string): New function.
-       (cff_subfont_load): Updated.
-       (cff_font_load): Initialize `num_strings', `strings', and
-       `string_pool' fields in the `CFF_FontRec' structure.
-       (cff_index_get_sid_string): Use `cff_index_get_string' instead of
-       `cff_index_get_name'.
-       (cff_font_done): Updated.
-
-       * src/cff/cffload.h: Don't include PS cmaps service.
-       (cff_index_get_string): Added.
-       (cff_index_get_sid_string): Updated.
-
-       * src/cff/cffobjs.c: Don't include PS cmaps service and
-       FT_INTERNAL_POSTSCRIPT_HINTS_H.
-       (cff_size_get_globals_funcs, cff_slot_init): Updated.
-       (cff_face_init): Follow `cff_index_get_name',
-       `cff_index_get_string', and `cff_index_get_sid_string' changes.
-
-       * src/cff/cffcmap.c (cff_sid_free_glyph_name): Removed.
-       (cff_sid_to_glyph_name): Use `cff_index_get_cid_string'.
-       (cff_cmap_unicode_init): Updated.
-
-       * src/cff/cffdrivr.c: Don't include PS cmap service.
-       (cff_get_glyph_name): Avoid unnecessary lookup for POSTSCRIPT_CMAPS
-       service.
-       (cff_get_glyph_name, cff_ps_get_font_info, cff_get_ros): Follow API
-       `cff_index_get_sid_string' change.
-       (cff_get_name_index): Use `cff_index_get_string' instead of
-       `cff_index_get_name'.
-
-       * src/cff/cffgload.c: Don't include FT_INTERNAL_POSTSCRIPT_HINTS_H.
-       (cff_decoder_init, cff_decoder_prepare): Updated.
-
-2010-02-27  Werner Lemberg  <wl@gnu.org>
 
-       Simplify code.
-       Suggested by Behdad.
+       * src/base/ftdbgmem.c (ft_mem_table_destroy): `table' can't be zero.
 
-       * src/base/ftobjs.c (FT_Get_First_Char): Don't use a loop since we
-       call FT_Get_Next_Char anyway if necessary.
+       * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt1_entry_validate):
+       Remove functionless code.
 
-2010-02-26  Behdad Esfahbod  <behdad@behdad.org>
+       * src/tools/ftrandom.c (main): Fix memory leak.
 
-       Improve handling of invalid glyph indices in char->index functions.
+2013-06-03  Werner Lemberg  <wl@gnu.org>
 
-       * src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Use a
-       loop.
+       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.
 
-2010-02-18  Chris Liddell  <chris.liddell@artifex.com>
+       * builds/unix/configure.raw: Don't use LIBPNG_LIBS but
+       LIBPNG_LDFLAGS.
 
-       Fix Savannah bug #28905.
+2013-05-23  Behdad Esfahbod  <behdad@google.com>
 
-       Initialize phantom points before calling the incremental interface
-       to update glyph metrics.
+       Add support for color embedded bitmaps (eg. color emoji).
 
-       * src/truetype/ttgload.c (tt_get_metrics_incr_overrides)
-       [FT_CONFIG_OPTION_INCREMENTAL]: New function, split off from...
-       (tt_get_metrics): This.
+       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.
-       (load_truetype_glyph): Use tt_get_metrics_incr_overrides.
+       (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.
 
 ----------------------------------------------------------------------------
 
-Copyright 2010-2012 by
+Copyright 2013-2014 by
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 This file is part of the FreeType project, and may only be used, modified,
index d6371d1..300a094 100644 (file)
        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.
+       * include/freetype/ftbdf.h (BDF_PropertyType): New enumeration.
        (BDF_Property, BDF_PropertyRec): New structure.
        FT_Get_BDF_Property): New function.
        * include/freetype/internal/bdftypes.h: Include FT_BDF_H.
index bc46c84..1a23848 100644 (file)
 
 2007-01-10  Derek Clegg  <dclegg@apple.com>
 
-       * src/type1/t1load.c (T1_Get_MM_Var): Always return fixed point
+       * src/type1/t1load.c (T1_Get_MM_Var): Always return fixed-point
        values.
 
 2007-01-08  David Turner  <david@freetype.org>
diff --git a/ChangeLog.24 b/ChangeLog.24
new file mode 100644 (file)
index 0000000..01eb3b7
--- /dev/null
@@ -0,0 +1,6360 @@
+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.
+       =========================
+
+
+       Tag sources with `VER-2-4-4'.
+
+       * docs/CHANGES: Updated.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.4.4
+
+       * 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.4.3/2.4.4/, s/243/244/.
+
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.
+
+       * builds/unix/configure.raw (version_info): Set to 12:2:6.
+
+2010-11-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [ftsmooth]: Minor code simplification.
+
+       * src/smooth/ftgrays (gray_render_cubic): Do only one comparison
+       instead of two.
+
+2010-11-26  Johnson Y. Yan  <yinsen_yan@foxitsoftware.com>
+
+       [truetype] Better multi-threading support.
+
+       * src/truetype/ttinterp.c (TT_Load_Context): Reset glyph zone
+       references.
+
+2010-11-23  John Tytgat  <John.Tytgat@esko.com>
+
+       * src/psaux/t1decode.c (t1_decoder_parse_charstring): Expand
+       start_point, check_points, add_point, add_point1, close_contour
+       macros.
+       Remove add_contour macro.
+       Return error code from t1_builder_start_point and
+       t1_builder_check_points when there was one (instead of returning 0).
+
+2010-11-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [truetype] Identify the tricky fonts by cvt/fpgm/prep checksums.
+       Some Latin TrueType fonts are still expected to be unhinted.
+       Fix Savannah bug #31645.
+
+       * src/truetype/ttobjs.c (tt_check_trickyness): Divided to...
+       (tt_check_trickyness_family): this checking family name, and
+       (tt_check_trickyness_sfnt_ids): this checking cvt/fpgm/prep.
+       (tt_get_sfnt_checksum): Function to retrieve the sfnt checksum
+       for specified subtable even if cleared by lazy PDF generators.
+       (tt_synth_sfnt_checksum): Function to calculate the checksum.
+
+2010-11-18  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix `loca' handling for inconsistent number of glyphs.
+       Reported by Johnson Y. Yan <yinsen_yan@foxitsoftware.com>.
+
+       * src/truetype/ttpload.c (tt_face_load_loca): While sanitizing,
+       handle case where `loca' is the last table in the font.
+
+2010-11-18  Werner Lemberg  <wl@gnu.org>
+
+       [sfnt] Ignore all errors while loading `OS/2' table.
+       Suggested by Johnson Y. Yan <yinsen_yan@foxitsoftware.com>.
+
+       * src/sfnt/sfobjs.c (sfnt_load_face): Do it.
+
+2010-11-18  Johnson Y. Yan  <yinsen_yan@foxitsoftware.com>
+
+       [type1] Fix matrix normalization.
+
+       * src/type1/t1load.c (parse_font_matrix): Handle sign of scaling
+       factor.
+
+2010-11-18  Werner Lemberg  <wl@gnu.org>
+
+       [type1] Improve guard against malformed data.
+       Based on a patch submitted by Johnson Y. Yan
+       <yinsen_yan@foxitsoftware.com>
+
+       * src/type1/t1load.c (read_binary_data): Check `size'.
+
+2010-11-17  Werner Lemberg  <wl@gnu.org>
+
+       [sfnt] While tracing, output table checksums also.
+
+       * src/sfnt/ttload.c (tt_face_load_font_dir): Do it.
+
+2010-11-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [UVS] Fix `find_variant_selector_charmap', Savannah bug #31545.
+
+       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.
+
+       * src/base/ftobjs.c (Fix find_variant_selector_charmap):
+       Returns UVS cmap correctly.
+
+2010-11-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [ftsmooth] Improve rendering.
+
+       * src/smooth/ftsmooth.c (gray_render_conic): Since version 2.4.3,
+       cubic deviations have been estimated _after_ UPSCALE, whereas
+       conic ones have been evaluated _before_ UPSCALE, which produces
+       inferior rendering results.  Fix this.
+       Partially undo change from 2010-10-15 by using ONE_PIXEL/4; this has
+       been tested with demo images sent to the mailing list.  See
+
+         http://lists.gnu.org/archive/html/freetype-devel/2010-10/msg00055.html
+
+       and later mails in this thread.
+
+2010-10-28  Werner Lemberg  <wl@gnu.org>
+
+       [ftraster] Minor fixes.
+
+       Reported by Tom Bishop <wenlin@wenlin.com>.
+
+       * src/raster/ftraster.c (ULong): Remove unused typedef.
+       (TWorker): Remove unused variable `precision_mask'.
+
+2010-10-28  Werner Lemberg  <wl@gnu.org>
+
+       [ftraster] Fix rendering.
+
+       Problem reported by Tom Bishop <wenlin@wenlin.com>; see
+       thread starting with
+
+         http://lists.gnu.org/archive/html/freetype/2010-10/msg00049.html
+
+       * src/raster/ftraster.c (Line_Up): Replace FMulDiv with SMulDiv
+       since the involved multiplication exceeds 32 bits.
+
+2010-10-25  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       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)
+       to original FT_UFast, to match with FT_CacheRec.
+
+2010-10-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [cache] Change the hash types to FT_PtrDist.
+
+       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
+       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
+       ILP32 and LP64 are not changed.  The hash value in
+       the cache subsystem is not reverted to the memory
+       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'.
+       * src/cache/ftccmap.c (FTC_CMAP_HASH): Ditto.
+
+       * src/cache/ftccache.h (FTC_NodeRec): The type of the
+       member `hash' is changed from FT_UInt32 to FT_PtrDist.
+
+       * src/cache/ftccache.h (FTC_Cache_Lookup): The type of the
+       argument `hash' is changed from FT_UInt32 to FT_PtrDist.
+       (FTC_Cache_NewNode): Ditto.
+       * src/cache/ftccache.c (ftc_cache_add): Ditto.
+       (FTC_Cache_Lookup): Ditto.  (FTC_Cache_NewNode): Ditto.
+       * src/cache/ftcglyph.h (FTC_GCache_Lookup): Ditto.
+       * src/cache/ftcglyph.c (FTC_GCache_Lookup): Ditto.
+
+       * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): The type
+       of the internal variable `hash' is changed to FT_PtrDist
+       from FT_UInt32.  (FTC_ImageCache_LookupScaler): Ditto.
+       (FTC_SBitCache_Lookup): Ditto.
+       (FTC_SBitCache_LookupScaler): Ditto.
+       * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto.
+       * 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.
+
+       `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.
+
+       For the history of these macros, see the investigation:
+       http://lists.gnu.org/archive/html/freetype/2010-10/msg00022.html
+
+2010-10-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Change the type of `FT_MEM_VAL' from FT_ULong to FT_PtrDist.
+
+       On LLP64 platforms (e.g. Win64), unsigned long (32-bit)
+       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.
+
+       * src/base/ftdbgmem.c (FT_MEM_VAL): Change the type of the
+       return value from FT_ULong to FT_PtrDist.
+       (ft_mem_table_resize): The type of hash is changed to
+       FT_PtrDist.  (ft_mem_table_get_nodep): Ditto.
+
+2010-10-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Replace "%lx" for memory address by "%p", LLP64 platforms.
+
+       On LLP64 platforms (e.g. Win64), long (32-bit) cannot cover
+       the memory address (64-bit).  Also the casts from the pointer
+       type to long int should be removed to preserve the address
+       correctly.
+
+       * src/raster/ftraster.c (New_Profile): Replace "%lx" by "%p".
+       (End_Profile) Ditto.
+       * src/truetype/ttinterp.c (Init_Context): Ditto.
+
+2010-10-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       Fix thinko in spline flattening.
+
+       FT_MAX_CURVE_DEVIATION is dependent on the value of ONE_PIXEL.
+
+       * src/smooth/ftgrays.c (FT_MAX_CURVE_DEVIATION): Remove it and
+       replace it everywhere with ONE_PIXEL/8.
+
+2010-10-13  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [raccess] Skip unrequired resource access rules by Darwin VFS.
+
+       When a resource fork access rule by Darwin VFS could open the
+       resource fork but no font is found in it, the rest of rules
+       by Darwin VFS are skipped.  It reduces the warnings of the
+       deprecated resource fork access method by recent Darwin kernel.
+       Fix MacPorts ticket #18859:
+               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,
+       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.
+       If it is TRUE, the Darwin VFS rules are skipped.
+
+2010-10-13  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [raccess] Grouping resource access rules based on Darwin VFS.
+
+       MacOS X/Darwin kernel supports a few tricky methods to access
+       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.
+       To determine whether the rule index is for Darwin VFS, a local
+       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.
+
+       * src/base/ftrfork.c (FT_RFork_Rule): New enum type to identify
+       the rules to access the resource fork.
+       (raccess_guess_rec): New structure to bind the rule function and
+       rule enum type.
+       (FT_Raccess_Guess): The list of the rule functions is replaced by
+       (raccess_guess_table): This.  This is exposed to be used by other
+       intra module functions.
+       (raccess_rule_by_darwin_vfs): A function to return a boolean
+       if the rule specified by the rule index is based on Darwin VFS.
+
+2010-10-13  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Prevent to open a FT_Stream for zero-sized file on non-Unix.
+
+       builds/unix/ftsystem.c prevents to open an useless stream from
+       zero-sized file and returns FT_Err_Cannot_Open_Stream, but the
+       stream drivers for ANSI C, Amiga and VMS return useless streams.
+       For cross-platform consistency, all stream drivers should act
+       same.
+
+       * src/base/ftsystem.c (FT_Stream_Open): If the size of the opened
+       file is zero, FT_Err_Cannot_Open_Stream is returned.
+       * builds/amiga/src/base/ftsystem.c (FT_Stream_Open): Ditto.
+       * src/vms/ftsystem.c (FT_Stream_Open): Ditto.
+
+2010-10-12  Werner Lemberg  <wl@gnu.org>
+
+       [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>
+
+       [sfnt] Fix Savannah bug #31275.
+
+       * src/sfnt/ttpost.c: Include FT_INTERNAL_DEBUG_H.
+
+2010-10-06  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Improve error handling of `SHZ' bytecode instruction.
+       Problem reported by Chris Evans <scarybeasts@gmail.com>.
+
+       * src/truetype/ttinterp.c (Ins_SHZ): Check `last_point'.
+
+2010-10-05  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #31253.
+       Patch submitted by an anonymous reporter.
+
+       * configure: Use `awk' instead of `sed' to manipulate output of `ls
+       -id'.
+
+2010-10-03  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.4.3 released.
+       =========================
+
+
+       Tag sources with `VER-2-4-3'.
+
+       * docs/CHANGES: Updated.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.4.3
+
+       * 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.4.2/2.4.3/, s/242/243/.
+
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
+
+       * builds/unix/configure.raw (version_info): Set to 12:1:6.
+
+2010-10-03  Werner Lemberg  <wl@gnu.org>
+
+       Avoid `configure' issues with symbolic links.
+       Based on a patch from Alexander Stohr <Alexander.Stohr@gmx.de>.
+
+       * configure: Compare directories using `ls -id'.
+       Check existence of `reference' subdirectory before creating it.
+
+2010-10-02  Werner Lemberg  <wl@gnu.org>
+
+       [sfnt] Fix Savannah bug #31088 (sort of).
+
+       * src/sfnt/ttload.c (tt_face_load_maxp): Always allocate at least 64
+       function entries.
+
+2010-10-02  Werner Lemberg  <wl@gnu.org>
+
+       [smooth] Fix splitting of cubics for negative values.
+
+       Reported by Róbert Márki <gsmiko@gmail.com>; see
+       http://lists.gnu.org/archive/html/freetype/2010-09/msg00019.html.
+
+       * src/smooth/ftgrays.c (gray_render_cubic): Fix thinko.
+
+2010-10-01  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [truetype] Fix Savannah bug #31040.
+
+       * src/truetype/ttinterp.c (free_buffer_in_size): Remove.
+       (TT_RunIns): Updated.
+
+2010-09-20  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [sfnt] Make error message filling NULL names less verbose.
+
+       * src/sfnt/ttpost.c (load_format_20): Showing 1 summary message
+       when we fill `post' names by NULL, instead of per-entry message.
+
+2010-09-20  Graham Asher  <graham.asher@btinternet.com>
+           David Bevan  <david.bevan@pb.com>
+
+       [smooth] Fix and improve spline flattening.
+
+       This fixes the flattening of cubic, S-shaped curves and speeds up
+       the handling of both the conic and cubic arcs.
+
+       See the discussions on the freetype-devel mailing list in late
+       August and September 2010 for details.
+
+       * src/smooth/ftgrays.c (FT_MAX_CURVE_DEVIATION): New macro.
+       (TWorker): Remove `conic_level' and `cubic_level' elements.
+       (gray_render_conic): Simplify algorithm.
+       (gray_render_cubic): New algorithm; details are given in the code
+       comments.
+       (gray_convert_glyph): Remove heuristics.
+
+2010-09-19  Werner Lemberg  <wl@gnu.org>
+
+       Minor fixes.
+
+       * src/cff/cffload.c (cff_charset_compute_cids): `charset->sids[i]'
+       is `FT_UShort'.
+       (cff_index_access_element): Don't use additions in comparison.
+       * src/sfnt/ttpost.c (load_format_20): Make `post_limit' of type
+       `FT_Long'.
+       Don't use additions in comparison.
+       Improve tracing messages.
+       (load_format_25, load_post_names): Make `post_limit' of type
+       `FT_Long'.
+
+2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [cff] Truncate the element length at the end of the stream.
+       See Savannah bug #30975.
+
+       * 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
+       similarly.
+
+2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [cff] Ignore CID > 0xFFFFU.
+       See Savannah bug #30975.
+
+       * src/cff/cffload.c (cff_charset_compute_cids): Ignore CID if
+       greater than 0xFFFFU.  CFF font spec does not mention maximum CID in
+       the font, but PostScript and PDF spec define that maximum CID is
+       0xFFFFU.
+
+2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [cff] Make trace message in` cff_charset_load' verbose.
+       See Savannah bug #30975.
+
+       * src/cff/cffload.c (cff_charset_load): Report the original `nleft'
+       and truncated `nleft'.
+
+2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [cff] Correct `max_cid' from CID array length to max CID.
+       See Savannah bug #30975.
+
+       * src/cff/cffload.c (cff_charset_compute_cids): Don't increment
+       max_cid after detecting max CID.  The array CFF_Charset->cids is
+       allocated by max_cid + 1.
+       (cff_charset_cid_to_gindex): Permit CID is less than or equal to
+       CFF_Charset->max_cid.
+       * src/cff/cffobjs.c (cff_face_init): FT_Face->num_glyphs is
+       calculated as CFF_Charset->max_cid + 1.
+
+2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [truetype] Sanitize the broken offsets in `loca'.
+       See Savannah bug #31040.
+
+       * src/truetype/ttpload.c (tt_face_get_location): If `pos1', the
+       offset to the requested entry in `glyf' exceeds the end of the
+       table, return offset=0, length=0.  If `pos2', the offset to the next
+       entry in `glyf' exceeds the end of the table, truncate the entry
+       length at the end of `glyf' table.
+
+2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [sfnt] Prevent overrunning in `post' table parser.
+       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'.
+       (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.
+
+2010-09-17  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [truetype] Don't duplicate size->twilight structure to be freed.
+       See Savannah bug #31040 for detail.
+
+       * 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
+       pointers.  They can cause the double-free crash when the burst
+       errors occur in TrueType interpreter and `free_buffer_in_size' is
+       invoked repeatedly.
+
+2010-09-15  Werner Lemberg  <wl@gnu.org>
+
+       Make bytecode debugging with FontForge work again.
+
+       * src/truetype/ttinterp.c (TT_RunIns): Don't call
+       `free_buffer_in_size' in case of error if a debugger is active.
+
+2010-09-14  Werner Lemberg  <wl@gnu.org>
+
+       Improve tracing messages.
+
+       * src/truetype/ttinterp.c (TT_RunIns): Improve wording of tracing
+       message.
+       * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Add
+       tracing message.
+       * src/truetype/ttgload.c (tt_loader_init): Add tracing message.
+       * src/cache/ftcsbits.c (ftc_snode_load): Emit tracing message if
+       glyph doesn't fit into a small bitmap container.
+
+2010-09-13  Werner Lemberg  <wl@gnu.org>
+
+       Fix minor issues reported by <muktha.narayan@wipro.com>.
+
+       * src/autofit/aflatin.c (af_latin_compute_stem_width): Remove
+       redundant conditional check.
+       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Ditto.
+       * src/cff/cffload.c (cff_encoding_load): Remove conditional check
+       which always evaluates to `true'.
+       * src/pshinter/pshalgo.c (ps_glyph_interpolate_strong_points):
+       Ditto.
+       * src/truetype/ttinterp.c (Ins_IUP): Ditto.
+       * src/cid/cidgload.c (cid_slot_load_glyph): Don't check for NULL if
+       value is already dereferenced.
+       * src/winfonts/winfnt.c (FNT_Load_Glyph): Fix check of `face'.
+
+2010-08-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Ignore the environmental setting of LIBTOOL.
+       Patch is suggested by Adrian Bunk, to prevent unexpected
+       reflection of environmental LIBTOOL.  See:
+       http://savannah.nongnu.org/patch/?7290
+
+       * builds/unix/unix-cc.in: LIBTOOL is unconditionally set to
+       $(FT_LIBTOOL_DIR)/libtool.  FT_LIBTOOL_DIR is set to $(BUILD_DIR)
+       by default.
+       * configure: When configured for the building out of source tee,
+       FT_LIBTOOL_DIR is set to $(OBJ_DIR).
+
+2010-08-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [truetype] Decrease the trace level catching the interpreter 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'.
+
+2010-08-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [truetype] Prevent bytecode reuse after the interpretation error.
+
+       * src/truetype/ttinterp.c (free_buffer_in_size): New function to
+       free the buffer allocated during the interpretation of this glyph.
+       (TT_RunIns): Unset FT_Face->size->{cvt_ready,bytecode_ready} if
+       an error occurs in the bytecode interpretation.  The interpretation
+       of invalid bytecode may break the function definitions and referring
+       them in later interpretation is danger.  By unsetting these flags,
+       `fpgm' and `prep' tables are executed again in next interpretation.
+
+       This fixes Savannah bug #30798, reported by Robert Święcki.
+
+2010-08-29  Werner Lemberg  <wl@gnu.org>
+
+       [ftraster] Pacify compiler.
+
+       * src/raster/ftraster.c (ft_black_new) [_STANDALONE_]: `memory' is
+       not used.
+
+2010-08-29  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Allow SIDs >= 65000.
+
+       * src/cff/cffload.c (cff_charset_load): Fix change from 2009-03-20:
+       The threshold for SIDs is not applicable here.  I misinterpreted the
+       `SID values 65000 and above are available for implementation use'
+       sentence in the CFF specification.
+
+       Problem reported by Ivan Ninčić <inincic@pdftron.com>.
+
+2010-08-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Force hinting when the font lacks its familyname.
+
+       In Type42 or Type11 font embedded in PostScript & PDF, TrueType sfnt
+       stream may lack `name' table because they are not required.  Hinting
+       for nameless fonts is safer for PDFs including embedded Chinese
+       fonts.  Written by David Bevan, see:
+
+       http://lists.gnu.org/archive/html/freetype-devel/2010-08/msg00021.html
+       http://lists.freedesktop.org/archives/poppler/2010-August/006310.html
+
+       * src/truetype/ttobjs.c (tt_check_trickyness): If a NULL pointer by
+       nameless font is given, TRUE is returned to enable hinting.
+
+2010-08-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Register yet another tricky TrueType font.
+
+       * src/truetype/ttobjs.c (tt_check_trickyness): Add `HuaTianKaiTi?',
+       a Kaishu typeface paired with `HuaTianSongTi?' by Huatian
+       Information Industry.
+
+2010-08-17  Teijo Kinnunen <Teijo.Kinnunen@nuance.com>
+
+       [cache] Fix Savannah bug #30788.
+
+       * src/cache/ftccache.c (FTC_Cache_Clear): Check `cache->buckets' for
+       NULL too.
+
+2010-08-10  Werner Lemberg  <wl@gnu.org>
+
+       Try to fix Savannah bug #30717 (and probably #30719 too).
+
+       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Add another
+       overflow test for `width' and `height'.
+
+2010-08-06  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.4.2 released.
+       =========================
+
+
+       Tag sources with `VER-2-4-2'.
+
+       * docs/CHANGES: Updated.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.4.2
+
+       * 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.4.1/2.4.2/, s/241/242/.
+
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.
+
+       * builds/unix/configure.raw (version_info): Set to 12:0:6.
+
+2010-08-06  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Fix Savannah bug #30648.
+
+       * src/base/ftobjs.c (FT_Done_Library): Specify the order of font
+       drivers during the face closing process.  Type42 faces should be
+       closed before TrueType faces, because a Type42 face refers to
+       another internal TrueType face which is created from sfnt[] array on
+       the memory.
+
+2010-08-06  Yuriy Kaminskiy  <yumkam@mail.ru>
+
+       [raster] Fix valgrind warning.
+
+       * src/raster/ftraster.c (Decompose_Curve) <default>: Access point[0]
+       only if we don't hit `limit'.
+
+2010-08-06  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Fix Savannah bug #30658.
+
+       * src/base/ftobjs.c (Mac_Read_POST_Resource): Check that the total
+       length of collected POST segments does not overrun the allocated
+       buffer.
+
+2010-08-06  Yuriy Kaminskiy  <yumkam@mail.ru>
+
+       Fix conditional usage of FT_MulFix_i386.
+       With -ansi flag, gcc does not define `i386', only `__i386__'.
+
+       * include/freetype/config/ftconfig.h, builds/unix/ftconfig.in:
+       s/i386/__i386__/.
+
+2010-08-05  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix Savannah bug #30657.
+
+       * src/truetype/ttinterp.c (BOUNDSL): New macro.
+       Change `BOUNDS' to `BOUNDSL' where appropriate.
+
+       * src/truetype/ttinterp.h (TT_ExecContextRec): Fix type of
+       `cvtSize'.
+
+2010-08-05  Werner Lemberg  <wl@gnu.org>
+
+       [type42] Fix Savannah bug #30656.
+
+       * src/type42/t42parse.c (t42_parse_sfnts): Protect against negative
+       string_size.
+       Fix comparison.
+
+2010-08-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [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'
+       returns any error.
+
+2010-08-04  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #30644.
+
+       * src/base/ftstream.c (FT_Stream_EnterFrame): Fix comparison.
+
+2010-08-04  Werner Lemberg  <wl@gnu.org>
+
+       `make devel' fails if FT_CONFIG_OPTION_OLD_INTERNALS is set.
+
+       * devel/ftoption.h: Synchronize with
+       include/freetype/config/ftoption.h.
+
+2010-08-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [cff] Improve stack overflow test.
+
+       * src/cff/cffgload.c (cff_decoder_parse_charstrings): Check stack
+       after execution of operations too.
+
+2010-07-18  Werner Lemberg  <wl@gnu.org>
+
+       Add reference counters and to FT_Library and FT_Face objects.
+
+       * include/freetype/freetype.h (FT_Reference_Face): New function.
+       * include/freetype/ftmodapi.h (FT_Rererence_Library): New function.
+
+       * include/freetype/internal/ftobjs.h (FT_Face_InternalRec,
+       FT_LibraryRec): New field `refcount'.
+
+       * src/base/ftobjs.c (FT_Open_Face, FT_New_Library): Handle
+       `refcount'.
+       (FT_Reference_Face, FT_Reference_Library): Implement new functions.
+       (FT_Done_Face, FT_Done_Library): Handle `refcount'.
+
+       * docs/CHANGES: Updated.
+
+2010-07-18  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.4.1 released.
+       =========================
+
+
+       Tag sources with `VER-2-4-1'.
+
+       * docs/CHANGES: Updated.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.4.1.
+
+       * 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.4.0/2.4.1/, s/240/241/.
+
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
+
+       * builds/unix/configure.raw (version_info): Set to 11:1:5.
+
+2010-07-17  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Final try to fix `hintmask' and `cntrmask' limit check.
+
+       Problem reported by Tobias Wolf <towolf@gmail.com>.
+
+       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
+       <cff_op_hintmask>: Sigh.  I'm apparently too silly to fix this
+       correctly in less than three tries.
+
+2010-07-12  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.4.0 released.
+       =========================
+
+
+       Tag sources with `VER-2-4-0'.
+
+       * docs/CHANGES: Updated.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.4.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/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.12/2.4.0/, s/2312/240/.
+
+       * include/freetype/freetype.h (FREETYPE_MINOR): Set to 4.
+       (FREETYPE_PATCH): Set to 0.
+
+       * builds/unix/configure.raw (version_info): Set to 11:0:5.
+
+2010-07-12  Werner Lemberg  <wl@gnu.org>
+
+       Remove C++ warnings.
+
+       */*: Initialize pointers where necessary to make g++ happy.
+
+2010-07-12  malc  <av1474@comtv.ru>
+           Richard Henderson  <rth@redhat.com>
+
+       Fix type-punning issues with C++.
+
+       * include/freetype/internal/ftmemory.h (FT_ASSIGNP) [__cplusplus]:
+       Emulate a `typeof' operator with an inline template which uses
+       `static_cast'.
+
+2010-07-11  Werner Lemberg  <wl@gnu.org>
+
+       Fix C++ compilation issue.
+
+       * src/tools/apinames.c (names_dump) <OUTPUT_WATCOM_LBC>: Fix
+       type of `dot' variable.
+
+2010-07-10  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Fix another case reported in Savannah bug #30373.
+       Permit a face for Type1, Type42 and CFF without charmap,
+       patch by Tor Andersson.
+
+       * src/type1/t1objs.c (T1_Face_Init): Reset the error if it
+       is FT_Err_No_Unicode_Glyph_Name.
+       * src/type42/t42objs.c (T42_Face_Init): Ditto.
+       * src/cff/cffobjs.c (cff_face_init): Ditto.
+
+2010-07-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Use defined macros to set {platform,encoding}_id.
+
+       * src/bdf/bdfdrivr.c: Include ttnameid.h and use macros to
+       set charmap.{platfom,encoding}_id.
+       * src/pcf/pcfdrivr.c: Ditto.
+       * src/winfonts/winfnt.c: Ditto.
+       * src/type1/t1objs.c: Ditto.
+       * src/type42/t42objs.c: Ditto.
+       * src/cff/cffobjs.c: Ditto.
+       * src/pfr/pfrobjs.c: Ditto.
+
+2010-07-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Fix Savannah bug #30373.
+       Too serious check of errors by `FT_CMap_New' since 2010-07-04
+       is fixed. Reported by Tor Andersson.
+
+       * include/freetype/fterrdef.h
+       (PSnames_Err_No_Unicode_Glyph_Name): New error code to
+       indicate the Unicode charmap synthesis failed because
+       no Unicode glyph name is found.
+
+       * src/psnames/psmodule.c (ps_unicodes_init): Return
+       PSnames_Err_No_Unicode_Glyph_Name when no Unicode glyph name
+       is found in the font.
+       * src/cff/cffcmap.c (cff_cmap_unicode_init): Return
+       CFF_Err_No_Unicode_Glyph_Name when no SID is available.
+
+       * src/type1/t1objs.c (T1_Face_Init): Proceed if `FT_CMap_New'
+       is failed by the lack of Unicode glyph name.
+       * src/type42/t42objs.c (T42_Face_Init): Ditto.
+       * src/cff/cffobjs.c (cff_face_init): Ditto.
+
+2010-07-09  Ken Sharp  <ken.sharp@artifex.com>
+
+       Make ftraster.c compile in stand-alone mode with MSVC compiler.
+
+       * src/raster/ftmisc.h (FT_Int64) [_WIN32, _WIN64]: Fix typedef
+       since there is no `inttypes.h' for MSVC.
+
+2010-07-08  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix Savannah bug #30361.
+
+       * src/truetype/ttinterp.c (Ins_IUP): Fix bounds check.
+
+2010-07-06  Werner Lemberg  <wl@gnu.org>
+
+       Pacify compiler.
+
+       * src/cff/cffload.c (cff_index_get_pointers): Initialize
+       `new_bytes'.
+
+2010-07-05  Eugene A. Shatokhin  <spectre@ispras.ru>
+
+       Fix Savannah bug #27648.
+
+       * src/base/ftobjs.c (ft_remove_renderer, FT_Add_Module): Call
+       `raster_done' only if we have an outline glyph format.
+
+2010-07-05  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #30030.
+
+       * builds/win32/*/freetype.vcproj: Add ftxf86.c.
+
+2010-07-05  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Next try to fix `hintmask' and `cntrmask' limit check.
+
+       Problem reported by malc <av1474@comtv.ru>.
+
+       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
+       <cff_op_hintmask>: It is possible that there is just a single byte
+       after the `hintmask' or `cntrmask', e.g., a `return' instruction.
+
+2010-07-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Restrict the number of the charmaps in a rogue-compatible mode.
+       Fix for Savannah bug #30059.
+
+       * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Replace `16' the
+       minimum character code passed by a legacy rogue client by...
+       * include/freetype/config/ftoption.h (FT_MAX_CHARMAP_CACHEABLE):
+       This.  It is undefined when FT_CONFIG_OPTION_OLD_INTERNALS is
+       undefined (thus the rogue client compatibility is not required).
+
+       * src/cff/cffobjs.c (cff_face_init): Abort the automatic
+       selection or synthesis of Unicode cmap subtable when the charmap
+       index exceeds FT_MAX_CHARMAP_CACHEABLE.
+       * src/sfnt/ttcmap.c (tt_face_build_cmaps): Issue error message
+       when the charmap index exceeds FT_MAX_CHARMAP_CACHEABLE.
+
+       * src/base/ftobjs.c (find_unicode_charmap): When Unicode charmap
+       is found after FT_MAX_CHARMAP_CACHEABLE, ignore it and search
+       earlier one.
+       (find_variant_selector_charmap): When UVS charmap is found after
+       FT_MAX_CHARMAP_CACHEABLE, ignore it and search earlier one.
+       (FT_Select_Charmap): When a charmap matching with requested
+       encoding but after FT_MAX_CHARMAP_CACHEABLE, ignore and search
+       earlier one.
+       (FT_Set_Charmap): When a charmap matching with requested
+       charmap but after FT_MAX_CHARMAP_CACHEABLE, ignore and search
+       earlier one.
+       (FT_Get_Charmap_Index): When a requested charmap is found
+       after FT_MAX_CHARMAP_CACHEABLE, return the inverted charmap
+       index.
+
+2010-07-04  Werner Lemberg  <wl@gnu.org>
+
+       TrueType hinting is no longer patented.
+
+       * include/freetype/config/ftoption.h, devel/ftoption.h
+       (TT_CONFIG_OPTION_BYTECODE_INTERPRETER): Define.
+       (TT_CONFIG_OPTION_UNPATENTED_HINTING): Undefine.
+
+       * docs/CHANGES, docs/INSTALL, include/freetype/freetype.h: Updated.
+       * docs/TRUETYPE, docs/PATENTS: Removed.
+
+2010-07-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Check error value by `FT_CMap_New'.
+
+       * src/cff/cffobjs.c (cff_face_init): Check error value by
+       `FT_CMap_New'.
+       * src/pfr/pfrobjs.c (pfr_face_init): Ditto.
+       * src/type1/t1jobjs.c (T1_Face_Init): Ditto.
+       * src/type42/t42jobjs.c (T42_Face_Init): Ditto.
+
+2010-07-03  Werner Lemberg  <wl@gnu.org>
+
+       Make ftgrays.c compile stand-alone again.
+
+       * src/smooth/ftgrays.c [_STANDALONE_]: Include `stddef.h'.
+       (FT_INT_MAX, FT_PtrDist)[_STANDALONE_]: Define.
+
+2010-07-02  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Additional fix for Savannah bug #30306.
+
+       * src/base/ftobjs.c (Mac_Read_POST_Resource): If the type of the
+       POST fragment is 0, the segment is completely ignored.  The declared
+       length of the segment is not cared at all.  According to Adobe
+       Technical Note 5040, type 0 segment is a comment only and should not
+       be loaded for the interpreter.  Reported by Robert Święcki.
+
+2010-07-01  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Protect against code range underflow.
+
+       * src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF): Don't allow
+       negative IP values.
+
+2010-07-01  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Add rudimentary tracing for bytecode instructions.
+
+       * src/truetype/ttinterp.c (opcode_name) [FT_DEBUG_LEVEL_TRACE]: New
+       array.
+       (TT_RunIns): Trace opcodes.
+
+2010-06-30  Werner Lemberg  <wl@gnu.org>
+
+       [smooth] Fix Savannah bug #30263.
+
+       * src/smooth/ftgrays.c (gray_render_span): Use cast to `unsigned
+       int' to avoid integer overflow.
+
+       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use smaller
+       threshold values for `width' and `height'.  This is not directly
+       related to the bug fix but makes sense anyway.
+
+2010-07-01  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Initial fix for Savannah bug #30306.
+
+       * src/base/ftobjs.c (Mac_Read_POST_Resource): Check `rlen', the
+       length of fragment declared in the POST fragment header, and prevent
+       an underflow in length calculation.  Some fonts set the length to
+       zero in spite of the existence of a following 16bit `type'.
+       Reported by Robert Święcki.
+
+2010-07-01  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Additional fix for Savannah bug #30248 and #30249.
+
+       * src/base/ftobjs.c (Mac_Read_POST_Resource): Check the buffer size
+       during gathering PFB fragments embedded in LaserWriter PS font for
+       Macintosh.  Reported by Robert Święcki.
+
+2010-06-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       Minor optimizations by avoiding divisions.
+
+       * src/sfnt/ttkern.c (tt_face_load_kern, tt_face_get_kerning):
+       Replace divisions with multiplication in comparisons.
+
+2010-06-29  Werner Lemberg  <wl@gnu.org>
+
+       Fix minor tracing issues.
+
+       * src/cff/cffgload.c, src/truetype/ttgload.c: Adjust tracing levels.
+
+2010-06-27  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Really fix `hintmask' and `cntrmask' limit check.
+
+       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
+       <cff_op_hintmask>: Fix thinko and handle tracing also.
+
+2010-06-27  Werner Lemberg  <wl@gnu.org>
+
+       Fix valgrind warning.
+
+       * src/base/ftoutln.c (FT_Outline_Get_Orientation): Initialize
+       `result' array.
+
+2010-06-27  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Fix memory leak.
+
+       * src/cff/cffgload.c (cff_operator_seac): Free charstrings even in
+       case of errors.
+
+2010-06-27  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Protect against invalid `hintmask' and `cntrmask' operators.
+
+       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
+       <cff_op_hintmask>: Ensure that we don't exceed `limit' while parsing
+       the bit masks of the `hintmask' and `cntrmask' operators.
+
+2010-06-26  Werner Lemberg  <wl@gnu.org>
+
+       Fix PFR change 2010-06-24.
+
+       * src/pfr/pfrgload.c (pfr_glyph_load_simple): Really protect against
+       invalid indices.
+
+2010-06-26  Werner Lemberg  <wl@gnu.org>
+
+       Improve PFR tracing messages.
+
+       * src/pfr/pfrgload.c (pfr_glyph_load_rec): Emit tracing messages for
+       simple and compound glyph offsets.
+
+2010-06-26  Werner Lemberg  <wl@gnu.org>
+
+       Fix last PFR change.
+
+       * src/pfr/pfrobjs.c (pfr_face_init): Fix rejection logic.
+
+2010-06-26  Werner Lemberg  <wl@gnu.org>
+
+       [sfnt] Fix Savannah bug #30262.
+
+       * src/sfnt/ttload.c (tt_face_load_maxp): Limit `maxComponentDepth'
+       arbitrarily to 100 to avoid stack exhaustion.
+
+2010-06-26  Werner Lemberg  <wl@gnu.org>
+
+       Add some memory checks (mainly for debugging).
+
+       * src/base/ftstream.c (FT_Stream_EnterFrame): Exit with error
+       if the frame size is larger than the stream size.
+
+       * src/base/ftsystem.c (ft_ansi_stream_io): Exit with error if
+       seeking a position larger than the stream size.
+
+2010-06-25  Werner Lemberg  <wl@gnu.org>
+
+       [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>
+
+       [cff] Fix Savannah bug #30254.
+
+       * src/cff/cffload.c (cff_index_get_pointers): Do sanity check for
+       first offset also.
+
+2010-06-25  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Initial fix for Savannah bug #30248 and #30249.
+
+       * src/base/ftobjs.c (Mac_Read_POST_Resource): Check the error during
+       reading a PFB fragment embedded in LaserWriter PS font for Macintosh.
+       Reported by Robert Święcki.
+
+2010-06-24  Werner Lemberg  <wl@gnu.org>
+
+       [pcf] Fix Savannah bug #30247.
+
+       * src/pcf/pcfread.c (pcf_get_metrics): Disallow (invalid) fonts with
+       zero metrics.
+
+2010-06-24  Graham Asher  <graham.asher@btinternet.com>
+
+       * src/smooth/ftgrays.c (gray_render_cubic): Fix algorithm.
+       The previous version was too aggressive, as demonstrated in
+       http://lists.gnu.org/archive/html/freetype-devel/2010-06/msg00020.html.
+
+2010-06-24  Werner Lemberg  <wl@gnu.org>
+
+       */*: Use module specific error names where appropriate.
+
+2010-06-24  Werner Lemberg  <wl@gnu.org>
+
+       [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>
+
+       [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.
+
+2010-06-24  Werner Lemberg  <wl@gnu.org>
+
+       [bdf]: Font properties are optional.
+
+       * src/bdf/bdflib.c (_bdf_readstream): Use special error code to
+       indicate a redo operation.
+       (_bdf_parse_start): Handle `CHARS' keyword here too and pass current
+       input line to `_bdf_parse_glyph'.
+
+2010-06-23  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Fix Savannah bug #30220.
+
+       * include/freetype/fterrdef.h
+       (BDF_Err_Missing_Fontboundingbox_Field): New error code.
+
+       * src/bdf/bdflib.c (_bdf_parse_start): Check for missing
+       `FONTBOUNDINGBOX' field.
+       Avoid memory leak if there are multiple `FONT' lines (which is
+       invalid but doesn't hurt).
+
+2010-06-21  Werner Lemberg  <wl@gnu.org>
+
+       [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>
+
+       [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>
+
+       [bdf] Fix Savannah bug #30135.
+
+       * src/bdf/bdflib.c (_bdf_list_join): Don't modify value in static
+       string `empty'.
+       (_bdf_parse_glyph): Avoid memory leak in case of error.
+
+2010-06-15  Werner Lemberg  <wl@gnu.org>
+
+       [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>
+
+       [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
+       determined; in particular, the code for handling the `endchar'
+       opcode can reduce the number of points.
+
+       * src/pshinter/pshalgo.c (psh_glyph_find_strong_points): Assure that
+       `end_point' is not larger than `glyph->num_points'.
+
+2010-06-11  Werner Lemberg  <wl@gnu.org>
+
+       [cff]: Improve debugging output.
+
+       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
+       <cff_op_hintmask>: Implement it.
+
+2010-06-10  Graham Asher  <graham.asher@btinternet.com>
+
+       ftgrays: Speed up rendering of small cubic splines.
+
+       * src/smooth/ftgrays.c (gray_render_cubic): Implement new,
+       simplified algorithm to find out whether the spline can be replaced
+       with two straight lines.  See this thread for more:
+
+         http://lists.gnu.org/archive/html/freetype-devel/2010-06/msg00000.html
+
+2010-06-09  Werner Lemberg  <wl@gnu.org>
+
+       [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>
+
+       [cff] Fix Savannah bug #30053.
+
+       * src/cff/cffparse.c (cff_parse_real): Handle border case where
+       `fraction_length' has value 10.
+
+2010-06-07  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #30052.
+       This bug has been introduced with commit 2415cbf3.
+
+       * src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Protect
+       against endless loop in case of corrupted font header data.
+
+2010-05-26  Werner Lemberg  <wl@gnu.org>
+
+       Remove unused variable.
+       Found by Graham.
+
+       * src/autofit/afhints.c (af_glyph_hints_reload): Remove unused
+       variable `first' in first block.
+
+2010-05-22  Werner Lemberg  <wl@gnu.org>
+
+       Fix various memory problems found by linuxtesting.org.
+
+       * src/base/ftgxval.c (FT_TrueTypeGX_Free, FT_ClassicKern_Free),
+       src/base/ftotval.c (FT_OpenType_Free), src/base/ftpfr.c
+       (ft_pfr_check): Check `face'.
+
+       * src/base/ftobjs.c (FT_Get_Charmap_Index): Check `charmap' and
+       `charmap->face'.
+       (FT_Render_Glyph): Check `slot->face'.
+       (FT_Get_SubGlyph_Info): Check `glyph->subglyphs'.
+
+2010-05-22  Werner Lemberg  <wl@gnu.org>
+
+       autofit: Remove dead code.
+       Suggested by Graham.
+
+       * src/autofit/afhints.c (af_glyph_hints_compute_inflections):
+       Removed.
+       (af_glyph_hints_reload): Remove third argument.
+       Update all callers.
+
+2010-05-21  Bram Tassyns  <bramt@enfocus.be>
+
+       [cff] Fix Savannah bug #27987.
+
+       * src/cff/cffobjs.c (remove_subset_prefix): New function.
+       (cff_face_init): Use it to adjust `cffface->family_name'.
+
+2010-05-20  Werner Lemberg  <wl@gnu.org>
+
+       TrueType: Make FreeType ignore maxSizeOfInstructions in `maxp'.
+
+       Acroread does the same.
+
+       * src/truetype/ttgload.c (TT_Process_Composite_Glyph): Call
+       `Update_Max' to adjust size of instructions array if necessary and
+       add a rough safety check.
+
+       (load_truetype_glyph): Save `loader->byte_len' before recursive
+       call.
+
+       * src/truetype/ttinterp.h, src/truetype/ttinterp.c (Update_Max):
+       Declare it as FT_LOCAL.
+
+2010-05-18  Hongbo Ni  <hongbo@njstar.com>
+
+       Apply Savannah patch #7196.
+
+       * src/cff/cffgload.c (cff_slot_load): Prevent crash if CFF subfont
+       index is out of range.
+
+2010-05-11  Werner Lemberg  <wl@gnu.org>
+
+       * docs/formats.txt: Give pointer to PCF documentation.
+       Information provided by Alan Coopersmith
+       <alan.coopersmith@oracle.com>.
+
+2010-05-10  Ken Sharp  <ken.sharp@artifex.com>
+
+       [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
+       raise an error, because the `setcurrentpoint' operator is only
+       supposed to be used with the results from an OtherSubr subroutine.
+
+       This was fixed by simply ignoring the error and carrying on.
+
+       Now we have found a font which uses setcurrentpoint to actually
+       establish a non-zero point for a contour during the course of a
+       glyph program.  FWIW, these files may be produced by an application
+       called `Intaglio' on the Mac, when converting TrueType fonts to
+       Type 1.
+
+       The fix allows the new invalid behaviour, the old invalid behaviour
+       and real proper usage of the operator to work the same way as Adobe
+       interpreters apparently do.
+
+       * 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
+       values.
+
+2010-04-14  Ken Sharp  <ken.sharp@artifex.com>
+
+       [psaux] Fix Savannah bug #29444.
+
+       * src/psaux/psobjs.c (t1_builder_start_point): Accept (invalid)
+       `lineto' immediately after `hsbw', in accordance with Acrobat, GS,
+       and others.
+
+2010-04-14  Michał Cichoń  <thedmd@artifexmundi.com>
+
+       [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>
+
+       [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>
+
+       [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,
+       however.
+
+2010-04-05  Werner Lemberg  <wl@gnu.org>
+
+       Add new function `FT_Library_SetLcdFilterWeights'.
+
+       This is based on code written by Lifter
+       <http://unixforum.org/index.php?showuser=11691>.  It fixes
+       FreeDesktop bug #27386.
+
+       * src/base/ftlcdfil.c (FT_Library_SetLcdFilterWeights): New
+       function.
+
+       * include/freetype/ftlcdfil.h: Updated.
+
+       * docs/CHANGES: Updated.
+
+2010-04-01  John Tytgat  <John.Tytgat@esko.com>
+
+       [truetype] Fix Savannah bug #29404.
+
+       * src/truetype/ttgload.c: Revert change 2752bd1a (check on bit 1
+       of `head' table of TrueType fonts).
+
+2010-03-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Fix `multi build' for Tytgat's CFF driver improvement.
+
+       * src/base/cffload.h (cff_index_get_name): Added.
+
+2010-03-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Remove duplicated inclusion of `FT_OUTLINE_H' in ftobjs.c.
+
+       * src/base/ftobjs.c: Remove 2nd inclusion of `FT_OUTLINE_H'.
+
+2010-03-11  Chris Liddell  <chris.liddell@artifex.com>
+
+       [raster] Fix Savannah bug #27442.
+
+       * src/raster/ftraster.c (ft_black_reset): Fix `buffer_size'.
+
+2010-03-09  Werner Lemberg  <wl@gnu.org>
+
+       [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>
+
+       [cff] Improve CFF string (especially glyphname) lookup performance.
+
+       We do this by avoiding memory allocation and file I/O.  This is
+       Savannah patch #7104.
+
+       * src/cff/cfftypes.h: Include PS cmaps service and
+       FT_INTERNAL_POSTSCRIPT_HINTS_H.
+       (CFF_SubFontRec): Remove `num_local_subrs'.
+       (CFF_FontRec): Add `num_strings', `strings', and `string_pool'
+       fields.
+       Remove `string_index' and `num_global_subrs' fields.
+       Use real types instead of `void' for `pshinter' and `psnames' fields.
+
+       * src/cff/cffload.c: Don't include PS cmaps service.
+       (cff_index_get_pointers): Add `pool' parameter which allows to
+       insert an extra NUL character for each String INDEX entry.
+       (cff_index_get_name): Make it a local function.
+       (cff_index_get_string): New function.
+       (cff_subfont_load): Updated.
+       (cff_font_load): Initialize `num_strings', `strings', and
+       `string_pool' fields in the `CFF_FontRec' structure.
+       (cff_index_get_sid_string): Use `cff_index_get_string' instead of
+       `cff_index_get_name'.
+       (cff_font_done): Updated.
+
+       * src/cff/cffload.h: Don't include PS cmaps service.
+       (cff_index_get_string): Added.
+       (cff_index_get_sid_string): Updated.
+
+       * src/cff/cffobjs.c: Don't include PS cmaps service and
+       FT_INTERNAL_POSTSCRIPT_HINTS_H.
+       (cff_size_get_globals_funcs, cff_slot_init): Updated.
+       (cff_face_init): Follow `cff_index_get_name',
+       `cff_index_get_string', and `cff_index_get_sid_string' changes.
+
+       * src/cff/cffcmap.c (cff_sid_free_glyph_name): Removed.
+       (cff_sid_to_glyph_name): Use `cff_index_get_cid_string'.
+       (cff_cmap_unicode_init): Updated.
+
+       * src/cff/cffdrivr.c: Don't include PS cmap service.
+       (cff_get_glyph_name): Avoid unnecessary lookup for POSTSCRIPT_CMAPS
+       service.
+       (cff_get_glyph_name, cff_ps_get_font_info, cff_get_ros): Follow API
+       `cff_index_get_sid_string' change.
+       (cff_get_name_index): Use `cff_index_get_string' instead of
+       `cff_index_get_name'.
+
+       * src/cff/cffgload.c: Don't include FT_INTERNAL_POSTSCRIPT_HINTS_H.
+       (cff_decoder_init, cff_decoder_prepare): Updated.
+
+2010-02-27  Werner Lemberg  <wl@gnu.org>
+
+       Simplify code.
+       Suggested by Behdad.
+
+       * src/base/ftobjs.c (FT_Get_First_Char): Don't use a loop since we
+       call FT_Get_Next_Char anyway if necessary.
+
+2010-02-26  Behdad Esfahbod  <behdad@behdad.org>
+
+       Improve handling of invalid glyph indices in char->index functions.
+
+       * src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Use a
+       loop.
+
+2010-02-18  Chris Liddell  <chris.liddell@artifex.com>
+
+       [truetype] Fix Savannah bug #28905.
+
+       Initialize phantom points before calling the incremental interface
+       to update glyph metrics.
+
+       * src/truetype/ttgload.c (tt_get_metrics_incr_overrides)
+       [FT_CONFIG_OPTION_INCREMENTAL]: New function, split off from...
+       (tt_get_metrics): This.
+       Updated.
+       (load_truetype_glyph): Use tt_get_metrics_incr_overrides.
+
+----------------------------------------------------------------------------
+
+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.
+
+
+Local Variables:
+version-control: never
+coding: utf-8
+End:
diff --git a/Jamfile b/Jamfile
index 313bda6..16e097e 100644 (file)
--- a/Jamfile
+++ b/Jamfile
@@ -1,6 +1,6 @@
 # FreeType 2 top Jamfile.
 #
-# Copyright 2001-2011 by
+# Copyright 2001-2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -140,9 +140,9 @@ DEFINES += FT2_BUILD_LIBRARY ;
 # 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.
+# The file <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 ] ;
@@ -177,7 +177,7 @@ actions GenExportSymbols1 bind APINAMES
   $(APINAMES) $(2) > $(1)
 }
 
-GenExportSymbols  ftexport.sym : include/freetype include/freetype/cache ;
+GenExportSymbols  ftexport.sym : include include/cache ;
 
 # Test files (hinter debugging).  Only used by FreeType developers.
 #
@@ -195,7 +195,7 @@ rule RefDoc
 
 actions RefDoc
 {
-  python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.4.9 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h
+  python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.5.5 --output=$(DOC_DIR) $(FT2_INCLUDE)/*.h $(FT2_INCLUDE)/config/*.h
 }
 
 RefDoc  refdoc ;
diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..bbaba33
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,169 @@
+                    The FreeType Project LICENSE
+                    ----------------------------
+
+                            2006-Jan-27
+
+                    Copyright 1996-2002, 2006 by
+          David Turner, Robert Wilhelm, and Werner Lemberg
+
+
+
+Introduction
+============
+
+  The FreeType  Project is distributed in  several archive packages;
+  some of them may contain, in addition to the FreeType font engine,
+  various tools and  contributions which rely on, or  relate to, the
+  FreeType Project.
+
+  This  license applies  to all  files found  in such  packages, and
+  which do not  fall under their own explicit  license.  The license
+  affects  thus  the  FreeType   font  engine,  the  test  programs,
+  documentation and makefiles, at the very least.
+
+  This  license   was  inspired  by  the  BSD,   Artistic,  and  IJG
+  (Independent JPEG  Group) licenses, which  all encourage inclusion
+  and  use of  free  software in  commercial  and freeware  products
+  alike.  As a consequence, its main points are that:
+
+    o We don't promise that this software works. However, we will be
+      interested in any kind of bug reports. (`as is' distribution)
+
+    o You can  use this software for whatever you  want, in parts or
+      full form, without having to pay us. (`royalty-free' usage)
+
+    o You may not pretend that  you wrote this software.  If you use
+      it, or  only parts of it,  in a program,  you must acknowledge
+      somewhere  in  your  documentation  that  you  have  used  the
+      FreeType code. (`credits')
+
+  We  specifically  permit  and  encourage  the  inclusion  of  this
+  software, with  or without modifications,  in commercial products.
+  We  disclaim  all warranties  covering  The  FreeType Project  and
+  assume no liability related to The FreeType Project.
+
+
+  Finally,  many  people  asked  us  for  a  preferred  form  for  a
+  credit/disclaimer to use in compliance with this license.  We thus
+  encourage you to use the following text:
+
+   """
+    Portions of this software are copyright © <year> The FreeType
+    Project (www.freetype.org).  All rights reserved.
+   """
+
+  Please replace <year> with the value from the FreeType version you
+  actually use.
+
+
+Legal Terms
+===========
+
+0. Definitions
+--------------
+
+  Throughout this license,  the terms `package', `FreeType Project',
+  and  `FreeType  archive' refer  to  the  set  of files  originally
+  distributed  by the  authors  (David Turner,  Robert Wilhelm,  and
+  Werner Lemberg) as the `FreeType Project', be they named as alpha,
+  beta or final release.
+
+  `You' refers to  the licensee, or person using  the project, where
+  `using' is a generic term including compiling the project's source
+  code as  well as linking it  to form a  `program' or `executable'.
+  This  program is  referred to  as  `a program  using the  FreeType
+  engine'.
+
+  This  license applies  to all  files distributed  in  the original
+  FreeType  Project,   including  all  source   code,  binaries  and
+  documentation,  unless  otherwise  stated   in  the  file  in  its
+  original, unmodified form as  distributed in the original archive.
+  If you are  unsure whether or not a particular  file is covered by
+  this license, you must contact us to verify this.
+
+  The FreeType  Project is copyright (C) 1996-2000  by David Turner,
+  Robert Wilhelm, and Werner Lemberg.  All rights reserved except as
+  specified below.
+
+1. No Warranty
+--------------
+
+  THE FREETYPE PROJECT  IS PROVIDED `AS IS' WITHOUT  WARRANTY OF ANY
+  KIND, EITHER  EXPRESS OR IMPLIED,  INCLUDING, BUT NOT  LIMITED TO,
+  WARRANTIES  OF  MERCHANTABILITY   AND  FITNESS  FOR  A  PARTICULAR
+  PURPOSE.  IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
+  BE LIABLE  FOR ANY DAMAGES CAUSED  BY THE USE OR  THE INABILITY TO
+  USE, OF THE FREETYPE PROJECT.
+
+2. Redistribution
+-----------------
+
+  This  license  grants  a  worldwide, royalty-free,  perpetual  and
+  irrevocable right  and license to use,  execute, perform, compile,
+  display,  copy,   create  derivative  works   of,  distribute  and
+  sublicense the  FreeType Project (in  both source and  object code
+  forms)  and  derivative works  thereof  for  any  purpose; and  to
+  authorize others  to exercise  some or all  of the  rights granted
+  herein, subject to the following conditions:
+
+    o Redistribution of  source code  must retain this  license file
+      (`FTL.TXT') unaltered; any  additions, deletions or changes to
+      the original  files must be clearly  indicated in accompanying
+      documentation.   The  copyright   notices  of  the  unaltered,
+      original  files must  be  preserved in  all  copies of  source
+      files.
+
+    o Redistribution in binary form must provide a  disclaimer  that
+      states  that  the software is based in part of the work of the
+      FreeType Team,  in  the  distribution  documentation.  We also
+      encourage you to put an URL to the FreeType web page  in  your
+      documentation, though this isn't mandatory.
+
+  These conditions  apply to any  software derived from or  based on
+  the FreeType Project,  not just the unmodified files.   If you use
+  our work, you  must acknowledge us.  However, no  fee need be paid
+  to us.
+
+3. Advertising
+--------------
+
+  Neither the  FreeType authors and  contributors nor you  shall use
+  the name of the  other for commercial, advertising, or promotional
+  purposes without specific prior written permission.
+
+  We suggest,  but do not require, that  you use one or  more of the
+  following phrases to refer  to this software in your documentation
+  or advertising  materials: `FreeType Project',  `FreeType Engine',
+  `FreeType library', or `FreeType Distribution'.
+
+  As  you have  not signed  this license,  you are  not  required to
+  accept  it.   However,  as  the FreeType  Project  is  copyrighted
+  material, only  this license, or  another one contracted  with the
+  authors, grants you  the right to use, distribute,  and modify it.
+  Therefore,  by  using,  distributing,  or modifying  the  FreeType
+  Project, you indicate that you understand and accept all the terms
+  of this license.
+
+4. Contacts
+-----------
+
+  There are two mailing lists related to FreeType:
+
+    o freetype@nongnu.org
+
+      Discusses general use and applications of FreeType, as well as
+      future and  wanted additions to the  library and distribution.
+      If  you are looking  for support,  start in  this list  if you
+      haven't found anything to help you in the documentation.
+
+    o freetype-devel@nongnu.org
+
+      Discusses bugs,  as well  as engine internals,  design issues,
+      specific licenses, porting, etc.
+
+  Our home page can be found at
+
+    http://www.freetype.org
+
+
+--- end of FTL.TXT ---
diff --git a/LICENSE.GPL-2.0 b/LICENSE.GPL-2.0
new file mode 100644 (file)
index 0000000..b2fe7b6
--- /dev/null
@@ -0,0 +1,340 @@
+                   GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/README b/README
index 84b1c44..f00a1ab 100644 (file)
--- a/README
+++ b/README
@@ -1,17 +1,22 @@
-  FreeType 2.4.9
+  FreeType 2.5.5
   ==============
 
+  Homepage: http://www.freetype.org
+
+  FreeType is a freely available software library to render fonts.
+
+  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.
 
-  Read the files `docs/INSTALL' for installation instructions.
-
-  See the  file `docs/LICENSE.TXT'  for the available licenses.   Note
-  that we use ranges (`2008-2010') for copyright years also instead of
-  listing individual years (`2008, 2009, 2010').
+  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
+  file   `ft2-toc.html'   as   the   top  entry   point.    Additional
   documentation is available as a separate package from our sites.  Go
   to
 
 
   and download one of the following files.
 
-    freetype-doc-2.4.9.tar.bz2
-    freetype-doc-2.4.9.tar.gz
-    ftdoc249.zip
+    freetype-doc-2.5.5.tar.bz2
+    freetype-doc-2.5.5.tar.gz
+    ftdoc255.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
   ====
 
-  Please report bugs  by e-mail to `freetype-devel@nongnu.org'.  Don't
-  forget to  send a  detailed explanation of  the problem --  there is
-  nothing  worse than  receiving a  terse message  that only  says `it
-  doesn't work'.
-
-  Alternatively, you may submit a bug report at
+  Please submit bug reports at
 
     https://savannah.nongnu.org/bugs/?group=freetype
 
+  Alternatively,    you   might    report    bugs    by   e-mail    to
+  `freetype-devel@nongnu.org'.   Don't  forget   to  send  a  detailed
+  explanation of the problem --  there is nothing worse than receiving
+  a terse message that only says `it doesn't work'.
+
 
   Enjoy!
 
@@ -44,7 +70,7 @@
 
 ----------------------------------------------------------------------
 
-Copyright 2006-2011 by
+Copyright 2006-2014 by
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 This  file is  part of  the FreeType  project, and  may only  be used,
index 47cb242..021c121 100644 (file)
@@ -31,9 +31,13 @@ configure script is necessary at all; saying
 should work on all platforms which have GNU make (or makepp).
 
 
+Similarly, a  build with  `cmake' can  be done  directly from  the git
+repository.
+
+
 ----------------------------------------------------------------------
 
-Copyright 2005, 2006, 2007, 2008, 2009, 2010 by
+Copyright 2005-2010, 2013 by
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 This  file is  part of  the FreeType  project, and  may only  be used,
diff --git a/TC/_export_env.sh b/TC/_export_env.sh
deleted file mode 100755 (executable)
index 06b6671..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-. ./config
-export TET_INSTALL_PATH=$TET_INSTALL_HOST_PATH # tetware root path
-export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path
-export PATH=$TET_TARGET_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
-export TET_ROOT=$TET_TARGET_PATH
-export FT2_TC_ROOT_PATH=/mnt/nfs/DTS/freetype/ft2demos
diff --git a/TC/_export_target_env.sh b/TC/_export_target_env.sh
deleted file mode 100755 (executable)
index 5ddaa53..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-. ./config
-export TET_INSTALL_PATH=$TET_INSTALL_TARGET_PATH # path to path
-export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
-export PATH=$TET_TARGET_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
-export TET_ROOT=$TET_TARGET_PATH
diff --git a/TC/build.sh b/TC/build.sh
deleted file mode 100755 (executable)
index 72aad6c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-. ./_export_env.sh                              # setting environment variables
-
-export TET_SUITE_ROOT=`pwd`
-FILE_NAME_EXTENSION=`date +%s`
-
-RESULT_DIR=results
-HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
-
-mkdir -p $RESULT_DIR
-
-tcc -c -p ./
-tcc -b -j $JOURNAL_RESULT -p ./
-grw -c 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
diff --git a/TC/clean.sh b/TC/clean.sh
deleted file mode 100755 (executable)
index 29743e0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-. ./_export_env.sh                              # setting environment variables
-
-export TET_SUITE_ROOT=`pwd`
-RESULT_DIR=results
-
-tcc -c -p ./                                # executing tcc, with clean option (-c)
-rm -r $RESULT_DIR
-rm -r tet_tmp_dir
-rm testcase/tet_captured
diff --git a/TC/config b/TC/config
deleted file mode 100755 (executable)
index e8c668e..0000000
--- a/TC/config
+++ /dev/null
@@ -1,2 +0,0 @@
-TET_INSTALL_HOST_PATH=/view/DTS/TETware
-TET_INSTALL_TARGET_PATH=/mnt/nfs/DTS/TETware
diff --git a/TC/execute.sh b/TC/execute.sh
deleted file mode 100755 (executable)
index a4f6095..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-. ./_export_target_env.sh                    # setting environment variables
-
-export TET_SUITE_ROOT=`pwd`
-FILE_NAME_EXTENSION=`date +%s`
-
-RESULT_DIR=results
-HTML_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.journal
-
-mkdir -p $RESULT_DIR
-
-tcc -e -j $JOURNAL_RESULT -p ./
-grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
diff --git a/TC/testcase/Makefile b/TC/testcase/Makefile
deleted file mode 100755 (executable)
index 7ed8eb3..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-CC ?= gcc
-
-C_FILES = $(shell ls *.c)
-
-PKGS = freetype2 capi-base-common dlog gthread-2.0
-
-LDFLAGS = `pkg-config --libs $(PKGS)`
-LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
-LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
-LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
-
-CFLAGS = -I. `pkg-config --cflags $(PKGS)`
-CFLAGS += -I$(TET_ROOT)/inc/tet3
-CFLAGS += -Wall
-
-TCS := $(shell ls -1 *.c | cut -d. -f1)
-
-all: $(TCS)
-
-%: %.c
-       $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-clean:
-       rm -f $(TCS)
diff --git a/TC/testcase/tslist b/TC/testcase/tslist
deleted file mode 100755 (executable)
index 7f1d607..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/testcase/utc_ft_bench
-/testcase/utc_ft_diff
-/testcase/utc_ft_dump
-/testcase/utc_ft_gamma
-/testcase/utc_ft_grid
-/testcase/utc_ft_lint
-/testcase/utc_ft_multi
-/testcase/utc_ft_string
-/testcase/utc_ft_view
diff --git a/TC/testcase/utc_ft_bench.c b/TC/testcase/utc_ft_bench.c
deleted file mode 100755 (executable)
index 557375a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <tet_api.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_ft_bench(void);
-
-struct tet_testlist tet_testlist[] = {
-       { utc_ft_bench, 1 },
-       { NULL, 0 },
-};
-
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-static void utc_ft_bench(void)
-{
-       char buf[128];
-       int ret;
-       sprintf(buf, "cd %s && ./ftbench /usr/share/fonts/HelveticaNeueRegular.ttf ", getenv("FT2_TC_ROOT_PATH"));
-       ret = system(buf);
-       if(WEXITSTATUS(ret) == 0)
-               dts_pass("utc_ft_bench");
-       else
-               dts_fail("utc_ft_bench");
-}
diff --git a/TC/testcase/utc_ft_diff.c b/TC/testcase/utc_ft_diff.c
deleted file mode 100755 (executable)
index 9599fc7..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <tet_api.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_ft_diff(void);
-
-struct tet_testlist tet_testlist[] = {
-       { utc_ft_diff, 1 },
-       { NULL, 0 },
-};
-
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-static void utc_ft_diff(void)
-{
-       char buf[128];
-       int ret;
-       sprintf(buf, "cd %s && ./ftdiff /usr/share/fonts/HelveticaNeueRegular.ttf ", getenv("FT2_TC_ROOT_PATH"));
-       ret = system(buf);
-       if(WEXITSTATUS(ret) == 0)
-               dts_pass("utc_ft_diff");
-       else
-               dts_fail("utc_ft_diff");
-}
diff --git a/TC/testcase/utc_ft_dump.c b/TC/testcase/utc_ft_dump.c
deleted file mode 100755 (executable)
index a0b6a2c..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <tet_api.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_ft_dump(void);
-
-struct tet_testlist tet_testlist[] = {
-       { utc_ft_dump, 1 },
-       { NULL, 0 },
-};
-
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-static void utc_ft_dump(void)
-{
-       char buf[128];
-       int ret;
-       sprintf(buf, "cd %s && ./ftdump /usr/share/fonts/HelveticaNeueRegular.ttf ", getenv("FT2_TC_ROOT_PATH"));
-       ret = system(buf);
-       if(WEXITSTATUS(ret) == 0)
-               dts_pass("utc_ft_dump");
-       else
-               dts_fail("utc_ft_dump");
-}
diff --git a/TC/testcase/utc_ft_gamma.c b/TC/testcase/utc_ft_gamma.c
deleted file mode 100755 (executable)
index 6e42a43..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <tet_api.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_ft_gamma(void);
-
-struct tet_testlist tet_testlist[] = {
-       { utc_ft_gamma, 1 },
-       { NULL, 0 },
-};
-
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-static void utc_ft_gamma(void)
-{
-       char buf[128];
-       int ret;
-       sprintf(buf, "cd %s && ./ftgamma", getenv("FT2_TC_ROOT_PATH"));
-       ret = system(buf);
-       if(WEXITSTATUS(ret) == 0)
-               dts_pass("utc_ft_gamma");
-       else
-               dts_fail("utc_ft_gamma");
-}
diff --git a/TC/testcase/utc_ft_grid.c b/TC/testcase/utc_ft_grid.c
deleted file mode 100755 (executable)
index bf40ec8..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <tet_api.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_ft_grid(void);
-
-struct tet_testlist tet_testlist[] = {
-       { utc_ft_grid, 1 },
-       { NULL, 0 },
-};
-
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-static void utc_ft_grid(void)
-{
-       char buf[128];
-       int ret;
-       sprintf(buf, "cd %s && ./ftgrid 10pt /usr/share/fonts/HelveticaNeueRegular.ttf ", getenv("FT2_TC_ROOT_PATH"));
-       ret = system(buf);
-       if(WEXITSTATUS(ret) == 0)
-               dts_pass("utc_ft_grid");
-       else
-               dts_fail("utc_ft_grid");
-}
diff --git a/TC/testcase/utc_ft_lint.c b/TC/testcase/utc_ft_lint.c
deleted file mode 100755 (executable)
index 3ce186f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <tet_api.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_ft_lint(void);
-
-struct tet_testlist tet_testlist[] = {
-       { utc_ft_lint, 1 },
-       { NULL, 0 },
-};
-
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-static void utc_ft_lint(void)
-{
-       char buf[128];
-       int ret;
-       sprintf(buf, "cd %s && ./ftlint 10ppem /usr/share/fonts/HelveticaNeueRegular.ttf ", getenv("FT2_TC_ROOT_PATH"));
-       ret = system(buf);
-       if(WEXITSTATUS(ret) == 0)
-               dts_pass("utc_ft_lint");
-       else
-               dts_fail("utc_ft_lint");
-}
diff --git a/TC/testcase/utc_ft_multi.c b/TC/testcase/utc_ft_multi.c
deleted file mode 100755 (executable)
index e005ceb..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <tet_api.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_ft_multi(void);
-
-struct tet_testlist tet_testlist[] = {
-       { utc_ft_multi, 1 },
-       { NULL, 0 },
-};
-
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-static void utc_ft_multi(void)
-{
-       char buf[128];
-       int ret;
-       sprintf(buf, "cd %s && ./ftmulti 10ppem /usr/share/fonts/HelveticaNeueRegular.ttf ", getenv("FT2_TC_ROOT_PATH"));
-       ret = system(buf);
-       if(WEXITSTATUS(ret) == 0)
-               dts_pass("utc_ft_multi");
-       else
-               dts_fail("utc_ft_multi");
-}
diff --git a/TC/testcase/utc_ft_string.c b/TC/testcase/utc_ft_string.c
deleted file mode 100755 (executable)
index de17b48..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <tet_api.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_ft_string(void);
-
-struct tet_testlist tet_testlist[] = {
-       { utc_ft_string, 1 },
-       { NULL, 0 },
-};
-
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-static void utc_ft_string(void)
-{
-       char buf[128];
-       int ret;
-       sprintf(buf, "cd %s && ./ftstring 10pt /usr/share/fonts/HelveticaNeueRegular.ttf ", getenv("FT2_TC_ROOT_PATH"));
-       ret = system(buf);
-       if(WEXITSTATUS(ret) == 0)
-               dts_pass("utc_ft_string");
-       else
-               dts_fail("utc_ft_string");
-}
diff --git a/TC/testcase/utc_ft_view.c b/TC/testcase/utc_ft_view.c
deleted file mode 100755 (executable)
index 33f3c5f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <tet_api.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_ft_view(void);
-
-struct tet_testlist tet_testlist[] = {
-       { utc_ft_view, 1 },
-       { NULL, 0 },
-};
-
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-static void utc_ft_view(void)
-{
-       char buf[128];
-       int ret;
-       sprintf(buf, "cd %s && ./ftview 10pt /usr/share/fonts/HelveticaNeueRegular.ttf ", getenv("FT2_TC_ROOT_PATH"));
-       ret = system(buf);
-       if(WEXITSTATUS(ret) == 0)
-               dts_pass("utc_ft_view");
-       else
-               dts_fail("utc_ft_view");
-}
diff --git a/TC/tet_scen b/TC/tet_scen
deleted file mode 100755 (executable)
index 03f029a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-all
-       ^TEST
-##### Scenarios for TEST #####
-
-# Test scenario
-TEST
-       :include:/testcase/tslist
diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg
deleted file mode 100755 (executable)
index f7eda55..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-TET_OUTPUT_CAPTURE=True # capture option for build operation checking
-TET_BUILD_TOOL=make # build with using make command
-TET_BUILD_FILE=-f Makefile # execution file (Makefile) for build
-TET_API_COMPLIANT=True # use TET API in Test Case ?
-TET_PASS_TC_NAME=True # report passed TC name in Journal file?
diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg
deleted file mode 100755 (executable)
index 02d7030..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-TET_OUTPUT_CAPTURE=True # capture option
-TET_CLEAN_TOOL= make clean # clean tool
-TET_CLEAN_FILE= Makefile # file for clean
-TET_API_COMPLIANT=True # TET API useage 
-TET_PASS_TC_NAME=True # showing name , passed TC
diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg
deleted file mode 100755 (executable)
index ef3e452..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-TET_OUTPUT_CAPTURE=True # capturing execution or not
-TET_EXEC_TOOL=  # ex) exec : execution tool set up/ Optional
-TET_EXEC_FILE=   # ex) exectool : execution file/ Optional
-TET_API_COMPLIANT=True # Test case or Tool usesTET API?
-TET_PASS_TC_NAME=True # showing Passed TC name ?
old mode 100644 (file)
new mode 100755 (executable)
index 9f2fb6a..cc0e661
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright 2005, 2006, 2007, 2008, 2009, 2010 by
+# Copyright 2005-2010, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -55,7 +55,7 @@ compare_to_minimum_version ()
   if test $MAJOR1 -lt $MAJOR2; then
     echo 0
     return
-  else 
+  else
     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
-  else 
+  else
     if test $MINOR1 -gt $MINOR2; then
       echo 1
       return
@@ -139,7 +139,7 @@ check_tool_version $LIBTOOLIZE libtoolize LIBTOOLIZE 2.2.4
 check_tool_version $AUTOCONF   autoconf   AUTOCONF   2.62
 
 # This sets freetype_major, freetype_minor, and freetype_patch.
-eval `sed -nf version.sed include/freetype/freetype.h`
+eval `sed -nf version.sed include/freetype.h`
 
 # We set freetype-patch to an empty value if it is zero.
 if test "$freetype_patch" = ".0"; then
index 2b8f8e8..85fcc43 100644 (file)
@@ -1,7 +1,7 @@
 
 README for the builds/amiga subdirectory.
 
-Copyright 2005 by
+Copyright 2005, 2013 by
 Werner Lemberg and Detlef Würkner.
 
 This file is part of the FreeType project, and may only be used, modified,
@@ -51,8 +51,8 @@ directory.  The results are:
 
 - ftdebug.o, an object module containing the standard version of the
   debugging code which uses vprintf() and exit() (not pure).
-  Debugging can be turned on in FT:include/freetype/config/ftoption.h
-  and with FT_SetTraceLevel().
+  Debugging can be turned on in FT:include/config/ftoption.h and with
+  FT_SetTraceLevel().
 
 - ftdebugpure.o, an object module containing the pure version of the
   debugging code which uses KVPrintf() from lib:debug.lib and no
@@ -64,15 +64,14 @@ directory.  The results are:
   ftsystem.o would force ALL FreeType2 modules to be linked to your
   program, I decided to use a different scheme: You must #include
   FT:src/base/ftinit.c in your sourcecode and specify with #define
-  statements which modules you need.  See
-  include/freetype/config/ftmodule.h.
+  statements which modules you need.  See include/config/ftmodule.h.
 
 
 To use in your own programs:
 
 - Insert the #define and #include statements from top of
-  include/freetype/config/ftmodule.h in your source code and uncomment
-  the #define statements for the FreeType2 modules you need.
+  include/config/ftmodule.h in your source code and uncomment the
+  #define statements for the FreeType2 modules you need.
 
 - You can use either PARAMETERS=REGISTER or PARAMETERS=STACK for
   calling the FreeType2 functions, because the link library and the
similarity index 90%
rename from builds/amiga/include/freetype/config/ftconfig.h
rename to builds/amiga/include/config/ftconfig.h
index c2c2ac8..a73ace6 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Amiga-specific configuration file (specification only).              */
 /*                                                                         */
-/*  Copyright 2005, 2006, 2007 by                                          */
+/*  Copyright 2005-2007, 2013 by                                           */
 /*  Werner Lemberg and Detlef Würkner.                                     */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -34,9 +34,9 @@
 /* Now include the original file */
 #ifndef __MORPHOS__
 #ifdef __SASC
-#include "FT:include/freetype/config/ftconfig.h"
+#include "FT:include/config/ftconfig.h"
 #else
-#include "/FT/include/freetype/config/ftconfig.h"
+#include "/FT/include/config/ftconfig.h"
 #endif
 #else
 /* We must define that, it seems that
@@ -45,7 +45,7 @@
  * binaries from http://www.morphos.de)
  */
 #define _LIBC_LIMITS_H_
-#include "/FT/include/freetype/config/ftconfig.h"
+#include "/FT/include/config/ftconfig.h"
 #endif
 
 /*
index 379883d..8a1e4c6 100644 (file)
@@ -5,7 +5,7 @@
 #
 
 
-# Copyright 2005, 2006, 2007, 2009 by
+# Copyright 2005-2007, 2009, 2013 by
 # Werner Lemberg and Detlef Würkner.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -43,7 +43,7 @@
 #
 # link your programs with libft2_ppc.a and either ftsystem.ppc.o or ftsystempure.ppc.o
 # (and either ftdebug.ppc.o or ftdebugpure.ppc.o if you enabled FT_DEBUG_LEVEL_ERROR or
-# FT_DEBUG_LEVEL_TRACE in include/freetype/config/ftoption.h).
+# FT_DEBUG_LEVEL_TRACE in include/config/ftoption.h).
 
 all:   libft2_ppc.a ftsystem.ppc.o ftsystempure.ppc.o
 
index 13758bc..a2e6ffc 100644 (file)
@@ -4,7 +4,7 @@
 #
 
 
-# Copyright 2005, 2006, 2007, 2009 by
+# Copyright 2005-2007, 2009, 2013 by
 # Werner Lemberg and Detlef Würkner.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -40,7 +40,7 @@
 #
 # link your programs with libft2_ppc.a and either ftsystem.ppc.o or ftsystempure.ppc.o
 # (and either ftdebug.ppc.o or ftdebugpure.ppc.o if you enabled FT_DEBUG_LEVEL_ERROR or
-# FT_DEBUG_LEVEL_TRACE in include/freetype/config/ftoption.h).
+# FT_DEBUG_LEVEL_TRACE in include/config/ftoption.h).
 
 all:   assign libft2_ppc.a ftsystem.ppc.o ftsystempure.ppc.o
 
index 097aec9..aee7fb9 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 2005,2006, 2007, 2009 by
+# Copyright 2005-2007, 2009, 2013 by
 # Werner Lemberg and Detlef Würkner.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -40,7 +40,7 @@
 #
 # link your programs with ft2_680x0.lib and either ftsystem.o or ftsystempure.o
 # (and either ftdebug.o or ftdebugpure.o if you enabled FT_DEBUG_LEVEL_ERROR or
-# FT_DEBUG_LEVEL_TRACE in include/freetype/config/ftoption.h).
+# FT_DEBUG_LEVEL_TRACE in include/config/ftoption.h).
 
 OBJBASE = ftbase.o ftbbox.o ftbdf.o ftbitmap.o ftcid.o ftfstype.o ftgasp.o   \
          ftglyph.o ftgxval.o ftlcdfil.o ftmm.o ftotval.o ftpatent.o ftpfr.o \
index 5284e69..39688af 100644 (file)
@@ -2,9 +2,9 @@
 /*                                                                         */
 /*  ftdebug.c                                                              */
 /*                                                                         */
-/*    Debugging and logging component (body).                              */
+/*    Debugging and logging component for amiga (body).                    */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004, 2005 by                               */
+/*  Copyright 1996-2002, 2004, 2005, 2013 by                               */
 /*  David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner.       */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   /*************************************************************************/
 
 
-/*
- * Based on the default ftdebug.c,
- * replaced vprintf() with KVPrintF(),
- * commented out exit(),
- * replaced getenv() with GetVar().
- */
+  /*
  * Based on the default ftdebug.c,
  * replaced vprintf() with KVPrintF(),
  * commented out exit(),
  * replaced getenv() with GetVar().
  */
 
 #include <exec/types.h>
 #include <utility/tagitem.h>
@@ -59,9 +59,9 @@
 #include <clib/debug_protos.h>
 
 #ifndef __amigaos4__
-extern struct Library *DOSBase;
+  extern struct Library *DOSBase;
 #else
-extern struct DOSIFace *IDOS;
+  extern struct DOSIFace *IDOS;
 #endif
 
 
@@ -75,13 +75,13 @@ extern struct DOSIFace *IDOS;
   /* documentation is in ftdebug.h */
 
   FT_BASE_DEF( void )
-  FT_Message( const char*  fmt, ... )
+  FT_Message( const char*  fmt,
+              ... )
   {
     va_list  ap;
 
 
     va_start( ap, fmt );
-/*  vprintf( fmt, ap ); */
     KVPrintF( fmt, ap );
     va_end( ap );
   }
@@ -90,19 +90,34 @@ extern struct DOSIFace *IDOS;
   /* documentation is in ftdebug.h */
 
   FT_BASE_DEF( void )
-  FT_Panic( const char*  fmt, ... )
+  FT_Panic( const char*  fmt,
+            ... )
   {
     va_list  ap;
 
 
     va_start( ap, fmt );
-/*  vprintf( fmt, ap ); */
     KVPrintF( fmt, ap );
     va_end( ap );
 
 /*  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 */
 
 
@@ -161,7 +176,7 @@ extern struct DOSIFace *IDOS;
   /* the memory and stream components which are set to 7 and 5,            */
   /* respectively.                                                         */
   /*                                                                       */
-  /* See the file <include/freetype/internal/fttrace.h> for details of the */
+  /* See the file <include/internal/fttrace.h> for details of the          */
   /* available toggle names.                                               */
   /*                                                                       */
   /* The level must be between 0 and 7; 0 means quiet (except for serious  */
@@ -193,6 +208,9 @@ extern struct DOSIFace *IDOS;
         while ( *p && *p != ':' )
           p++;
 
+        if ( !*p )
+          break;
+
         if ( *p == ':' && p > q )
         {
           FT_Int  n, i, len = (FT_Int)( p - q );
@@ -221,7 +239,7 @@ extern struct DOSIFace *IDOS;
           p++;
           if ( *p )
           {
-            level = *p++ - '0';
+            level = *p - '0';
             if ( level < 0 || level > 7 )
               level = -1;
           }
index 6f9eac1..42a552d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Amiga-specific FreeType low-level system interface (body).           */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2005, 2006, 2007, 2010 by                   */
+/*  Copyright 1996-2002, 2005-2007, 2010, 2013 by                          */
 /*  David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner.       */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -386,7 +386,7 @@ Free_VecPooled( APTR  poolHeader,
 
 
     if ( !stream )
-      return FT_Err_Invalid_Stream_Handle;
+      return FT_THROW( Invalid_Stream_Handle );
 
 #ifdef __amigaos4__
     sysfile = AllocMem ( sizeof (struct SysFile ), MEMF_SHARED );
@@ -398,7 +398,7 @@ Free_VecPooled( APTR  poolHeader,
       FT_ERROR(( "FT_Stream_Open:" ));
       FT_ERROR(( " could not open `%s'\n", filepathname ));
 
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
     }
     sysfile->file = Open( (STRPTR)filepathname, MODE_OLDFILE );
     if ( !sysfile->file )
@@ -407,7 +407,7 @@ Free_VecPooled( APTR  poolHeader,
       FT_ERROR(( "FT_Stream_Open:" ));
       FT_ERROR(( " could not open `%s'\n", filepathname ));
 
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
     }
 
     fib = AllocDosObject( DOS_FIB, NULL );
@@ -418,7 +418,7 @@ Free_VecPooled( APTR  poolHeader,
       FT_ERROR(( "FT_Stream_Open:" ));
       FT_ERROR(( " could not open `%s'\n", filepathname ));
 
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
     }
     if ( !( ExamineFH( sysfile->file, fib ) ) )
     {
@@ -428,7 +428,7 @@ Free_VecPooled( APTR  poolHeader,
       FT_ERROR(( "FT_Stream_Open:" ));
       FT_ERROR(( " could not open `%s'\n", filepathname ));
 
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
     }
     stream->size = fib->fib_Size;
     FreeDosObject( DOS_FIB, fib );
@@ -447,7 +447,7 @@ Free_VecPooled( APTR  poolHeader,
       ft_amiga_stream_close( stream );
       FT_ERROR(( "FT_Stream_Open:" ));
       FT_ERROR(( " opened `%s' but zero-sized\n", filepathname ));
-      return FT_Err_Cannot_Open_Stream;;
+      return FT_THROW( Cannot_Open_Stream );
     }
 
     FT_TRACE1(( "FT_Stream_Open:" ));
index c872a70..16d9e6d 100644 (file)
@@ -15,7 +15,7 @@ function shift( array, \
 function init_cpp_src_line()
 {
   logical_line = ""
-  delete break_pos 
+  delete break_pos
 }
 
 
@@ -110,8 +110,8 @@ function shrink_spaces_to_linebreak( pos, \
 {
   for ( i = 0; i < asorti( break_pos, junk ) && break_pos[i] < pos ; i++ )
     ;
-  if ( break_pos[i] < 1 ) 
+
+  if ( break_pos[i] < 1 )
     return;
 
   part_str = substr( logical_line, pos, break_pos[i] - pos + 1 )
diff --git a/builds/cmake/iOS.cmake b/builds/cmake/iOS.cmake
new file mode 100644 (file)
index 0000000..a41a7ac
--- /dev/null
@@ -0,0 +1,275 @@
+# iOS.cmake
+#
+# Copyright 2014 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# Written by David Wimsey <david@wimsey.us>
+#
+# 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 derived from the files `Platform/Darwin.cmake' and
+# `Platform/UnixPaths.cmake', which are part of CMake 2.8.4.  It has been
+# altered for iOS development.
+
+
+# Options
+# -------
+#
+#   IOS_PLATFORM = OS | SIMULATOR
+#
+#     This decides whether SDKS are selected from the `iPhoneOS.platform' or
+#     `iPhoneSimulator.platform' folders.
+#
+#     OS - the default, used to build for iPhone and iPad physical devices,
+#       which have an ARM architecture.
+#     SIMULATOR - used to build for the Simulator platforms, which have an
+#       x86 architecture.
+#
+#   CMAKE_IOS_DEVELOPER_ROOT = /path/to/platform/Developer folder
+#
+#     By default, this location is automatically chosen based on the
+#     IOS_PLATFORM value above.  If you manually set this variable, it
+#     overrides the default location and forces the use of a particular
+#     Developer Platform.
+#
+#   CMAKE_IOS_SDK_ROOT = /path/to/platform/Developer/SDKs/SDK folder
+#
+#     By default, this location is automatically chosen based on the
+#     CMAKE_IOS_DEVELOPER_ROOT value.  In this case it is always the most
+#     up-to-date SDK found in the CMAKE_IOS_DEVELOPER_ROOT path.  If you
+#     manually set this variable, it forces the use of a specific SDK
+#     version.
+#
+#
+# Macros
+# ------
+#
+#   set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE)
+#
+#     A convenience macro for setting Xcode specific properties on targets.
+#
+#     Example:
+#
+#       set_xcode_property(myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1")
+#
+#   find_host_package (PROGRAM ARGS)
+#
+#     A macro to find executable programs on the host system, not within the
+#     iOS environment.  Thanks to the `android-cmake' project for providing
+#     the command.
+
+
+# standard settings
+set(CMAKE_SYSTEM_NAME Darwin)
+set(CMAKE_SYSTEM_VERSION 1)
+set(UNIX True)
+set(APPLE True)
+set(IOS True)
+
+# required as of cmake 2.8.10
+set(CMAKE_OSX_DEPLOYMENT_TARGET ""
+  CACHE STRING "Force unset of the deployment target for iOS" FORCE
+)
+
+# determine the cmake host system version so we know where to find the iOS
+# SDKs
+find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin)
+if (CMAKE_UNAME)
+  exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
+  string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1"
+    DARWIN_MAJOR_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
+endif (CMAKE_UNAME)
+
+# force the compilers to gcc for iOS
+include(CMakeForceCompiler)
+CMAKE_FORCE_C_COMPILER(gcc gcc)
+CMAKE_FORCE_CXX_COMPILER(g++ g++)
+
+# skip the platform compiler checks for cross compiling
+set(CMAKE_CXX_COMPILER_WORKS TRUE)
+set(CMAKE_C_COMPILER_WORKS TRUE)
+
+# all iOS/Darwin specific settings - some may be redundant
+set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
+set(CMAKE_SHARED_MODULE_PREFIX "lib")
+set(CMAKE_SHARED_MODULE_SUFFIX ".so")
+set(CMAKE_MODULE_EXISTS 1)
+set(CMAKE_DL_LIBS "")
+
+set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG
+  "-compatibility_version ")
+set(CMAKE_C_OSX_CURRENT_VERSION_FLAG
+  "-current_version ")
+set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG
+  "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
+set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG
+  "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
+
+# hidden visibility is required for cxx on iOS
+set(CMAKE_C_FLAGS_INIT "")
+set(CMAKE_CXX_FLAGS_INIT
+  "-headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden")
+
+set(CMAKE_C_LINK_FLAGS
+  "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
+set(CMAKE_CXX_LINK_FLAGS
+  "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
+
+set(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS
+  "-dynamiclib -headerpad_max_install_names")
+set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+  "-bundle -headerpad_max_install_names")
+set(CMAKE_SHARED_MODULE_LOADER_C_FLAG
+  "-Wl,-bundle_loader,")
+set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG
+  "-Wl,-bundle_loader,")
+set(CMAKE_FIND_LIBRARY_SUFFIXES
+  ".dylib" ".so" ".a")
+
+# hack: If a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old
+#       build tree (where `install_name_tool' was hardcoded), and where
+#       CMAKE_INSTALL_NAME_TOOL isn't in the cache and still cmake didn't
+#       fail in `CMakeFindBinUtils.cmake' (because it isn't rerun), hardcode
+#       CMAKE_INSTALL_NAME_TOOL here to `install_name_tool' so it behaves as
+#       it did before.
+if (NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
+  find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool)
+endif (NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
+
+# set up iOS platform unless specified manually with IOS_PLATFORM
+if (NOT DEFINED IOS_PLATFORM)
+  set(IOS_PLATFORM "OS")
+endif (NOT DEFINED IOS_PLATFORM)
+
+set(IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING "Type of iOS Platform")
+
+# check the platform selection and setup for developer root
+if (${IOS_PLATFORM} STREQUAL "OS")
+  set(IOS_PLATFORM_LOCATION "iPhoneOS.platform")
+
+  # this causes the installers to properly locate the output libraries
+  set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos")
+
+elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR")
+  set(IOS_PLATFORM_LOCATION "iPhoneSimulator.platform")
+
+  # this causes the installers to properly locate the output libraries
+  set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator")
+
+else (${IOS_PLATFORM} STREQUAL "OS")
+  message(FATAL_ERROR
+    "Unsupported IOS_PLATFORM value selected.  Please choose OS or SIMULATOR.")
+
+endif (${IOS_PLATFORM} STREQUAL "OS")
+
+# set up iOS developer location unless specified manually with
+# CMAKE_IOS_DEVELOPER_ROOT --
+# note that Xcode 4.3 changed the installation location; choose the most
+# recent one available
+set(XCODE_POST_43_ROOT
+  "/Applications/Xcode.app/Contents/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
+set(XCODE_PRE_43_ROOT
+  "/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
+
+if (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT)
+  if (EXISTS ${XCODE_POST_43_ROOT})
+    set(CMAKE_IOS_DEVELOPER_ROOT ${XCODE_POST_43_ROOT})
+  elseif (EXISTS ${XCODE_PRE_43_ROOT})
+    set(CMAKE_IOS_DEVELOPER_ROOT ${XCODE_PRE_43_ROOT})
+  endif (EXISTS ${XCODE_POST_43_ROOT})
+endif (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT)
+
+set(CMAKE_IOS_DEVELOPER_ROOT ${CMAKE_IOS_DEVELOPER_ROOT}
+  CACHE PATH "Location of iOS Platform"
+)
+
+# find and use the most recent iOS SDK unless specified manually with
+# CMAKE_IOS_SDK_ROOT
+if (NOT DEFINED CMAKE_IOS_SDK_ROOT)
+  file(GLOB _CMAKE_IOS_SDKS "${CMAKE_IOS_DEVELOPER_ROOT}/SDKs/*")
+  if (_CMAKE_IOS_SDKS)
+    list(SORT _CMAKE_IOS_SDKS)
+    list(REVERSE _CMAKE_IOS_SDKS)
+    list(GET _CMAKE_IOS_SDKS 0 CMAKE_IOS_SDK_ROOT)
+  else (_CMAKE_IOS_SDKS)
+    message(FATAL_ERROR
+      "No iOS SDK's found in default search path ${CMAKE_IOS_DEVELOPER_ROOT}.  Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK.")
+  endif (_CMAKE_IOS_SDKS)
+
+  message(STATUS "Toolchain using default iOS SDK: ${CMAKE_IOS_SDK_ROOT}")
+endif (NOT DEFINED CMAKE_IOS_SDK_ROOT)
+
+set(CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_SDK_ROOT}
+  CACHE PATH "Location of the selected iOS SDK"
+)
+
+# set the sysroot default to the most recent SDK
+set(CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT}
+  CACHE PATH "Sysroot used for iOS support"
+)
+
+# set the architecture for iOS --
+# note that currently both ARCHS_STANDARD_32_BIT and
+# ARCHS_UNIVERSAL_IPHONE_OS set armv7 only, so set both manually
+if (${IOS_PLATFORM} STREQUAL "OS")
+  set(IOS_ARCH $(ARCHS_STANDARD_32_64_BIT))
+else (${IOS_PLATFORM} STREQUAL "OS")
+  set(IOS_ARCH i386)
+endif (${IOS_PLATFORM} STREQUAL "OS")
+
+set(CMAKE_OSX_ARCHITECTURES ${IOS_ARCH}
+  CACHE string "Build architecture for iOS"
+)
+
+# set the find root to the iOS developer roots and to user defined paths
+set(CMAKE_FIND_ROOT_PATH
+  ${CMAKE_IOS_DEVELOPER_ROOT}
+  ${CMAKE_IOS_SDK_ROOT}
+  ${CMAKE_PREFIX_PATH}
+  CACHE string  "iOS find search path root"
+)
+
+# default to searching for frameworks first
+set(CMAKE_FIND_FRAMEWORK FIRST)
+
+# set up the default search directories for frameworks
+set(CMAKE_SYSTEM_FRAMEWORK_PATH
+  ${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks
+  ${CMAKE_IOS_SDK_ROOT}/System/Library/PrivateFrameworks
+  ${CMAKE_IOS_SDK_ROOT}/Developer/Library/Frameworks
+)
+
+# only search the iOS SDKs, not the remainder of the host filesystem
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+# this little macro lets you set any Xcode specific property
+macro(set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE)
+  set_property(TARGET ${TARGET}
+    PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY} ${XCODE_VALUE})
+endmacro(set_xcode_property)
+
+# this macro lets you find executable programs on the host system
+macro(find_host_package)
+  set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+  set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
+  set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
+  set(IOS FALSE)
+
+  find_package(${ARGN})
+
+  set(IOS TRUE)
+  set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
+  set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+  set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+endmacro(find_host_package)
+
+# eof
index 63a46ad..42a99b0 100644 (file)
@@ -53,7 +53,7 @@ L :=
 # Target flag -- no trailing space.
 #
 T  := -o
-TE := -e 
+TE := -e
 
 
 # C flags
index 987ae51..ff4045d 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2001, 2002, 2003, 2006, 2008 by
+# Copyright 1996-2003, 2006, 2008, 2013, 2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -17,8 +17,8 @@
 # the following variables:
 #
 #   BUILD_DIR    The configuration and system-specific directory.  Usually
-#                `freetype/builds/$(PLATFORM)' but can be different for
-#                custom builds of the library.
+#                `builds/$(PLATFORM)' but can be different for custom builds
+#                of the library.
 #
 # The following variables must be defined in system specific `detect.mk'
 # files:
@@ -124,7 +124,7 @@ std_setup:
        @echo "\`$(CONFIG_MK)' from this directory then read the INSTALL file for help."
        @echo ""
        @echo "Otherwise, simply type \`$(MAKE)' again to build the library,"
-       @echo "or \`$(MAKE) refdoc' to build the API reference (the latter needs python)."
+       @echo "or \`$(MAKE) refdoc' to build the API reference (this needs python >= 2.6)."
        @echo ""
        @$(COPY) $(CONFIG_RULES) $(CONFIG_MK)
 
@@ -146,7 +146,7 @@ dos_setup:
        @echo '$(CONFIG_MK)' from this directory then read the INSTALL file for help.
        @type builds$(SEP)newline
        @echo Otherwise, simply type 'make' again to build the library.
-       @echo or 'make refdoc' to build the API reference (the latter needs python).
+       @echo or 'make refdoc' to build the API reference (this needs python >= 2.6).
        @type builds$(SEP)newline
        @$(COPY) $(subst /,$(SEP),$(CONFIG_RULES) $(CONFIG_MK)) > nul
 
index 700a122..3e5e967 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2004, 2006 by
+# Copyright 1996-2000, 2003, 2004, 2006, 2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -45,12 +45,12 @@ ifeq ($(PLATFORM),ansi)
       endif
 
       # We also try to recognize Dos 7.x without Windows 9X launched.
-      # See builds/win32/detect.mk for explanations about the logic.
+      # See builds/windows/detect.mk for explanations about the logic.
       #
       ifeq ($(is_dos),)
         ifdef winbootdir
 #ifneq ($(OS),Windows_NT)
-          # If win32 is available, do not trigger this test.
+          # If windows is available, do not trigger this test.
           ifndef windir
             is_dos := $(findstring Windows,$(strip $(shell ver)))
           endif
@@ -124,7 +124,7 @@ ifeq ($(PLATFORM),dos)
     CAT    := type
 
     # Setting COPY is a bit trickier.  We can be running DJGPP on some
-    # Windows NT derivatives, like XP.  See builds/win32/detect.mk for
+    # Windows NT derivatives, like XP.  See builds/windows/detect.mk for
     # explanations why we need hacking here.
     #
     ifeq ($(OS),Windows_NT)
index 52f2912..96b10db 100644 (file)
@@ -51,7 +51,7 @@ ifneq ($(EXPORTS_LIST),)
   APINAMES_EXE := $(subst /,$(SEP),$(OBJ_DIR)/apinames$(E_BUILD))
 
   $(APINAMES_EXE): $(APINAMES_SRC)
-         $(CCexe) $(TE)$@ $<
+         $(CCexe) $(CCexe_CFLAGS) $(TE)$@ $< $(CCexe_LDFLAGS)
 
   .PHONY: symbols_list
 
index 7a89c8e..8b2e2ea 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 by
+# Copyright 1996-2006, 2008, 2013, 2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -97,7 +97,7 @@ BASE_DIR := $(SRC_DIR)/base
 
 # Other derived directories.
 #
-PUBLIC_DIR   := $(TOP_DIR)/include/freetype
+PUBLIC_DIR   := $(TOP_DIR)/include
 INTERNAL_DIR := $(PUBLIC_DIR)/internal
 SERVICES_DIR := $(INTERNAL_DIR)/services
 CONFIG_DIR   := $(PUBLIC_DIR)/config
@@ -116,8 +116,8 @@ PROJECT_LIBRARY := $(LIB_DIR)/$(LIBRARY).$A
 # IMPORTANT NOTE: The architecture-dependent directory must ALWAYS be placed
 #                 before the standard include list.  Porters are then able to
 #                 put their own version of some of the FreeType components
-#                 in the `freetype/builds/<system>' directory, as these
-#                 files will override the default sources.
+#                 in the `builds/<system>' directory, as these files will
+#                 override the default sources.
 #
 INCLUDES := $(subst /,$(COMPILER_SEP),$(OBJ_DIR) \
                                       $(DEVEL_DIR) \
@@ -126,6 +126,14 @@ INCLUDES := $(subst /,$(COMPILER_SEP),$(OBJ_DIR) \
 
 INCLUDE_FLAGS := $(INCLUDES:%=$I%)
 
+ifdef DEVEL_DIR
+  # We assume that all library dependencies for FreeType are fulfilled for a
+  # development build, so we directly access the necessary include directory
+  # information using `pkg-config'.
+  INCLUDE_FLAGS += $(shell pkg-config --cflags libpng \
+                                               harfbuzz )
+endif
+
 
 # C flags used for the compilation of an object file.  This must include at
 # least the paths for the `base' and `builds/<system>' directories;
@@ -147,13 +155,14 @@ ifneq ($(wildcard $(OBJ_DIR)/ftoption.h),)
   FTOPTION_FLAG := $DFT_CONFIG_OPTIONS_H="<ftoption.h>"
 endif
 
+# Note that a build with the `configure' script uses $(CFLAGS) only.
+#
 FT_CFLAGS  = $(CPPFLAGS) \
              $(INCLUDE_FLAGS) \
              $(CFLAGS) \
              $DFT2_BUILD_LIBRARY \
              $DFT_CONFIG_MODULES_H="<ftmodule.h>" \
              $(FTOPTION_FLAG)
-FT_CC      = $(CC) $(FT_CFLAGS)
 FT_COMPILE = $(CC) $(ANSIFLAGS) $(FT_CFLAGS)
 
 
@@ -178,7 +187,7 @@ PUBLIC_H   := $(wildcard $(PUBLIC_DIR)/*.h)
 INTERNAL_H := $(wildcard $(INTERNAL_DIR)/*.h) \
               $(wildcard $(SERVICES_DIR)/*.h)
 CONFIG_H   := $(wildcard $(CONFIG_DIR)/*.h) \
-              $(wildcard $(BUILD_DIR)/freetype/config/*.h) \
+              $(wildcard $(BUILD_DIR)/config/*.h) \
               $(FTMODULE_H) \
               $(FTOPTION_H)
 DEVEL_H    := $(wildcard $(TOP_DIR)/devel/*.h)
@@ -261,8 +270,6 @@ objects: $(OBJECTS_LIST)
 
 library: $(PROJECT_LIBRARY)
 
-dll: $(PROJECT_LIBRARY) exported_symbols
-
 .c.$O:
        $(FT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
 
@@ -290,19 +297,16 @@ ifneq ($(findstring refdoc,$(MAKECMDGOALS)),)
   version := $(major).$(minor).$(patch)
 endif
 
-# We write-protect the docmaker directory to suppress generation
-# of .pyc files.
+# Option `-B' disables generation of .pyc files (available since python 2.6)
 #
 refdoc:
-       -chmod -w $(SRC_DIR)/tools/docmaker
-       python $(SRC_DIR)/tools/docmaker/docmaker.py \
-               --prefix=ft2                          \
-               --title=FreeType-$(version)           \
-               --output=$(DOC_DIR)                   \
-               $(PUBLIC_DIR)/*.h                     \
-               $(PUBLIC_DIR)/config/*.h              \
-               $(PUBLIC_DIR)/cache/*.h
-       -chmod +w $(SRC_DIR)/tools/docmaker
+       python -B $(SRC_DIR)/tools/docmaker/docmaker.py \
+                  --prefix=ft2                          \
+                  --title=FreeType-$(version)           \
+                  --output=$(DOC_DIR)                   \
+                  $(PUBLIC_DIR)/*.h                     \
+                  $(PUBLIC_DIR)/config/*.h              \
+                  $(PUBLIC_DIR)/cache/*.h
 
 
 .PHONY: clean_project_std distclean_project_std
index bd3df8a..f58e47d 100644 (file)
@@ -1,8 +1,8 @@
 This folder contains
 
-  * Makefile skeltons for Apple MPW (Macintosh's Programmers Workshop)
+  * Makefile skeletons for Apple MPW (Macintosh's Programmer's Workshop)
 
-  * Python script to generate MPW makefile from skelton
+  * Python script to generate MPW makefile from skeleton
 
   * Metrowerks CodeWarrior 9.0 project file in XML format
 
@@ -51,7 +51,7 @@ environment by Metrowerks. GCC for MPW and Symantec
   Also you can find documents how to update by MPW-PR.
 
   Python is required to restore MPW makefiles from the
-  skeltons. Python bundled to Mac OS X is enough. For
+  skeletons. Python bundled to Mac OS X is enough. For
   classic MacOS, MacPython is available:
 
       http://homepages.cwi.nl/~jack/macpython/
@@ -78,10 +78,10 @@ environment by Metrowerks. GCC for MPW and Symantec
   Detailed building procedure by Apple MPW is
   described in following.
 
-    3-1-1. Generate MPW makefiles from the skeltons
+    3-1-1. Generate MPW makefiles from the skeletons
     ------------------------------------------------
 
-    Here are 4 skeltons for following targets are
+    Here are 4 skeletons for following targets are
     included.
 
     - FreeType.m68k_far.make.txt
@@ -109,7 +109,7 @@ environment by Metrowerks. GCC for MPW and Symantec
 
     MPW makefile syntax uses 8bit characters. To keep
     from violating them during version control, here
-    we store skeltons in pure ASCII format. You must
+    we store skeletons in pure ASCII format. You must
     generate MPW makefile by Python script ascii2mpw.py.
 
     In Mac OS X terminal, you can convert as:
@@ -118,10 +118,10 @@ environment by Metrowerks. GCC for MPW and Symantec
                < builds/mac/FreeType.m68k_far.make.txt \
                > FreeType.m68k_far.make
 
-    The skeltons are designed to use in the top
+    The skeletons are designed to use in the top
     directory where there are builds, include, src etc.
     You must name the generated MPW makefile by removing
-    ".txt" from source skelton name.
+    ".txt" from source skeleton name.
 
     3-1-2. Add resource forks to related files
     ------------------------------------------
@@ -392,12 +392,10 @@ ATSFontGetFileSpecification()         |    x    |    x    |    x    |    x    |
     ATS font manager is not published in these versions.
 
 ------------------------------------------------------------
-Last update: 2009-Jul-25.
+Last update: 2013-Nov-03.
 
 Currently maintained by
        suzuki toshiya, <mpsuzuki@hiroshima-u.ac.jp>
 Originally prepared by
        Leonard Rosenthol, <leonardr@lazerware.com>
        Just van Rossum, <just@letterror.com>
-
-This directory is now actively maintained as part of the FreeType Project.
diff --git a/builds/mac/freetype-Info.plist b/builds/mac/freetype-Info.plist
new file mode 100644 (file)
index 0000000..b3d114d
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
+          "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+
+<plist version="1.0">
+
+<dict>
+  <key>CFBundleDevelopmentRegion</key>
+  <string>English</string>
+
+  <key>CFBundleExecutable</key>
+  <string>FreeType</string>
+
+  <key>CFBundleGetInfoString</key>
+  <string>FreeType ${PROJECT_VERSION}</string>
+
+  <key>CFBundleInfoDictionaryVersion</key>
+  <string>6.0</string>
+
+  <key>CFBundleName</key>
+  <string>FreeType</string>
+
+  <key>CFBundlePackageType</key>
+  <string>FMWK</string>
+
+  <key>CFBundleShortVersionString</key>
+  <string>${PROJECT_VERSION}</string>
+
+  <key>CFBundleSignature</key>
+  <string>????</string>
+
+  <key>CFBundleVersion</key>
+  <string>${PROJECT_VERSION}</string>
+</dict>
+
+</plist>
index 719dd0c..27b5511 100644 (file)
@@ -5,7 +5,7 @@
 /*    Mac FOND support.  Written by just@letterror.com.                    */
 /*  Heavily Fixed by mpsuzuki, George Williams and Sean McBride            */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by       */
+/*  Copyright 1996-2008, 2013, 2014 by                                     */
 /*  Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.     */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -184,7 +184,7 @@ typedef short ResourceIndex;
     FT_UNUSED( pathSpec );
     FT_UNUSED( face_index );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
   }
 
 #else
@@ -204,6 +204,9 @@ typedef short ResourceIndex;
     FMFontFamily          family   = 0;
 
 
+    if ( !fontName || !face_index )
+      return FT_THROW( Invalid_Argument );
+
     *face_index = 0;
     while ( status == 0 && !the_font )
     {
@@ -270,7 +273,7 @@ typedef short ResourceIndex;
       return FT_Err_Ok;
     }
     else
-      return FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
   }
 
 #endif /* HAVE_QUICKDRAW_CARBON */
@@ -323,10 +326,10 @@ typedef short ResourceIndex;
     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 ) )
-      return FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     /* face_index calculation by searching preceding fontIDs */
     /* with same FSRef                                       */
@@ -365,7 +368,7 @@ typedef short ResourceIndex;
     FT_UNUSED( maxPathSize );
     FT_UNUSED( face_index );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
   }
 
 #else
@@ -381,11 +384,11 @@ typedef short ResourceIndex;
 
 
     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 FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     return FT_Err_Ok;
   }
@@ -404,7 +407,7 @@ typedef short ResourceIndex;
     FT_UNUSED( pathSpec );
     FT_UNUSED( face_index );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
   }
 
 #else
@@ -420,12 +423,12 @@ typedef short ResourceIndex;
 
 
     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 FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     return FT_Err_Ok;
   }
@@ -580,7 +583,7 @@ typedef short ResourceIndex;
 
 
     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 );
@@ -598,7 +601,7 @@ typedef short ResourceIndex;
 
 
     if ( noErr != FT_FSPathMakeSpec( pathname, &spec, FALSE ) )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     /* at present, no support for dfont format without FSRef */
     /* (see above), try original resource-fork font          */
@@ -696,11 +699,9 @@ typedef short ResourceIndex;
   count_faces_scalable( char*  fond_data )
   {
     AsscEntry*  assoc;
-    FamRec*     fond;
     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 );
@@ -847,17 +848,17 @@ typedef short ResourceIndex;
     /* 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 ) )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     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 )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     /* now we have absolute dirname in path_lwfn */
     if ( path_lwfn[0] == '/' )
@@ -870,11 +871,11 @@ typedef short ResourceIndex;
     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 ) )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     return FT_Err_Ok;
 
@@ -886,7 +887,7 @@ typedef short ResourceIndex;
 
     /* pathname for FSSpec is always HFS format */
     if ( ft_strlen( (char *)path_fond ) > path_size )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     ft_strcpy( (char *)path_lwfn, (char *)path_fond );
 
@@ -895,7 +896,7 @@ typedef short ResourceIndex;
       i--;
 
     if ( i + 1 + base_lwfn[0] > path_size )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     if ( ':' == path_lwfn[i] )
     {
@@ -909,7 +910,7 @@ typedef short ResourceIndex;
     }
 
     if ( noErr != FT_FSPathMakeSpec( path_lwfn, &spec, FALSE ) )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     return FT_Err_Ok;
 
@@ -1003,7 +1004,7 @@ typedef short ResourceIndex;
       /* detect integer overflows */
       if ( total_size < old_total_size )
       {
-        error = FT_Err_Array_Too_Large;
+        error = FT_ERR( Array_Too_Large );
         goto Error;
       }
 
@@ -1088,7 +1089,7 @@ typedef short ResourceIndex;
 
 
     if ( noErr != FT_FSPathMakeRes( pathname, &res ) )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     pfb_data = NULL;
     pfb_size = 0;
@@ -1123,7 +1124,7 @@ typedef short ResourceIndex;
 
     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 ) )
@@ -1182,23 +1183,26 @@ typedef short ResourceIndex;
                              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;
-    short          num_faces_in_res, num_faces_in_fond;
+    short          num_faces_in_res;
 
 
     if ( noErr != FT_FSPathMakeRes( pathname, &res_ref ) )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     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 )
     {
+      short  num_faces_in_fond;
+
+
       fond = Get1IndResource( TTAG_FOND, res_index );
       if ( ResError() )
         break;
@@ -1237,9 +1241,12 @@ typedef short ResourceIndex;
     FT_Error  error = FT_Err_Ok;
 
 
+    /* test for valid `aface' and `library' delayed to */
+    /* `FT_New_Face_From_XXX'                          */
+
     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 );
 
     HLock( fond );
     parse_fond( *fond, &have_sfnt, &sfnt_id, lwfn_file_name, face_index );
@@ -1322,7 +1329,7 @@ typedef short ResourceIndex;
                                      face_index,
                                      aface );
     else
-      error = FT_Err_Unknown_File_Format;
+      error = FT_ERR( Unknown_File_Format );
 
   found_no_lwfn_file:
     if ( have_sfnt && FT_Err_Ok != error )
@@ -1389,9 +1396,8 @@ typedef short ResourceIndex;
 
     /* 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;
 
     /* try resourcefork based font: LWFN, FFIL */
@@ -1432,7 +1438,7 @@ typedef short ResourceIndex;
     FT_UNUSED( face_index );
     FT_UNUSED( aface );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
 
 #else
 
@@ -1442,12 +1448,14 @@ typedef short ResourceIndex;
     UInt8   pathname[PATH_MAX];
 
 
+    /* test for valid `library' and `aface' delayed to `FT_Open_Face' */
+
     if ( !ref )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     err = FSRefMakePath( ref, pathname, sizeof ( pathname ) );
     if ( err )
-      error = FT_Err_Cannot_Open_Resource;
+      error = FT_ERR( Cannot_Open_Resource );
 
     error = FT_New_Face_From_Resource( library, pathname, face_index, aface );
     if ( error != 0 || *aface != NULL )
@@ -1487,7 +1495,7 @@ typedef short ResourceIndex;
 
 
     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 );
 
@@ -1500,11 +1508,11 @@ typedef short ResourceIndex;
 
 
     if ( !spec )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     err = FT_FSpMakePath( spec, pathname, sizeof ( pathname ) );
     if ( err )
-      error = FT_Err_Cannot_Open_Resource;
+      error = FT_ERR( Cannot_Open_Resource );
 
     error = FT_New_Face_From_Resource( library, pathname, face_index, aface );
     if ( error != 0 || *aface != NULL )
@@ -1522,7 +1530,7 @@ typedef short ResourceIndex;
     FT_UNUSED( face_index );
     FT_UNUSED( aface );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
 
 #endif /* HAVE_FSREF, HAVE_FSSPEC */
 
index c4a882c..3c1b083 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2006, 2008 by
+# Copyright 1996-2000, 2003, 2006, 2008, 2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -28,7 +28,7 @@ $(FTMODULE_H): $(MODULES_CFG)
        $(FTMODULE_H_CREATE)
        $(FTMODULE_H_DONE)
 
-ifneq ($(findstring $(PLATFORM),dos win32 win16 os2),)
+ifneq ($(findstring $(PLATFORM),dos windows os2),)
   OPEN_MODULE   := @echo$(space)
   CLOSE_MODULE  :=  >> $(subst /,$(SEP),$(FTMODULE_H))
   REMOVE_MODULE := @-$(DELETE) $(subst /,$(SEP),$(FTMODULE_H))
index dd5f559..bc8c160 100644 (file)
@@ -2,7 +2,7 @@
 // FreeType 2 project for the symbian platform
 //
 
-// Copyright 2008, 2009 by
+// Copyright 2008, 2009, 2013 by
 // David Turner, Robert Wilhelm, and Werner Lemberg.
 //
 // This file is part of the FreeType project, and may only be used, modified,
@@ -19,48 +19,48 @@ freetype.mmp
 
 PRJ_EXPORTS
 ../../include/ft2build.h
-../../include/freetype/config/ftconfig.h       freetype/config/ftconfig.h
-../../include/freetype/config/ftheader.h       freetype/config/ftheader.h
-../../include/freetype/config/ftmodule.h       freetype/config/ftmodule.h
-../../include/freetype/config/ftoption.h       freetype/config/ftoption.h
-../../include/freetype/config/ftstdlib.h       freetype/config/ftstdlib.h
-../../include/freetype/freetype.h              freetype/freetype.h
-../../include/freetype/ftbbox.h                        freetype/ftbbox.h
-../../include/freetype/ftbdf.h                 freetype/ftbdf.h
-../../include/freetype/ftbitmap.h              freetype/ftbitmap.h
-../../include/freetype/ftcache.h               freetype/ftcache.h
-../../include/freetype/ftcid.h                 freetype/ftcid.h
-../../include/freetype/fterrdef.h              freetype/fterrdef.h
-../../include/freetype/fterrors.h              freetype/fterrors.h
-../../include/freetype/ftgasp.h                        freetype/ftgasp.h
-../../include/freetype/ftglyph.h               freetype/ftglyph.h
-../../include/freetype/ftgxval.h               freetype/ftgxval.h
-../../include/freetype/ftgzip.h                        freetype/ftgzip.h
-../../include/freetype/ftbzip2.h               freetype/ftbzip2.h
-../../include/freetype/ftimage.h               freetype/ftimage.h
-../../include/freetype/ftincrem.h              freetype/ftincrem.h
-../../include/freetype/ftlcdfil.h              freetype/ftlcdfil.h
-../../include/freetype/ftlist.h                        freetype/ftlist.h
-../../include/freetype/ftlzw.h                 freetype/ftlzw.h
-../../include/freetype/ftmac.h                 freetype/ftmac.h
-../../include/freetype/ftmm.h                  freetype/ftmm.h
-../../include/freetype/ftmodapi.h              freetype/ftmodapi.h
-../../include/freetype/ftmoderr.h              freetype/ftmoderr.h
-../../include/freetype/ftotval.h               freetype/ftotval.h
-../../include/freetype/ftoutln.h               freetype/ftoutln.h
-../../include/freetype/ftpfr.h                 freetype/ftpfr.h
-../../include/freetype/ftrender.h              freetype/ftrender.h
-../../include/freetype/ftsizes.h               freetype/ftsizes.h
-../../include/freetype/ftsnames.h              freetype/ftsnames.h
-../../include/freetype/ftstroke.h              freetype/ftstroke.h
-../../include/freetype/ftsynth.h               freetype/ftsynth.h
-../../include/freetype/ftsystem.h              freetype/ftsystem.h
-../../include/freetype/fttrigon.h              freetype/fttrigon.h
-../../include/freetype/fttypes.h               freetype/fttypes.h
-../../include/freetype/ftwinfnt.h              freetype/ftwinfnt.h
-../../include/freetype/ftxf86.h                        freetype/ftxf86.h
-../../include/freetype/t1tables.h              freetype/t1tables.h
-../../include/freetype/ttnameid.h              freetype/ttnameid.h
-../../include/freetype/tttables.h              freetype/tttables.h
-../../include/freetype/tttags.h                        freetype/tttags.h
-../../include/freetype/ttunpat.h               freetype/ttunpat.h
+../../include/config/ftconfig.h        config/ftconfig.h
+../../include/config/ftheader.h        config/ftheader.h
+../../include/config/ftmodule.h        config/ftmodule.h
+../../include/config/ftoption.h        config/ftoption.h
+../../include/config/ftstdlib.h        config/ftstdlib.h
+../../include/freetype.h       freetype.h
+../../include/ftbbox.h         ftbbox.h
+../../include/ftbdf.h          ftbdf.h
+../../include/ftbitmap.h       ftbitmap.h
+../../include/ftcache.h                ftcache.h
+../../include/ftcid.h          ftcid.h
+../../include/fterrdef.h       fterrdef.h
+../../include/fterrors.h       fterrors.h
+../../include/ftgasp.h         ftgasp.h
+../../include/ftglyph.h                ftglyph.h
+../../include/ftgxval.h                ftgxval.h
+../../include/ftgzip.h         ftgzip.h
+../../include/ftbzip2.h                ftbzip2.h
+../../include/ftimage.h                ftimage.h
+../../include/ftincrem.h       ftincrem.h
+../../include/ftlcdfil.h       ftlcdfil.h
+../../include/ftlist.h         ftlist.h
+../../include/ftlzw.h          ftlzw.h
+../../include/ftmac.h          ftmac.h
+../../include/ftmm.h           ftmm.h
+../../include/ftmodapi.h       ftmodapi.h
+../../include/ftmoderr.h       ftmoderr.h
+../../include/ftotval.h                ftotval.h
+../../include/ftoutln.h                ftoutln.h
+../../include/ftpfr.h          ftpfr.h
+../../include/ftrender.h       ftrender.h
+../../include/ftsizes.h                ftsizes.h
+../../include/ftsnames.h       ftsnames.h
+../../include/ftstroke.h       ftstroke.h
+../../include/ftsynth.h                ftsynth.h
+../../include/ftsystem.h       ftsystem.h
+../../include/fttrigon.h       fttrigon.h
+../../include/fttypes.h                fttypes.h
+../../include/ftwinfnt.h       ftwinfnt.h
+../../include/ftxf86.h         ftxf86.h
+../../include/t1tables.h       t1tables.h
+../../include/ttnameid.h       ttnameid.h
+../../include/tttables.h       tttables.h
+../../include/tttags.h         tttags.h
+../../include/ttunpat.h                ttunpat.h
index 18bcef2..16d4be8 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2001, 2003, 2006, 2008, 2009, 2010 by
+# Copyright 1996-2001, 2003, 2006, 2008-2010, 2012-2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -112,10 +112,10 @@ ifdef check_platform
 
   include $(TOP_DIR)/builds/detect.mk
 
-  # This rule makes sense for Unix only to remove files created by a run
-  # of the configure script which hasn't been successful (so that no
+  # This rule makes sense for Unix only to remove files created by a run of
+  # the configure script which hasn't been successful (so that no
   # `config.mk' has been created).  It uses the built-in $(RM) command of
-  # GNU make.  Similarly, `nul' is created if e.g. `make setup win32' has
+  # GNU make.  Similarly, `nul' is created if e.g. `make setup windows' has
   # been erroneously used.
   #
   # Note: This test is duplicated in `builds/unix/detect.mk'.
@@ -176,7 +176,7 @@ include $(TOP_DIR)/builds/modules.mk
 
 # we check for `dist', not `distclean'
 ifneq ($(findstring distx,$(MAKECMDGOALS)x),)
-  FT_H := include/freetype/freetype.h
+  FT_H := include/freetype.h
 
   major := $(shell sed -n 's/.*FREETYPE_MAJOR[^0-9]*\([0-9]\+\)/\1/p' < $(FT_H))
   minor := $(shell sed -n 's/.*FREETYPE_MINOR[^0-9]*\([0-9]\+\)/\1/p' < $(FT_H))
@@ -201,6 +201,7 @@ dist:
        currdir=`pwd` ; \
        for f in `find . -wholename '*/.git' -prune \
                         -o -name .gitignore \
+                        -o -name .mailmap \
                         -o -type d \
                         -o -print` ; do \
          ln -s $$currdir/$$f tmp/$$f ; \
@@ -219,9 +220,9 @@ dist:
 
        mv tmp freetype-$(version)
 
-       tar cfh - freetype-$(version) \
+       tar -H ustar -chf - freetype-$(version) \
        | gzip -9 -c > freetype-$(version).tar.gz
-       tar cfh - freetype-$(version) \
+       tar -H ustar -chf - freetype-$(version) \
        | bzip2 -c > freetype-$(version).tar.bz2
 
        @# Use CR/LF for zip files.
index 86b8c40..e4e0a12 100644 (file)
@@ -10,6 +10,7 @@ configure.ac
 freetype2.pc
 freetype-config
 ftconfig.h
+install-sh
 libtool
 ltmain.sh
 unix-cc.mk
index f90ad9f..97bf3eb 100644 (file)
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -11,6 +11,7 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
@@ -1317,7 +1318,7 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
@@ -1329,9 +1330,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
            LD="${LD-ld} -m elf_i386_fbsd"
            ;;
          x86_64-*linux*)
-           LD="${LD-ld} -m elf_i386"
+           case `/usr/bin/file conftest.o` in
+             *x86-64*)
+               LD="${LD-ld} -m elf32_x86_64"
+               ;;
+             *)
+               LD="${LD-ld} -m elf_i386"
+               ;;
+           esac
            ;;
-         ppc64-*linux*|powerpc64-*linux*)
+         powerpc64le-*)
+           LD="${LD-ld} -m elf32lppclinux"
+           ;;
+         powerpc64-*)
            LD="${LD-ld} -m elf32ppclinux"
            ;;
          s390x-*linux*)
@@ -1350,7 +1361,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
          x86_64-*linux*)
            LD="${LD-ld} -m elf_x86_64"
            ;;
-         ppc*-*linux*|powerpc*-*linux*)
+         powerpcle-*)
+           LD="${LD-ld} -m elf64lppc"
+           ;;
+         powerpc-*)
            LD="${LD-ld} -m elf64ppc"
            ;;
          s390*-*linux*|s390*-*tpf*)
@@ -1693,7 +1707,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     ;;
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
@@ -2517,17 +2532,6 @@ freebsd* | dragonfly*)
   esac
   ;;
 
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
 haiku*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
@@ -2644,7 +2648,7 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
@@ -2689,6 +2693,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -3248,10 +3264,6 @@ freebsd* | dragonfly*)
   fi
   ;;
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 haiku*)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -3290,11 +3302,11 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   else
@@ -4042,7 +4054,7 @@ m4_if([$1], [CXX], [
            ;;
        esac
        ;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
        case $cc_basename in
          KCC*)
            # KAI C++ Compiler
@@ -4106,7 +4118,7 @@ m4_if([$1], [CXX], [
            ;;
        esac
        ;;
-      netbsd*)
+      netbsd* | netbsdelf*-gnu)
        ;;
       *qnx* | *nto*)
         # QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -4341,7 +4353,7 @@ m4_if([$1], [CXX], [
       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -4583,6 +4595,9 @@ m4_if([$1], [CXX], [
       ;;
     esac
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   *)
     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
     ;;
@@ -4645,6 +4660,9 @@ dnl Note also adjust exclude_expsyms for C++ above.
   openbsd*)
     with_gnu_ld=no
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   esac
 
   _LT_TAGVAR(ld_shlibs, $1)=yes
@@ -4866,7 +4884,7 @@ _LT_EOF
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
        _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
        wlarc=
@@ -5043,6 +5061,7 @@ _LT_EOF
        if test "$aix_use_runtimelinking" = yes; then
          shared_flag="$shared_flag "'${wl}-G'
        fi
+       _LT_TAGVAR(link_all_deplibs, $1)=no
       else
        # not using gcc
        if test "$host_cpu" = ia64; then
@@ -5347,7 +5366,7 @@ _LT_EOF
       _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
        _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -6223,9 +6242,6 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(ld_shlibs, $1)=yes
         ;;
 
-      gnu*)
-        ;;
-
       haiku*)
         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         _LT_TAGVAR(link_all_deplibs, $1)=yes
@@ -6387,7 +6403,7 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(inherit_rpath, $1)=yes
         ;;
 
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
         case $cc_basename in
           KCC*)
            # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -8599,3 +8615,4 @@ m4_ifndef([_LT_PROG_FC],          [AC_DEFUN([_LT_PROG_FC])])
 m4_ifndef([_LT_PROG_CXX],              [AC_DEFUN([_LT_PROG_CXX])])
 
 m4_include([ft-munmap.m4])
+m4_include([pkg.m4])
index d622a44..b79252d 100755 (executable)
@@ -1,14 +1,12 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2012-02-10'
+timestamp='2013-06-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
@@ -22,19 +20,17 @@ timestamp='2012-02-10'
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner.  Please send patches (context
-# diff format) to <config-patches@gnu.org> and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 #
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
+# Originally written by Per Bothner.
 #
 # You can get the latest version of this script from:
 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -54,9 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -138,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+       # If the system lacks a compiler, then just pick glibc.
+       # We could probably try harder.
+       LIBC=gnu
+
+       eval $set_cc_for_build
+       cat <<-EOF > $dummy.c
+       #include <features.h>
+       #if defined(__UCLIBC__)
+       LIBC=uclibc
+       #elif defined(__dietlibc__)
+       LIBC=dietlibc
+       #else
+       LIBC=gnu
+       #endif
+       EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+       ;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -200,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
        echo "${machine}-${os}${release}"
        exit ;;
+    *:Bitrig:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+       exit ;;
     *:OpenBSD:*:*)
        UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
        echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
@@ -302,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
        echo arm-acorn-riscix${UNAME_RELEASE}
        exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
        echo arm-unknown-riscos
        exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -801,6 +820,9 @@ EOF
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
        exit ;;
+    *:MINGW64*:*)
+       echo ${UNAME_MACHINE}-pc-mingw64
+       exit ;;
     *:MINGW*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
        exit ;;
@@ -852,21 +874,21 @@ EOF
        exit ;;
     *:GNU:*:*)
        # the GNU system
-       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
        exit ;;
     *:GNU/*:*:*)
        # other systems with GNU libc and userland
-       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
        exit ;;
     i*86:Minix:*:*)
        echo ${UNAME_MACHINE}-pc-minix
        exit ;;
     aarch64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     aarch64_be:Linux:*:*)
        UNAME_MACHINE=aarch64_be
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -879,59 +901,54 @@ EOF
          EV68*) UNAME_MACHINE=alphaev68 ;;
        esac
        objdump --private-headers /bin/sh | grep -q ld.so.1
-       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     arm*:Linux:*:*)
        eval $set_cc_for_build
        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
            | grep -q __ARM_EABI__
        then
-           echo ${UNAME_MACHINE}-unknown-linux-gnu
+           echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        else
            if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
                | grep -q __ARM_PCS_VFP
            then
-               echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
            else
-               echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
            fi
        fi
        exit ;;
     avr32*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     cris:Linux:*:*)
-       echo ${UNAME_MACHINE}-axis-linux-gnu
+       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
        exit ;;
     crisv32:Linux:*:*)
-       echo ${UNAME_MACHINE}-axis-linux-gnu
+       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
        exit ;;
     frv:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     hexagon:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     i*86:Linux:*:*)
-       LIBC=gnu
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #ifdef __dietlibc__
-       LIBC=dietlibc
-       #endif
-EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-       echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+       echo ${UNAME_MACHINE}-pc-linux-${LIBC}
        exit ;;
     ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     m32r*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
        eval $set_cc_for_build
@@ -950,54 +967,63 @@ EOF
        #endif
 EOF
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
        ;;
+    or1k:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     or32:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     padre:Linux:*:*)
-       echo sparc-unknown-linux-gnu
+       echo sparc-unknown-linux-${LIBC}
        exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-gnu
+       echo hppa64-unknown-linux-${LIBC}
        exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-         PA7*) echo hppa1.1-unknown-linux-gnu ;;
-         PA8*) echo hppa2.0-unknown-linux-gnu ;;
-         *)    echo hppa-unknown-linux-gnu ;;
+         PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+         PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+         *)    echo hppa-unknown-linux-${LIBC} ;;
        esac
        exit ;;
     ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-gnu
+       echo powerpc64-unknown-linux-${LIBC}
        exit ;;
     ppc:Linux:*:*)
-       echo powerpc-unknown-linux-gnu
+       echo powerpc-unknown-linux-${LIBC}
+       exit ;;
+    ppc64le:Linux:*:*)
+       echo powerpc64le-unknown-linux-${LIBC}
+       exit ;;
+    ppcle:Linux:*:*)
+       echo powerpcle-unknown-linux-${LIBC}
        exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-       echo ${UNAME_MACHINE}-ibm-linux
+       echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
        exit ;;
     sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     tile*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     vax:Linux:*:*)
-       echo ${UNAME_MACHINE}-dec-linux-gnu
+       echo ${UNAME_MACHINE}-dec-linux-${LIBC}
        exit ;;
     x86_64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     xtensa*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1201,6 +1227,9 @@ EOF
     BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
        echo i586-pc-haiku
        exit ;;
+    x86_64:Haiku:*:*)
+       echo x86_64-unknown-haiku
+       exit ;;
     SX-4:SUPER-UX:*:*)
        echo sx4-nec-superux${UNAME_RELEASE}
        exit ;;
@@ -1227,19 +1256,21 @@ EOF
        exit ;;
     *:Darwin:*:*)
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-       case $UNAME_PROCESSOR in
-           i386)
-               eval $set_cc_for_build
-               if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-                 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-                     (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-                     grep IS_64BIT_ARCH >/dev/null
-                 then
-                     UNAME_PROCESSOR="x86_64"
-                 fi
-               fi ;;
-           unknown) UNAME_PROCESSOR=powerpc ;;
-       esac
+       eval $set_cc_for_build
+       if test "$UNAME_PROCESSOR" = unknown ; then
+           UNAME_PROCESSOR=powerpc
+       fi
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               case $UNAME_PROCESSOR in
+                   i386) UNAME_PROCESSOR=x86_64 ;;
+                   powerpc) UNAME_PROCESSOR=powerpc64 ;;
+               esac
+           fi
+       fi
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
        exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1256,7 +1287,7 @@ EOF
     NEO-?:NONSTOP_KERNEL:*:*)
        echo neo-tandem-nsk${UNAME_RELEASE}
        exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
+    NSE-*:NONSTOP_KERNEL:*:*)
        echo nse-tandem-nsk${UNAME_RELEASE}
        exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
@@ -1330,9 +1361,6 @@ EOF
        exit ;;
 esac
 
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
 eval $set_cc_for_build
 cat >$dummy.c <<EOF
 #ifdef _SEQUENT_
index c894da4..9633db7 100755 (executable)
@@ -1,24 +1,18 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2012-02-10'
+timestamp='2013-08-10'
 
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, see <http://www.gnu.org/licenses/>.
@@ -26,11 +20,12 @@ timestamp='2012-02-10'
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -73,9 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -123,7 +116,7 @@ esac
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
   knetbsd*-gnu* | netbsd*-gnu* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
@@ -156,7 +149,7 @@ case $os in
        -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
        -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
        -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-       -apple | -axis | -knuth | -cray | -microblaze)
+       -apple | -axis | -knuth | -cray | -microblaze*)
                os=
                basic_machine=$1
                ;;
@@ -225,6 +218,12 @@ case $os in
        -isc*)
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
                ;;
+       -lynx*178)
+               os=-lynxos178
+               ;;
+       -lynx*5)
+               os=-lynxos5
+               ;;
        -lynx*)
                os=-lynxos
                ;;
@@ -253,10 +252,12 @@ case $basic_machine in
        | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
        | am33_2.0 \
-       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
-        | be32 | be64 \
+       | arc | arceb \
+       | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+       | avr | avr32 \
+       | be32 | be64 \
        | bfin \
-       | c4x | clipper \
+       | c4x | c8051 | clipper \
        | d10v | d30v | dlx | dsp16xx \
        | epiphany \
        | fido | fr30 | frv \
@@ -267,7 +268,7 @@ case $basic_machine in
        | le32 | le64 \
        | lm32 \
        | m32c | m32r | m32rle | m68000 | m68k | m88k \
-       | maxq | mb | microblaze | mcore | mep | metag \
+       | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
        | mips | mipsbe | mipseb | mipsel | mipsle \
        | mips16 \
        | mips64 | mips64el \
@@ -285,16 +286,17 @@ case $basic_machine in
        | mipsisa64r2 | mipsisa64r2el \
        | mipsisa64sb1 | mipsisa64sb1el \
        | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipsr5900 | mipsr5900el \
        | mipstx39 | mipstx39el \
        | mn10200 | mn10300 \
        | moxie \
        | mt \
        | msp430 \
        | nds32 | nds32le | nds32be \
-       | nios | nios2 \
+       | nios | nios2 | nios2eb | nios2el \
        | ns16k | ns32k \
        | open8 \
-       | or32 \
+       | or1k | or32 \
        | pdp10 | pdp11 | pj | pjl \
        | powerpc | powerpc64 | powerpc64le | powerpcle \
        | pyramid \
@@ -364,13 +366,13 @@ case $basic_machine in
        | aarch64-* | aarch64_be-* \
        | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
        | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
        | avr-* | avr32-* \
        | be32-* | be64-* \
        | bfin-* | bs2000-* \
        | c[123]* | c30-* | [cjt]90-* | c4x-* \
-       | clipper-* | craynv-* | cydra-* \
+       | c8051-* | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
        | elxsi-* \
        | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
@@ -383,7 +385,8 @@ case $basic_machine in
        | lm32-* \
        | m32c-* | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+       | microblaze-* | microblazeel-* \
        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
        | mips16-* \
        | mips64-* | mips64el-* \
@@ -401,12 +404,13 @@ case $basic_machine in
        | mipsisa64r2-* | mipsisa64r2el-* \
        | mipsisa64sb1-* | mipsisa64sb1el-* \
        | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipsr5900-* | mipsr5900el-* \
        | mipstx39-* | mipstx39el-* \
        | mmix-* \
        | mt-* \
        | msp430-* \
        | nds32-* | nds32le-* | nds32be-* \
-       | nios-* | nios2-* \
+       | nios-* | nios2-* | nios2eb-* | nios2el-* \
        | none-* | np1-* | ns16k-* | ns32k-* \
        | open8-* \
        | orion-* \
@@ -782,11 +786,15 @@ case $basic_machine in
                basic_machine=ns32k-utek
                os=-sysv
                ;;
-       microblaze)
+       microblaze*)
                basic_machine=microblaze-xilinx
                ;;
+       mingw64)
+               basic_machine=x86_64-pc
+               os=-mingw64
+               ;;
        mingw32)
-               basic_machine=i386-pc
+               basic_machine=i686-pc
                os=-mingw32
                ;;
        mingw32ce)
@@ -822,7 +830,7 @@ case $basic_machine in
                basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
                ;;
        msys)
-               basic_machine=i386-pc
+               basic_machine=i686-pc
                os=-msys
                ;;
        mvs)
@@ -1013,7 +1021,11 @@ case $basic_machine in
                basic_machine=i586-unknown
                os=-pw32
                ;;
-       rdos)
+       rdos | rdos64)
+               basic_machine=x86_64-pc
+               os=-rdos
+               ;;
+       rdos32)
                basic_machine=i386-pc
                os=-rdos
                ;;
@@ -1340,21 +1352,21 @@ case $os in
        -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
              | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
              | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-             | -sym* | -kopensolaris* \
+             | -sym* | -kopensolaris* | -plan9* \
              | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
              | -aos* | -aros* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
              | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-             | -openbsd* | -solidbsd* \
+             | -bitrig* | -openbsd* | -solidbsd* \
              | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
              | -chorusos* | -chorusrdb* | -cegcc* \
              | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -linux-android* \
-             | -linux-newlib* | -linux-uclibc* \
+             | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+             | -linux-newlib* | -linux-musl* | -linux-uclibc* \
              | -uxpv* | -beos* | -mpeix* | -udk* \
              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1486,9 +1498,6 @@ case $os in
        -aros*)
                os=-aros
                ;;
-       -kaos*)
-               os=-kaos
-               ;;
        -zvmoe)
                os=-zvmoe
                ;;
@@ -1537,6 +1546,12 @@ case $basic_machine in
        c4x-* | tic4x-*)
                os=-coff
                ;;
+       c8051-*)
+               os=-elf
+               ;;
+       hexagon-*)
+               os=-elf
+               ;;
        tic54x-*)
                os=-coff
                ;;
@@ -1577,6 +1592,9 @@ case $basic_machine in
        mips*-*)
                os=-elf
                ;;
+       or1k-*)
+               os=-elf
+               ;;
        or32-*)
                os=-coff
                ;;
index 7d2eb89..f4c6e91 100755 (executable)
@@ -1,13 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for FreeType 2.4.9.
+# Generated by GNU Autoconf 2.69 for FreeType 2.5.4.
 #
 # Report bugs to <freetype@nongnu.org>.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -136,6 +134,31 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -169,12 +192,12 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
   test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1
 
   test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
     ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
@@ -182,7 +205,8 @@ test \$(( 1 + 1 )) = 2 || exit 1
     ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
     PATH=/empty FPATH=/empty; export PATH FPATH
     test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
-      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
+      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
   if (eval "$as_required") 2>/dev/null; then :
   as_have_required=yes
 else
@@ -222,21 +246,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-       # neutralization value for shells without unset; and this also
-       # works around shells that cannot unset nonexistent variables.
-       # Preserve -v and -x to the replacement shell.
-       BASH_ENV=/dev/null
-       ENV=/dev/null
-       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-       export CONFIG_SHELL
-       case $- in # ((((
-         *v*x* | *x*v* ) as_opts=-vx ;;
-         *v* ) as_opts=-v ;;
-         *x* ) as_opts=-x ;;
-         * ) as_opts= ;;
-       esac
-       exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -339,6 +367,14 @@ $as_echo X"$as_dir" |
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -460,6 +496,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -494,16 +534,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -515,28 +555,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-       test -d "$1/.";
-      else
-       case $1 in #(
-       -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-       ???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -570,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='FreeType'
 PACKAGE_TARNAME='freetype'
-PACKAGE_VERSION='2.4.9'
-PACKAGE_STRING='FreeType 2.4.9'
+PACKAGE_VERSION='2.5.4'
+PACKAGE_STRING='FreeType 2.5.4'
 PACKAGE_BUGREPORT='freetype@nongnu.org'
 PACKAGE_URL=''
 
@@ -618,6 +638,27 @@ LIBOBJS
 build_libtool_libs
 wl
 hardcode_libdir_flag_spec
+LIBSSTATIC_CONFIG
+LIBS_PRIVATE
+REQUIRES_PRIVATE
+ftmac_c
+HARFBUZZ_LIBS
+HARFBUZZ_CFLAGS
+LIBPNG_LIBS
+LIBPNG_CFLAGS
+BZIP2_LIBS
+BZIP2_CFLAGS
+ZLIB_LIBS
+ZLIB_CFLAGS
+XX_ANSIFLAGS
+XX_CFLAGS
+FTSYS_SRC
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+RMDIR
+EXEEXT_BUILD
+CC_BUILD
 OTOOL64
 OTOOL
 LIPO
@@ -635,28 +676,16 @@ ac_ct_DUMPBIN
 DUMPBIN
 LD
 FGREP
+EGREP
+GREP
 SED
 LIBTOOL
 OBJDUMP
 DLLTOOL
 AS
-SYSTEM_ZLIB
-FT2_EXTRA_LIBS
-LIBBZ2
-LIBZ
-ftmac_c
-FTSYS_SRC
-EGREP
-GREP
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-RMDIR
-RMF
-XX_ANSIFLAGS
-XX_CFLAGS
-EXEEXT_BUILD
-CC_BUILD
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
 CPP
 OBJEXT
 EXEEXT
@@ -716,23 +745,25 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
 enable_biarch_config
 enable_mmap
 with_zlib
 with_bzip2
+with_png
+with_harfbuzz
 with_old_mac_fonts
 with_fsspec
 with_fsref
 with_quickdraw_toolbox
 with_quickdraw_carbon
 with_ats
-enable_shared
-enable_static
-with_pic
-enable_fast_install
-with_gnu_ld
-with_sysroot
-enable_libtool_lock
 '
       ac_precious_vars='build_alias
 host_alias
@@ -742,7 +773,18 @@ CFLAGS
 LDFLAGS
 LIBS
 CPPFLAGS
-CPP'
+CPP
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+ZLIB_CFLAGS
+ZLIB_LIBS
+BZIP2_CFLAGS
+BZIP2_LIBS
+LIBPNG_CFLAGS
+LIBPNG_LIBS
+HARFBUZZ_CFLAGS
+HARFBUZZ_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1198,8 +1240,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1285,7 +1325,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures FreeType 2.4.9 to adapt to many kinds of systems.
+\`configure' configures FreeType 2.5.4 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1350,7 +1390,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of FreeType 2.4.9:";;
+     short | recursive ) echo "Configuration of FreeType 2.5.4:";;
    esac
   cat <<\_ACEOF
 
@@ -1358,20 +1398,34 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-biarch-config  install biarch ftconfig.h to support multiple
-                          architectures by single file
-  --disable-mmap          do not check mmap() and do not use
   --enable-shared[=PKGS]  build shared libraries [default=yes]
   --enable-static[=PKGS]  build static libraries [default=yes]
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-biarch-config  install biarch ftconfig.h to support multiple
+                          architectures by single file
+  --disable-mmap          do not check mmap() and do not use
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --without-zlib          use internal zlib instead of system-wide
-  --without-bzip2         do not support bzip2 compressed fonts
+  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-sysroot=DIR Search for dependent libraries within DIR
+                        (or the compiler's sysroot if not specified).
+  --with-zlib=[yes|no|auto]
+                          use system zlib instead of internal library
+                          [default=auto]
+  --with-bzip2=[yes|no|auto]
+                          support bzip2 compressed fonts [default=auto]
+  --with-png=[yes|no|auto]
+                          support png compressed OpenType embedded bitmaps
+                          [default=auto]
+  --with-harfbuzz=[yes|no|auto]
+                          improve auto-hinting of OpenType fonts
+                          [default=auto]
   --with-old-mac-fonts    allow Mac resource-based fonts to be used
   --with-fsspec           use obsolete FSSpec API of MacOS, if available
                           (default=yes)
@@ -1383,11 +1437,6 @@ Optional Packages:
   --with-quickdraw-carbon use MacOS QuickDraw in Carbon, if available
                           (default=yes)
   --with-ats              use AppleTypeService, if available (default=yes)
-  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
-                          both]
-  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --with-sysroot=DIR Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).
 
 Some influential environment variables:
   CC          C compiler command
@@ -1398,6 +1447,23 @@ Some influential environment variables:
   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  PKG_CONFIG_PATH
+              directories to add to pkg-config's search path
+  PKG_CONFIG_LIBDIR
+              path overriding pkg-config's built-in search path
+  ZLIB_CFLAGS C compiler flags for ZLIB, overriding pkg-config
+  ZLIB_LIBS   linker flags for ZLIB, overriding pkg-config
+  BZIP2_CFLAGS
+              C compiler flags for BZIP2, overriding pkg-config
+  BZIP2_LIBS  linker flags for BZIP2, overriding pkg-config
+  LIBPNG_CFLAGS
+              C compiler flags for LIBPNG, overriding pkg-config
+  LIBPNG_LIBS linker flags for LIBPNG, overriding pkg-config
+  HARFBUZZ_CFLAGS
+              C compiler flags for HARFBUZZ, overriding pkg-config
+  HARFBUZZ_LIBS
+              linker flags for HARFBUZZ, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1465,10 +1531,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-FreeType configure 2.4.9
-generated by GNU Autoconf 2.68
+FreeType configure 2.5.4
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1554,6 +1620,83 @@ fi
 
 } # ac_fn_c_try_cpp
 
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
 # ac_fn_c_try_run LINENO
 # ----------------------
 # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
@@ -1596,6 +1739,73 @@ fi
 
 } # ac_fn_c_try_run
 
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
 # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
 # -------------------------------------------------------
 # Tests whether HEADER exists, giving a warning if it cannot be compiled using
@@ -1687,37 +1897,6 @@ fi
 
 } # ac_fn_c_check_header_mongrel
 
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
 # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
 # --------------------------------------------
 # Tries to find the compile-time value of EXPR in a program that includes
@@ -1735,7 +1914,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -1751,7 +1931,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -1777,7 +1958,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -1793,7 +1975,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -1827,7 +2010,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -1896,124 +2080,11 @@ rm -f conftest.val
 
 } # ac_fn_c_compute_int
 
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext conftest$ac_exeext
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_retval=1
-fi
-  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
-  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
-  # interfere with the next link command; also delete a directory that is
-  # left behind by Apple's compiler.  We do this before executing the actions.
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $2 (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-
-# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
-# ---------------------------------------------
-# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
-# accordingly.
-ac_fn_c_check_decl ()
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   as_decl_name=`echo $2|sed 's/ *(.*//'`
@@ -2058,8 +2129,8 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by FreeType $as_me 2.4.9, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+It was created by FreeType $as_me 2.5.4, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2414,7 +2485,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 # Don't forget to update docs/VERSION.DLL!
 
-version_info='14:1:8'
+version_info='17:3:11'
 
 ft_version=`echo $version_info | tr : .`
 
@@ -2548,7 +2619,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2588,7 +2659,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2641,7 +2712,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2682,7 +2753,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -2740,7 +2811,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2784,7 +2855,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3230,8 +3301,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3456,27 +3526,34 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-# checks for native programs to generate building tool
 
-if test ${cross_compiling} = yes; then
-  # Extract the first word of "${build}-gcc", so it can be a program name with args.
-set dummy ${build}-gcc; ac_word=$2
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC_BUILD+:} false; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$CC_BUILD"; then
-  ac_cv_prog_CC_BUILD="$CC_BUILD" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CC_BUILD="${build}-gcc"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -3484,36 +3561,42 @@ done
   done
 IFS=$as_save_IFS
 
+  ;;
+esac
 fi
-fi
-CC_BUILD=$ac_cv_prog_CC_BUILD
-if test -n "$CC_BUILD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_BUILD" >&5
-$as_echo "$CC_BUILD" >&6; }
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -z "${CC_BUILD}" && # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC_BUILD+:} false; then :
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$CC_BUILD"; then
-  ac_cv_prog_CC_BUILD="$CC_BUILD" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CC_BUILD="gcc"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -3521,332 +3604,170 @@ done
   done
 IFS=$as_save_IFS
 
+  ;;
+esac
 fi
-fi
-CC_BUILD=$ac_cv_prog_CC_BUILD
-if test -n "$CC_BUILD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_BUILD" >&5
-$as_echo "$CC_BUILD" >&6; }
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-
-  test -z "${CC_BUILD}" && # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC_BUILD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC_BUILD"; then
-  ac_cv_prog_CC_BUILD="$CC_BUILD" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC_BUILD="cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC_BUILD
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC_BUILD to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC_BUILD="$as_dir/$ac_word${1+' '}$@"
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
   fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 fi
+
 fi
-fi
-CC_BUILD=$ac_cv_prog_CC_BUILD
-if test -n "$CC_BUILD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_BUILD" >&5
-$as_echo "$CC_BUILD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.24
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
 fi
 
+case `pwd` in
+  *\ * | *\    *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
 
-  test -z "${CC_BUILD}" && as_fn_error $? "cannot find native C compiler" "$LINENO" 5
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of native executables" >&5
-$as_echo_n "checking for suffix of native executables... " >&6; }
-  rm -f a.* b.* a_out.exe conftest.*
-  echo > conftest.c "int main() { return 0;}"
-  ${CC_BUILD} conftest.c || as_fn_error $? "native C compiler is not working" "$LINENO" 5
-  rm -f conftest.c
-  if test -x a.out -o -x b.out -o -x conftest; then
-    EXEEXT_BUILD=""
-  elif test -x a_out.exe -o -x conftest.exe; then
-    EXEEXT_BUILD=".exe"
-  elif test -x conftest.*; then
-    EXEEXT_BUILD=`echo conftest.* | sed -n '1s/^.*\././'`
-  fi
-  rm -f a.* b.* a_out.exe conftest.*
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXEEXT_BUILD" >&5
-$as_echo "$EXEEXT_BUILD" >&6; }
-else
-  CC_BUILD=${CC}
-  EXEEXT_BUILD=${EXEEXT}
-fi
 
+macro_version='2.4.2'
+macro_revision='1.3337'
 
 
 
 
 
-# get compiler flags right
 
-if test "x$GCC" = xyes; then
-  XX_CFLAGS="-Wall"
-  XX_ANSIFLAGS="-pedantic -ansi"
-else
-  case "$host" in
-  *-dec-osf*)
-    CFLAGS=
-    XX_CFLAGS="-std1 -g3"
-    XX_ANSIFLAGS=
-    ;;
-  *)
-    XX_CFLAGS=
-    XX_ANSIFLAGS=
-    ;;
-  esac
-fi
 
 
 
 
-# auxiliary programs
 
-# Extract the first word of "rm", so it can be a program name with args.
-set dummy rm; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RMF+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RMF"; then
-  ac_cv_prog_RMF="$RMF" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_RMF="rm -f"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-fi
-fi
-RMF=$ac_cv_prog_RMF
-if test -n "$RMF"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RMF" >&5
-$as_echo "$RMF" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
+ltmain="$ac_aux_dir/ltmain.sh"
 
-# Extract the first word of "rmdir", so it can be a program name with args.
-set dummy rmdir; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RMDIR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RMDIR"; then
-  ac_cv_prog_RMDIR="$RMDIR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_RMDIR="rmdir"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
 
-fi
-fi
-RMDIR=$ac_cv_prog_RMDIR
-if test -n "$RMDIR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RMDIR" >&5
-$as_echo "$RMDIR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
 
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
 
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
 
-# Since this file will be finally moved to another directory we make
-# the path of the install script absolute.  This small code snippet has
-# been taken from automake's `ylwrap' script.
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
 
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
-  $as_echo_n "(cached) " >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
 else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
-  ./ | .// | /[cC]/* | \
-  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
-  /usr/ucb/* ) ;;
-  *)
-    # OSF1 and SCO ODT 3.0 have their own names for install.
-    # Don't use installbsd from OSF since it installs stuff as root
-    # by default.
-    for ac_prog in ginstall scoinst install; do
-      for ac_exec_ext in '' $ac_executable_extensions; do
-       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
-         if test $ac_prog = install &&
-           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-           # AIX install.  It has an incompatible calling convention.
-           :
-         elif test $ac_prog = install &&
-           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-           # program-specific install script used by HP pwplus--don't use.
-           :
-         else
-           rm -rf conftest.one conftest.two conftest.dir
-           echo one > conftest.one
-           echo two > conftest.two
-           mkdir conftest.dir
-           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
-             test -s conftest.one && test -s conftest.two &&
-             test -s conftest.dir/conftest.one &&
-             test -s conftest.dir/conftest.two
-           then
-             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-             break 3
-           fi
-         fi
-       fi
-      done
-    done
-    ;;
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO ""
+}
+
+case "$ECHO" in
+  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
 esac
 
-  done
-IFS=$as_save_IFS
 
-rm -rf conftest.one conftest.two conftest.dir
 
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL=$ac_cv_path_install
-  else
-    # As a last resort, use the slow shell script.  Don't cache a
-    # value for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the value is a relative name.
-    INSTALL=$ac_install_sh
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
 
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-case "$INSTALL" in
-/*)
-  ;;
-*/*)
-  INSTALL="`pwd`/$INSTALL"
-  ;;
-esac
 
 
-# checks for header files
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -z "$GREP"; then
-  ac_path_GREP_found=false
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
   # Loop through the user's path and test for each of PROGNAME-LIST
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_prog in grep ggrep; do
+    for ac_prog in sed gsed; do
     for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
-# Check for GNU ac_path_GREP and select it if it is found.
-  # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
 *GNU*)
-  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
 *)
   ac_count=0
   $as_echo_n 0123456789 >"conftest.in"
@@ -3855,14 +3776,14 @@ case `"$ac_path_GREP" --version 2>&1` in
     cat "conftest.in" "conftest.in" >"conftest.tmp"
     mv "conftest.tmp" "conftest.in"
     cp "conftest.in" "conftest.nl"
-    $as_echo 'GREP' >> "conftest.nl"
-    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
     as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
       # Best one so far, save it but keep looking for a better one
-      ac_cv_path_GREP="$ac_path_GREP"
-      ac_path_GREP_max=$ac_count
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
     fi
     # 10*(2^10) chars as input seems more than enough
     test $ac_count -gt 10 && break
@@ -3870,22 +3791,98 @@ case `"$ac_path_GREP" --version 2>&1` in
   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
 esac
 
-      $ac_path_GREP_found && break 3
+      $ac_path_SED_found && break 3
     done
   done
   done
 IFS=$as_save_IFS
-  if test -z "$ac_cv_path_GREP"; then
-    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
   fi
 else
-  ac_cv_path_GREP=$GREP
+  ac_cv_path_SED=$SED
 fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
@@ -3907,7 +3904,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -3955,1454 +3952,1603 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
  EGREP="$ac_cv_path_EGREP"
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     if test -z "$FGREP"; then
+  ac_path_FGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in fgrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_FGREP" || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+  # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
 
+      $ac_path_FGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_FGREP"; then
+    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
 else
-  ac_cv_header_stdc=no
+  ac_cv_path_FGREP=$FGREP
 fi
-rm -f conftest*
 
+   fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
 
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
+test -z "$GREP" && GREP=grep
 
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
 
-fi
 
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-                  (('a' <= (c) && (c) <= 'i') \
-                    || ('j' <= (c) && (c) <= 'r') \
-                    || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
 
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-       || toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
 
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
 
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
-fi
 
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                 inttypes.h stdint.h unistd.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
 
-fi
 
-done
 
 
-for ac_header in fcntl.h unistd.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
 
-fi
 
-done
 
 
 
-# checks for typedefs, structures, and compiler characteristics
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
-  $as_echo_n "(cached) " >&6
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
-  typedef int charset[2];
-  const charset cs;
-  /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *pcpcc;
-  char **ppc;
-  /* NEC SVR4.0.2 mips cc rejects this.  */
-  struct point {int x, y;};
-  static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
-     It does not let you subtract one const X* pointer from another in
-     an arm of an if-expression whose if-part is not a constant
-     expression */
-  const char *g = "string";
-  pcpcc = &g + (g ? g-g : 0);
-  /* HPUX 7.0 cc rejects these. */
-  ++pcpcc;
-  ppc = (char**) pcpcc;
-  pcpcc = (char const *const *) ppc;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
-
-    *t++ = 0;
-    if (s) return 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-    int x[] = {25, 17};
-    const int *foo = &x[0];
-    ++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-    typedef const int *iptr;
-    iptr p = 0;
-    ++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this saying
-       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-    const int foo = 10;
-    if (!foo) return 0;
-  }
-  return !cs[0] && !zero.x;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_const=yes
-else
-  ac_cv_c_const=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  with_gnu_ld=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-$as_echo "#define const /**/" >>confdefs.h
 
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
 fi
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
-$as_echo_n "checking size of int... " >&6; }
-if ${ac_cv_sizeof_int+:} false; then :
+if ${lt_cv_path_LD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int"        "$ac_includes_default"; then :
-
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
 else
-  if test "$ac_cv_type_int" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (int)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_int=0
-   fi
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
 fi
-
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
-$as_echo "$ac_cv_sizeof_int" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
-$as_echo_n "checking size of long... " >&6; }
-if ${ac_cv_sizeof_long+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :
 
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
 else
-  if test "$ac_cv_type_long" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (long)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_long=0
-   fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
-
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
-$as_echo "$ac_cv_sizeof_long" >&6; }
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
 
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
-_ACEOF
 
 
 
 
-# check whether cpp computation of size of int and long in ftconfig.in works
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cpp computation of bit length in ftconfig.in works" >&5
-$as_echo_n "checking whether cpp computation of bit length in ftconfig.in works... " >&6; }
-orig_CPPFLAGS="${CPPFLAGS}"
-CPPFLAGS="-I${srcdir} -I. ${CPPFLAGS}"
-ac_clean_files="ft2build.h ftoption.h ftstdlib.h"
-touch ft2build.h ftoption.h ftstdlib.h
 
-cat > conftest.c <<\_ACEOF
-#include <limits.h>
-#define FT_CONFIG_OPTIONS_H "ftoption.h"
-#define FT_CONFIG_STANDARD_LIBRARY_H "ftstdlib.h"
-#define FT_UINT_MAX  UINT_MAX
-#define FT_ULONG_MAX ULONG_MAX
-#include "ftconfig.in"
-_ACEOF
-echo >> conftest.c "#if FT_SIZEOF_INT == "${ac_cv_sizeof_int}
-echo >> conftest.c "ac_cpp_ft_sizeof_int="${ac_cv_sizeof_int}
-echo >> conftest.c "#endif"
-echo >> conftest.c "#if FT_SIZEOF_LONG == "${ac_cv_sizeof_long}
-echo >> conftest.c "ac_cpp_ft_sizeof_long="${ac_cv_sizeof_long}
-echo >> conftest.c "#endif"
 
-${CPP} ${CPPFLAGS} conftest.c | ${GREP} ac_cpp_ft > conftest.sh
-eval `cat conftest.sh`
-${RMF} conftest.c conftest.sh confft2build.h ftoption.h ftstdlib.h
 
-if test x != "x${ac_cpp_ft_sizeof_int}" \
-   -a x != x"${ac_cpp_ft_sizeof_long}"; then
-  unset ft_use_autoconf_sizeof_types
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ft_use_autoconf_sizeof_types=yes
-fi
-
-# Check whether --enable-biarch-config was given.
-if test "${enable_biarch_config+set}" = set; then :
-  enableval=$enable_biarch_config;
-fi
-
-
-case :${ft_use_autoconf_sizeof_types}:${enable_biarch_config}: in
-  :yes:yes:)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: broken but use it" >&5
-$as_echo "broken but use it" >&6; }
-    unset ft_use_autoconf_sizeof_types
-    ;;
-  ::no:)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: works but ignore it" >&5
-$as_echo "works but ignore it" >&6; }
-    ft_use_autoconf_sizeof_types=yes
-    ;;
-  ::yes: | :::)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-    unset ft_use_autoconf_sizeof_types
-    ;;
-  *)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    ft_use_autoconf_sizeof_types=yes
-    ;;
-esac
-
-if test x"${ft_use_autoconf_sizeof_types}" = xyes; then
-  $as_echo "#define FT_USE_AUTOCONF_SIZEOF_TYPES 1" >>confdefs.h
-
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+       */dev/null* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
 fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in dumpbin "link -dump"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-CPPFLAGS="${orig_CPPFLAGS}"
-
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-# checks for library functions
 
-# Here we check whether we can use our mmap file component.
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in dumpbin "link -dump"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-# Check whether --enable-mmap was given.
-if test "${enable_mmap+set}" = set; then :
-  enableval=$enable_mmap; enable_mmap="no"
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
 else
-  enable_mmap="yes"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-if test "x${enable_mmap}" != "xno"; then
-
-
 
-  for ac_header in $ac_header_list
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+  test -n "$ac_ct_DUMPBIN" && break
+done
 
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
 fi
 
-done
-
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
 
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
 
 
 
 
 
 
-for ac_func in getpagesize
-do :
-  ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
-if test "x$ac_cv_func_getpagesize" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_GETPAGESIZE 1
-_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
 fi
-done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
-$as_echo_n "checking for working mmap... " >&6; }
-if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_mmap_fixed_mapped=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-/* malloc might have been renamed as rpl_malloc. */
-#undef malloc
+    i=0
+  teststring="ABCD"
 
-/* Thanks to Mike Haertel and Jim Avera for this test.
-   Here is a matrix of mmap possibilities:
-       mmap private not fixed
-       mmap private fixed at somewhere currently unmapped
-       mmap private fixed at somewhere already mapped
-       mmap shared not fixed
-       mmap shared fixed at somewhere currently unmapped
-       mmap shared fixed at somewhere already mapped
-   For private mappings, we should verify that changes cannot be read()
-   back from the file, nor mmap's back from the file at a different
-   address.  (There have been systems where private was not correctly
-   implemented like the infamous i386 svr4.0, and systems where the
-   VM page cache was not coherent with the file system buffer cache
-   like early versions of FreeBSD and possibly contemporary NetBSD.)
-   For shared mappings, we should conversely verify that changes get
-   propagated back to all the places they're supposed to be.
-
-   Grep wants private fixed already mapped.
-   The main things grep needs to know about mmap are:
-   * does it exist and is it safe to write into the mmap'd area
-   * how to use it (BSD variants)  */
-
-#include <fcntl.h>
-#include <sys/mman.h>
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
 
-#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
-char *malloc ();
-#endif
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
 
-/* This mess was copied from the GNU getpagesize.h.  */
-#ifndef HAVE_GETPAGESIZE
-# ifdef _SC_PAGESIZE
-#  define getpagesize() sysconf(_SC_PAGESIZE)
-# else /* no _SC_PAGESIZE */
-#  ifdef HAVE_SYS_PARAM_H
-#   include <sys/param.h>
-#   ifdef EXEC_PAGESIZE
-#    define getpagesize() EXEC_PAGESIZE
-#   else /* no EXEC_PAGESIZE */
-#    ifdef NBPG
-#     define getpagesize() NBPG * CLSIZE
-#     ifndef CLSIZE
-#      define CLSIZE 1
-#     endif /* no CLSIZE */
-#    else /* no NBPG */
-#     ifdef NBPC
-#      define getpagesize() NBPC
-#     else /* no NBPC */
-#      ifdef PAGESIZE
-#       define getpagesize() PAGESIZE
-#      endif /* PAGESIZE */
-#     endif /* no NBPC */
-#    endif /* no NBPG */
-#   endif /* no EXEC_PAGESIZE */
-#  else /* no HAVE_SYS_PARAM_H */
-#   define getpagesize() 8192  /* punt totally */
-#  endif /* no HAVE_SYS_PARAM_H */
-# endif /* no _SC_PAGESIZE */
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
 
-#endif /* no HAVE_GETPAGESIZE */
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
 
-int
-main ()
-{
-  char *data, *data2, *data3;
-  const char *cdata2;
-  int i, pagesize;
-  int fd, fd2;
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
 
-  pagesize = getpagesize ();
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
 
-  /* First, make a file with some known garbage in it. */
-  data = (char *) malloc (pagesize);
-  if (!data)
-    return 1;
-  for (i = 0; i < pagesize; ++i)
-    *(data + i) = rand ();
-  umask (0);
-  fd = creat ("conftest.mmap", 0600);
-  if (fd < 0)
-    return 2;
-  if (write (fd, data, pagesize) != pagesize)
-    return 3;
-  close (fd);
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
 
-  /* Next, check that the tail of a page is zero-filled.  File must have
-     non-zero length, otherwise we risk SIGBUS for entire page.  */
-  fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
-  if (fd2 < 0)
-    return 4;
-  cdata2 = "";
-  if (write (fd2, cdata2, 1) != 1)
-    return 5;
-  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
-  if (data2 == MAP_FAILED)
-    return 6;
-  for (i = 0; i < pagesize; ++i)
-    if (*(data2 + i))
-      return 7;
-  close (fd2);
-  if (munmap (data2, pagesize))
-    return 8;
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
 
-  /* Next, try to mmap the file at a fixed address which already has
-     something else allocated at it.  If we can, also make sure that
-     we see the same garbage.  */
-  fd = open ("conftest.mmap", O_RDWR);
-  if (fd < 0)
-    return 9;
-  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
-                    MAP_PRIVATE | MAP_FIXED, fd, 0L))
-    return 10;
-  for (i = 0; i < pagesize; ++i)
-    if (*(data + i) != *(data2 + i))
-      return 11;
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[         ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+             test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
 
-  /* Finally, make sure that changes to the mapped area do not
-     percolate back to the file as seen by read().  (This is a bug on
-     some variants of i386 svr4.0.)  */
-  for (i = 0; i < pagesize; ++i)
-    *(data2 + i) = *(data2 + i) + 1;
-  data3 = (char *) malloc (pagesize);
-  if (!data3)
-    return 12;
-  if (read (fd, data3, pagesize) != pagesize)
-    return 13;
-  for (i = 0; i < pagesize; ++i)
-    if (*(data + i) != *(data3 + i))
-      return 14;
-  close (fd);
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_mmap_fixed_mapped=yes
-else
-  ac_cv_func_mmap_fixed_mapped=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5
-$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; }
-if test $ac_cv_func_mmap_fixed_mapped = yes; then
+max_cmd_len=$lt_cv_sys_max_cmd_len
 
-$as_echo "#define HAVE_MMAP 1" >>confdefs.h
 
-fi
-rm -f conftest.mmap conftest.txt
 
-fi
-if test "x${enable_mmap}" = "xno" \
-   -o "$ac_cv_func_mmap_fixed_mapped" != "yes"; then
-  FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
-else
-  FTSYS_SRC='$(BUILD_DIR)/ftsystem.c'
 
-  ac_fn_c_check_decl "$LINENO" "munmap" "ac_cv_have_decl_munmap" "
 
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <sys/mman.h>
 
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
 
-"
-if test "x$ac_cv_have_decl_munmap" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
 fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_MUNMAP $ac_have_decl
-_ACEOF
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for munmap's first parameter type" >&5
-$as_echo_n "checking for munmap's first parameter type... " >&6; }
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
 
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
 
-#include <unistd.h>
-#include <sys/mman.h>
-int munmap(void *, size_t);
 
 
 
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: void *" >&5
-$as_echo "void *" >&6; }
 
-$as_echo "#define MUNMAP_USES_VOIDP /**/" >>confdefs.h
 
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: char *" >&5
-$as_echo "char *" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-fi
 
 
-for ac_func in memcpy memmove
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
 
 fi
-done
 
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
 
 
-# check for system zlib
 
-# don't quote AS_HELP_STRING!
 
-# Check whether --with-zlib was given.
-if test "${with_zlib+set}" = set; then :
-  withval=$with_zlib;
-fi
 
-if test x$with_zlib != xno && test -z "$LIBZ"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzsetparams in -lz" >&5
-$as_echo_n "checking for gzsetparams in -lz... " >&6; }
-if ${ac_cv_lib_z_gzsetparams+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gzsetparams ();
-int
-main ()
-{
-return gzsetparams ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_z_gzsetparams=yes
-else
-  ac_cv_lib_z_gzsetparams=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzsetparams" >&5
-$as_echo "$ac_cv_lib_z_gzsetparams" >&6; }
-if test "x$ac_cv_lib_z_gzsetparams" = xyes; then :
-  ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_zlib_h" = xyes; then :
-  LIBZ='-lz'
 fi
 
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
 
-fi
-
-fi
-if test x$with_zlib != xno && test -n "$LIBZ"; then
-  CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB"
-  LDFLAGS="$LDFLAGS $LIBZ"
-  SYSTEM_ZLIB=yes
-fi
 
-# check for system libbz2
 
-# don't quote AS_HELP_STRING!
 
-# Check whether --with-bzip2 was given.
-if test "${with_bzip2+set}" = set; then :
-  withval=$with_bzip2;
-fi
 
-if test x$with_bzip2 != xno && test -z "$LIBBZ2"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompress in -lbz2" >&5
-$as_echo_n "checking for BZ2_bzDecompress in -lbz2... " >&6; }
-if ${ac_cv_lib_bz2_BZ2_bzDecompress+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbz2  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char BZ2_bzDecompress ();
-int
-main ()
-{
-return BZ2_bzDecompress ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_bz2_BZ2_bzDecompress=yes
-else
-  ac_cv_lib_bz2_BZ2_bzDecompress=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzDecompress" >&5
-$as_echo "$ac_cv_lib_bz2_BZ2_bzDecompress" >&6; }
-if test "x$ac_cv_lib_bz2_BZ2_bzDecompress" = xyes; then :
-  ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_bzlib_h" = xyes; then :
-  LIBBZ2='-lbz2'
+  lt_cv_ld_reload_flag='-r'
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test "$GCC" != yes; then
+      reload_cmds=false
+    fi
+    ;;
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
 
 
-fi
 
-fi
-if test x$with_bzip2 != xno && test -n "$LIBBZ2"; then
-  CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_USE_BZIP2"
-  LDFLAGS="$LDFLAGS $LIBBZ2"
-fi
 
-# Some options handling SDKs/archs in CFLAGS should be copied
-# to LDFLAGS. Apple TechNote 2137 recommends to include these
-# options in CFLAGS but not in LDFLAGS.
 
-save_config_args=$*
-set dummy ${CFLAGS}
-i=1
-while test $i -le $#
-do
-  c=$1
 
-  case "${c}" in
-  -isysroot|-arch) # options taking 1 argument
-    a=$2
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CFLAGS and LDFLAGS share ${c} ${a}" >&5
-$as_echo_n "checking whether CFLAGS and LDFLAGS share ${c} ${a}... " >&6; }
-    if expr " ${LDFLAGS} " : ".* ${c} *${a}.*" > /dev/null
-    then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, copy to LDFLAGS" >&5
-$as_echo "no, copy to LDFLAGS" >&6; }
-      LDFLAGS="${LDFLAGS} ${c} ${a}"
-    fi
-    shift 1
-    ;;
-  -m32|-m64|-march=*|-mcpu=*) # options taking no argument
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: whether CFLAGS and LDFLAGS share ${c}" >&5
-$as_echo "whether CFLAGS and LDFLAGS share ${c}" >&6; }
-    if expr " ${LDFLAGS} " : ".* ${c} *${a}.*" > /dev/null
-    then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, copy to LDFLAGS" >&5
-$as_echo "no, copy to LDFLAGS" >&6; }
-      LDFLAGS="${LDFLAGS} ${c}"
-    fi
-    ;;
-  # *)
-  #   AC_MSG_RESULT([${c} is not copied to LDFLAGS])
-  #   ;;
-  esac
 
-  shift 1
-done
-set ${save_config_args}
 
 
-# Whether to use Mac OS resource-based fonts.
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-ftmac_c="" # src/base/ftmac.c should not be included in makefiles by default
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-# don't quote AS_HELP_STRING!
 
-# Check whether --with-old-mac-fonts was given.
-if test "${with_old_mac_fonts+set}" = set; then :
-  withval=$with_old_mac_fonts;
 fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-if test x$with_old_mac_fonts = xyes; then
-  orig_LDFLAGS="${LDFLAGS}"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking CoreServices & ApplicationServices of Mac OS X" >&5
-$as_echo_n "checking CoreServices & ApplicationServices of Mac OS X... " >&6; }
-  FT2_EXTRA_LIBS="-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices"
-  LDFLAGS="$LDFLAGS $FT2_EXTRA_LIBS"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
 
+test -z "$OBJDUMP" && OBJDUMP=objdump
 
-#if defined(__GNUC__) && defined(__APPLE_CC__)
-# include <CoreServices/CoreServices.h>
-# include <ApplicationServices/ApplicationServices.h>
-#else
-# include <ConditionalMacros.h>
-# include <Files.h>
-#endif
 
 
-int
-main ()
-{
 
 
-        short res = 0;
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
 
-        UseResFile( res );
+case $host_os in
+aix[4-9]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-     ftmac_c='ftmac.c'
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OS_INLINE macro is ANSI compatible" >&5
-$as_echo_n "checking whether OS_INLINE macro is ANSI compatible... " >&6; }
-     orig_CFLAGS="$CFLAGS -DFT_MACINTOSH"
-     CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS"
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
 
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
 
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
 
-#if defined(__GNUC__) && defined(__APPLE_CC__)
-# include <CoreServices/CoreServices.h>
-# include <ApplicationServices/ApplicationServices.h>
-#else
-# include <ConditionalMacros.h>
-# include <Files.h>
-#endif
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
 
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-int
-main ()
-{
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
 
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-           /* OSHostByteOrder() is typed as OS_INLINE */
-           int32_t  os_byte_order = OSHostByteOrder();
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
 
+interix[3-9]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
 
-           if ( OSBigEndian != os_byte_order )
-             return 1;
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-        CFLAGS="$orig_CFLAGS"
-        CFLAGS="$CFLAGS -DHAVE_ANSI_OS_INLINE=1"
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, ANSI incompatible" >&5
-$as_echo "no, ANSI incompatible" >&6; }
-        CFLAGS="$orig_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking type ResourceIndex" >&5
-$as_echo_n "checking type ResourceIndex... " >&6; }
-     orig_CFLAGS="$CFLAGS"
-     CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS"
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-#if defined(__GNUC__) && defined(__APPLE_CC__)
-# include <CoreServices/CoreServices.h>
-# include <ApplicationServices/ApplicationServices.h>
-#else
-# include <ConditionalMacros.h>
-# include <Files.h>
-# include <Resources.h>
-#endif
+netbsd* | netbsdelf*-gnu)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
 
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
 
-int
-main ()
-{
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
 
-           ResourceIndex i = 0;
-           return i;
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-        CFLAGS="$orig_CFLAGS"
-        CFLAGS="$CFLAGS -DHAVE_TYPE_RESOURCE_INDEX=1"
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-        CFLAGS="$orig_CFLAGS"
-        CFLAGS="$CFLAGS -DHAVE_TYPE_RESOURCE_INDEX=0"
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-     FT2_EXTRA_LIBS=""
-     LDFLAGS="${orig_LDFLAGS}"
-     CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  case x$host_os in
-  xdarwin*)
-        CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
     ;;
-  *)
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
     ;;
   esac
-fi
-
-
-# Whether to use FileManager which is deprecated since Mac OS X 10.4.
+  ;;
 
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
 
-# Check whether --with-fsspec was given.
-if test "${with_fsspec+set}" = set; then :
-  withval=$with_fsspec;
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
 
-if test x$with_fsspec = xno; then
-  CFLAGS="$CFLAGS -DHAVE_FSSPEC=0"
-elif test x$with_old_mac_fonts = xyes -a x$with_fsspec != x; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking FSSpec-based FileManager" >&5
-$as_echo_n "checking FSSpec-based FileManager... " >&6; }
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
 
-#if defined(__GNUC__) && defined(__APPLE_CC__)
-# include <CoreServices/CoreServices.h>
-# include <ApplicationServices/ApplicationServices.h>
-#else
-# include <ConditionalMacros.h>
-# include <Files.h>
-#endif
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
-int
-main ()
-{
 
 
-        FCBPBPtr          paramBlock;
-        short             vRefNum;
-        long              dirID;
-        ConstStr255Param  fileName;
-        FSSpec*           spec;
 
 
-        /* FSSpec functions: deprecated since Mac OS X 10.4 */
-        PBGetFCBInfoSync( paramBlock );
-        FSMakeFSSpec( vRefNum, dirID, fileName, spec );
 
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-     CFLAGS="$CFLAGS -DHAVE_FSSPEC=1"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-     CFLAGS="$CFLAGS -DHAVE_FSSPEC=0"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
 
 
-# Whether to use FileManager in Carbon since MacOS 9.x.
 
 
-# Check whether --with-fsref was given.
-if test "${with_fsref+set}" = set; then :
-  withval=$with_fsref;
-fi
 
-if test x$with_fsref = xno; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
-*** WARNING
-    FreeType2 built without FSRef API cannot load
-    data-fork fonts on MacOS, except of XXX.dfont.
-    " >&5
-$as_echo "$as_me: WARNING:
-*** WARNING
-    FreeType2 built without FSRef API cannot load
-    data-fork fonts on MacOS, except of XXX.dfont.
-    " >&2;}
-  CFLAGS="$CFLAGS -DHAVE_FSREF=0"
-elif test x$with_old_mac_fonts = xyes -a x$with_fsref != x; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking FSRef-based FileManager" >&5
-$as_echo_n "checking FSRef-based FileManager... " >&6; }
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
 
 
-#if defined(__GNUC__) && defined(__APPLE_CC__)
-# include <CoreServices/CoreServices.h>
-# include <ApplicationServices/ApplicationServices.h>
-#else
-# include <ConditionalMacros.h>
-# include <Files.h>
-#endif
 
 
-int
-main ()
-{
 
 
-        short                vRefNum;
-        long                 dirID;
-        ConstStr255Param     fileName;
 
-        Boolean*             isDirectory;
-        UInt8*               path;
-        SInt16               desiredRefNum;
-        SInt16*              iterator;
-        SInt16*              actualRefNum;
-        HFSUniStr255*        outForkName;
-        FSVolumeRefNum       volume;
-        FSCatalogInfoBitmap  whichInfo;
-        FSCatalogInfo*       catalogInfo;
-        FSForkInfo*          forkInfo;
-        FSRef*               ref;
 
-#if HAVE_FSSPEC
-        FSSpec*              spec;
-#endif
-
-        /* FSRef functions: no need to check? */
-        FSGetForkCBInfo( desiredRefNum, volume, iterator,
-                         actualRefNum, forkInfo, ref,
-                         outForkName );
-        FSPathMakeRef( path, ref, isDirectory );
-
-#if HAVE_FSSPEC
-        FSpMakeFSRef ( spec, ref );
-        FSGetCatalogInfo( ref, whichInfo, catalogInfo,
-                          outForkName, spec, ref );
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-     CFLAGS="$CFLAGS -DHAVE_FSREF=1"
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-     CFLAGS="$CFLAGS -DHAVE_FSREF=0"
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 fi
-
-
-# Whether to use QuickDraw API in ToolBox which is deprecated since
-# Mac OS X 10.4.
-
-
-# Check whether --with-quickdraw-toolbox was given.
-if test "${with_quickdraw_toolbox+set}" = set; then :
-  withval=$with_quickdraw_toolbox;
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-if test x$with_quickdraw_toolbox = xno; then
-  CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=0"
-elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_toolbox != x; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking QuickDraw FontManager functions in ToolBox" >&5
-$as_echo_n "checking QuickDraw FontManager functions in ToolBox... " >&6; }
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-#if defined(__GNUC__) && defined(__APPLE_CC__)
-# include <CoreServices/CoreServices.h>
-# include <ApplicationServices/ApplicationServices.h>
-#else
-# include <ConditionalMacros.h>
-# include <Fonts.h>
-#endif
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
 
+test -z "$DLLTOOL" && DLLTOOL=dlltool
 
-int
-main ()
-{
 
 
-        Str255     familyName;
-        SInt16     familyID   = 0;
-        FMInput*   fmIn       = NULL;
-        FMOutput*  fmOut      = NULL;
 
 
-        GetFontName( familyID, familyName );
-        GetFNum( familyName, &familyID );
-        fmOut = FMSwapFont( fmIn );
 
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-     CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=1"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-     CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=0"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-
-
-# Whether to use QuickDraw API in Carbon which is deprecated since
-# Mac OS X 10.4.
+  lt_cv_sharedlib_from_linklib_cmd='unknown'
 
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  ;;
+esac
 
-# Check whether --with-quickdraw-carbon was given.
-if test "${with_quickdraw_carbon+set}" = set; then :
-  withval=$with_quickdraw_carbon;
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
 
-if test x$with_quickdraw_carbon = xno; then
-  CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=0"
-elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_carbon != x; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking QuickDraw FontManager functions in Carbon" >&5
-$as_echo_n "checking QuickDraw FontManager functions in Carbon... " >&6; }
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
 
 
-#if defined(__GNUC__) && defined(__APPLE_CC__)
-# include <CoreServices/CoreServices.h>
-# include <ApplicationServices/ApplicationServices.h>
-#else
-# include <ConditionalMacros.h>
-# include <Fonts.h>
-#endif
 
 
-int
-main ()
-{
 
 
-        FMFontFamilyIterator          famIter;
-        FMFontFamily                  family;
-        Str255                        famNameStr;
-        FMFontFamilyInstanceIterator  instIter;
-        FMFontStyle                   style;
-        FMFontSize                    size;
-        FMFont                        font;
-        FSSpec*                       pathSpec;
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ar
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-        FMCreateFontFamilyIterator( NULL, NULL, kFMUseGlobalScopeOption,
-                                    &famIter );
-        FMGetNextFontFamily( &famIter, &family );
-        FMGetFontFamilyName( family, famNameStr );
-        FMCreateFontFamilyInstanceIterator( family, &instIter );
-        FMGetNextFontFamilyInstance( &instIter, &font, &style, &size );
-        FMDisposeFontFamilyInstanceIterator( &instIter );
-        FMDisposeFontFamilyIterator( &famIter );
-        FMGetFontContainer( font, pathSpec );
 
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-     CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=1"
+    test -n "$AR" && break
+  done
+fi
+if test -z "$AR"; then
+  ac_ct_AR=$AR
+  for ac_prog in ar
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-     CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=0"
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
-# Whether to use AppleTypeService since Mac OS X.
-
-# don't quote AS_HELP_STRING!
+  test -n "$ac_ct_AR" && break
+done
 
-# Check whether --with-ats was given.
-if test "${with_ats+set}" = set; then :
-  withval=$with_ats;
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
 fi
 
-if test x$with_ats = xno; then
-  CFLAGS="$CFLAGS -DHAVE_ATS=0"
-elif test x$with_old_mac_fonts = xyes -a x$with_ats != x; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking AppleTypeService functions" >&5
-$as_echo_n "checking AppleTypeService functions... " >&6; }
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+: ${AR=ar}
+: ${AR_FLAGS=cru}
 
 
 
-#if defined(__GNUC__) && defined(__APPLE_CC__)
-# include <CoreServices/CoreServices.h>
-# include <ApplicationServices/ApplicationServices.h>
-#else
-# include <ConditionalMacros.h>
-# include <Files.h>
-#endif
 
 
-int
-main ()
-{
 
 
-        FSSpec*  pathSpec;
 
 
-        ATSFontFindFromName( NULL, kATSOptionFlagsUnRestrictedScope );
-#if HAVE_FSSPEC
-        ATSFontGetFileSpecification( 0, pathSpec );
-#endif
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ar_at_file=no
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-     CFLAGS="$CFLAGS -DHAVE_ATS=1"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-     CFLAGS="$CFLAGS -DHAVE_ATS=0"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-
-case "$CFLAGS" in
-  *HAVE_FSSPEC* | *HAVE_FSREF* | *HAVE_QUICKDRAW* | *HAVE_ATS* )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
-*** WARNING
-    FSSpec/FSRef/QuickDraw/ATS options are explicitly given,
-    thus it is recommended to replace src/base/ftmac.c by builds/mac/ftmac.c.
-    " >&5
-$as_echo "$as_me: WARNING:
-*** WARNING
-    FSSpec/FSRef/QuickDraw/ATS options are explicitly given,
-    thus it is recommended to replace src/base/ftmac.c by builds/mac/ftmac.c.
-    " >&2;}
-    CFLAGS="$CFLAGS "'-I$(TOP_DIR)/builds/mac/'
-    ;;
-  *)
-    ;;
-esac
-
-
-
-
-
-
-
+if ac_fn_c_try_compile "$LINENO"; then :
+  echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+      if test "$ac_status" -eq 0; then
+       # Ensure the archiver fails upon bogus file names.
+       rm -f conftest.$ac_objext libconftest.a
+       { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+       if test "$ac_status" -ne 0; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
 
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
 
-case `pwd` in
-  *\ * | *\    *)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
-esac
 
 
 
-macro_version='2.4.2'
-macro_revision='1.3337'
 
 
 
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
 
+test -z "$STRIP" && STRIP=:
 
 
 
 
-ltmain="$ac_aux_dir/ltmain.sh"
 
-# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
 
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
 
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
-$as_echo_n "checking how to print strings... " >&6; }
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='printf %s\n'
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
 else
-  # Use this function as a fallback that always works.
-  func_fallback_echo ()
-  {
-    eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-  }
-  ECHO='func_fallback_echo'
+  RANLIB="$ac_cv_prog_RANLIB"
 fi
 
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO ""
-}
+test -z "$RANLIB" && RANLIB=:
 
-case "$ECHO" in
-  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
-$as_echo "printf" >&6; } ;;
-  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
-$as_echo "print -r" >&6; } ;;
-  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
-$as_echo "cat" >&6; } ;;
-esac
 
 
 
 
 
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
 
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
 
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
 
 
 
@@ -5410,77 +5556,9 @@ esac
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
-     for ac_i in 1 2 3 4 5 6 7; do
-       ac_script="$ac_script$as_nl$ac_script"
-     done
-     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
-     { ac_script=; unset ac_script;}
-     if test -z "$SED"; then
-  ac_path_SED_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
-# Check for GNU ac_path_SED and select it if it is found.
-  # Check for GNU $ac_path_SED
-case `"$ac_path_SED" --version 2>&1` in
-*GNU*)
-  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo '' >> "conftest.nl"
-    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_SED_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_SED="$ac_path_SED"
-      ac_path_SED_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
 
-      $ac_path_SED_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_SED"; then
-    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
-  fi
-else
-  ac_cv_path_SED=$SED
-fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
- SED="$ac_cv_path_SED"
-  rm -f conftest.sed
 
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
 
 
 
@@ -5492,74 +5570,48 @@ Xsed="$SED -e 1s/^X//"
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
-$as_echo_n "checking for fgrep... " >&6; }
-if ${ac_cv_path_FGREP+:} false; then :
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
-   then ac_cv_path_FGREP="$GREP -F"
-   else
-     if test -z "$FGREP"; then
-  ac_path_FGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_prog in fgrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
-# Check for GNU ac_path_FGREP and select it if it is found.
-  # Check for GNU $ac_path_FGREP
-case `"$ac_path_FGREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'FGREP' >> "conftest.nl"
-    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_FGREP="$ac_path_FGREP"
-      ac_path_FGREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_FGREP_found && break 3
-    done
-  done
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
   done
 IFS=$as_save_IFS
-  if test -z "$ac_cv_path_FGREP"; then
-    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
 else
-  ac_cv_path_FGREP=$FGREP
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-   fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
-$as_echo "$ac_cv_path_FGREP" >&6; }
- FGREP="$ac_cv_path_FGREP"
 
+  test -n "$AWK" && break
+done
 
-test -z "$GREP" && GREP=grep
 
 
 
@@ -5578,656 +5630,557 @@ test -z "$GREP" && GREP=grep
 
 
 
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
 
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
-  with_gnu_ld=no
-fi
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | ?:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-       test "$with_gnu_ld" != no && break
-       ;;
-      *)
-       test "$with_gnu_ld" != yes && break
-       ;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
+# Allow CC to be a program name with arguments.
+compiler=$CC
 
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
   ;;
-*)
-  lt_cv_prog_gnu_ld=no
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris*)
+  symcode='[BDRT]'
+  ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
   ;;
 esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
 
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
 
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
 
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
 
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
 
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
 
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
 
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK '"\
+"     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
 
+  # Check to see that the pipe works correctly.
+  pipe_works=no
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
-$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if ${lt_cv_path_NM+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-       # Check to see if the nm accepts a BSD-compat flag.
-       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-       #   nm: unknown option "B" ignored
-       # Tru64's nm complains that /dev/null is an invalid object file
-       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-       */dev/null* | *'Invalid file or object type'*)
-         lt_cv_path_NM="$tmp_nm -B"
-         break
-         ;;
-       *)
-         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-         */dev/null*)
-           lt_cv_path_NM="$tmp_nm -p"
-           break
-           ;;
-         *)
-           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-           continue # so that we can try to find one that supports BSD flags
-           ;;
-         esac
-         ;;
-       esac
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
       fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
-else
-  # Didn't find any BSD compatible name lister, look for dumpbin.
-  if test -n "$DUMPBIN"; then :
-    # Let the user override the test.
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+         cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+LT_DLSYM_CONST struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+         cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_globsym_save_LIBS=$LIBS
+         lt_globsym_save_CFLAGS=$CFLAGS
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+           pipe_works=yes
+         fi
+         LIBS=$lt_globsym_save_LIBS
+         CFLAGS=$lt_globsym_save_CFLAGS
+       else
+         echo "cannot find nm_test_func in $nlist" >&5
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
   else
-    if test -n "$ac_tool_prefix"; then
-  for ac_prog in dumpbin "link -dump"
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DUMPBIN+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DUMPBIN"; then
-  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
   fi
 done
-  done
-IFS=$as_save_IFS
 
 fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
 fi
-DUMPBIN=$ac_cv_prog_DUMPBIN
-if test -n "$DUMPBIN"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
-$as_echo "$DUMPBIN" >&6; }
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
 fi
 
-
-    test -n "$DUMPBIN" && break
-  done
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+  nm_file_list_spec='@'
 fi
-if test -z "$DUMPBIN"; then
-  ac_ct_DUMPBIN=$DUMPBIN
-  for ac_prog in dumpbin "link -dump"
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DUMPBIN"; then
-  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
-if test -n "$ac_ct_DUMPBIN"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
-$as_echo "$ac_ct_DUMPBIN" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_DUMPBIN" && break
-done
-
-  if test "x$ac_ct_DUMPBIN" = x; then
-    DUMPBIN=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DUMPBIN=$ac_ct_DUMPBIN
-  fi
-fi
-
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
-    *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
-      ;;
-    *)
-      DUMPBIN=:
-      ;;
-    esac
-  fi
-
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
-  fi
-fi
-test -z "$NM" && NM=nm
-
 
 
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
-$as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if ${lt_cv_nm_interface+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_nm_interface="BSD nm"
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
-  (eval "$ac_compile" 2>conftest.err)
-  cat conftest.err >&5
-  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
-  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
-  cat conftest.err >&5
-  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
-  cat conftest.out >&5
-  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
-    lt_cv_nm_interface="MS dumpbin"
-  fi
-  rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
-$as_echo "$lt_cv_nm_interface" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
-fi
 
-# find the maximum length of command line arguments
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
-$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if ${lt_cv_sys_max_cmd_len+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-    i=0
-  teststring="ABCD"
 
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
 
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
 
-  cygwin* | mingw* | cegcc*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
 
-  mint*)
-    # On MiNT this can take a long time and run out of memory.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
 
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
 
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
 
-  os2*)
-    # The test takes a long time on OS/2.
-    lt_cv_sys_max_cmd_len=8192
-    ;;
 
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[         ]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      # Make teststring a little bigger before we do anything with it.
-      # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
-        teststring=$teststring$teststring
-      done
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      # If test is not a shell built-in, we'll probably end up computing a
-      # maximum length that is only half of the actual maximum length, but
-      # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
-                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-             test $i != 17 # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      # Only check the string length outside the loop.
-      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on
-      # massive amounts of additional arguments before passing them to the
-      # linker.  It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
-    ;;
-  esac
 
-fi
 
-if test -n $lt_cv_sys_max_cmd_len ; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
-$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
 
 
 
 
 
 
-: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,b/c, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
 
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  lt_unset=unset
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+  withval=$with_sysroot;
 else
-  lt_unset=false
+  with_sysroot=no
 fi
 
 
-
-
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  lt_SP2NL='tr \040 \012'
-  lt_NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  lt_SP2NL='tr \100 \n'
-  lt_NL2SP='tr \r\n \100\100'
-  ;;
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+   if test "$GCC" = yes; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+   as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+   ;;
 esac
 
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
 
 
 
 
 
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+  enableval=$enable_libtool_lock;
+fi
 
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-if ${lt_cv_to_host_file_cmd+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-        ;;
-    esac
-    ;;
-  *-*-cygwin* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_noop
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-        ;;
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+       HPUX_IA64_MODE="32"
+       ;;
+      *ELF-64*)
+       HPUX_IA64_MODE="64"
+       ;;
     esac
-    ;;
-  * ) # unhandled hosts (and "normal" native builds)
-    lt_cv_to_host_file_cmd=func_convert_file_noop
-    ;;
-esac
-
-fi
-
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -melf32bsmip"
+         ;;
+       *N32*)
+         LD="${LD-ld} -melf32bmipn32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -melf64bmip"
+       ;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -32"
+         ;;
+       *N32*)
+         LD="${LD-ld} -n32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -64"
+         ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
 
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_i386_fbsd"
+           ;;
+         x86_64-*linux*)
+           case `/usr/bin/file conftest.o` in
+             *x86-64*)
+               LD="${LD-ld} -m elf32_x86_64"
+               ;;
+             *)
+               LD="${LD-ld} -m elf_i386"
+               ;;
+           esac
+           ;;
+         powerpc64le-*)
+           LD="${LD-ld} -m elf32lppclinux"
+           ;;
+         powerpc64-*)
+           LD="${LD-ld} -m elf32ppclinux"
+           ;;
+         s390x-*linux*)
+           LD="${LD-ld} -m elf_s390"
+           ;;
+         sparc64-*linux*)
+           LD="${LD-ld} -m elf32_sparc"
+           ;;
+       esac
+       ;;
+      *64-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_x86_64_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_x86_64"
+           ;;
+         powerpcle-*)
+           LD="${LD-ld} -m elf64lppc"
+           ;;
+         powerpc-*)
+           LD="${LD-ld} -m elf64ppc"
+           ;;
+         s390*-*linux*|s390*-*tpf*)
+           LD="${LD-ld} -m elf64_s390"
+           ;;
+         sparc*-*linux*)
+           LD="${LD-ld} -m elf64_sparc"
+           ;;
+       esac
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
 
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+int
+main ()
+{
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-if ${lt_cv_to_tool_file_cmd+:} false; then :
-  $as_echo_n "(cached) " >&6
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_cc_needs_belf=yes
 else
-  #assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+  lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*)
+        case $host in
+        i?86-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD="${LD-ld}_sol2"
+        fi
         ;;
+      *)
+       if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+         LD="${LD-ld} -64"
+       fi
+       ;;
+      esac
+      ;;
     esac
-    ;;
+  fi
+  rm -rf conftest*
+  ;;
 esac
 
-fi
-
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
-$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if ${lt_cv_ld_reload_flag+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_reload_flag='-r'
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
-$as_echo "$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
-      reload_cmds=false
-    fi
-    ;;
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-
-
-
-
-
-
-
-
+need_locks="$enable_libtool_lock"
 
 if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$OBJDUMP"; then
-  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+  if test -n "$MANIFEST_TOOL"; then
+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -6235,8 +6188,8 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -6246,10 +6199,10 @@ IFS=$as_save_IFS
 
 fi
 fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -6257,17 +6210,17 @@ fi
 
 
 fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
-  ac_ct_OBJDUMP=$OBJDUMP
-  # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+  # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_OBJDUMP"; then
-  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+  if test -n "$ac_ct_MANIFEST_TOOL"; then
+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -6275,8 +6228,8 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -6286,17 +6239,17 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_OBJDUMP" = x; then
-    OBJDUMP="false"
+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
+    MANIFEST_TOOL=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
@@ -6304,273 +6257,142 @@ yes:)
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    OBJDUMP=$ac_ct_OBJDUMP
+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
   fi
 else
-  OBJDUMP="$ac_cv_prog_OBJDUMP"
+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
 fi
 
-test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&5
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
 
 
 
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
-$as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if ${lt_cv_deplibs_check_method+:} false; then :
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[4-9]*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-bsdi[45]*)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-cygwin*)
-  # func_win32_libid is a shell function defined in ltmain.sh
-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='func_win32_libid'
-  ;;
 
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump',
-  # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
-    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-    lt_cv_file_magic_cmd='func_win32_libid'
-  else
-    # Keep this pattern in sync with the one in func_win32_libid.
-    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-    lt_cv_file_magic_cmd='$OBJDUMP -f'
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
-  ;;
-
-cegcc*)
-  # use the weaker test based on 'objdump'. See mingw*.
-  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
+done
+  done
+IFS=$as_save_IFS
 
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
   else
-    lt_cv_deplibs_check_method=pass_all
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DSYMUTIL=$ac_ct_DSYMUTIL
   fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-haiku*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20* | hpux11*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  case $host_cpu in
-  ia64*)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
-    ;;
-  hppa*64*)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
-    ;;
-  *)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
-    ;;
-  esac
-  ;;
-
-interix[3-9]*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-*nto* | *qnx*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-rdos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
-
-tpf*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
-$as_echo "$lt_cv_deplibs_check_method" >&6; }
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
-  case $host_os in
-  mingw* | pw32*)
-    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-      want_nocaseglob=yes
-    else
-      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
-    fi
-    ;;
-  esac
+else
+  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
 fi
 
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; then :
+if ${ac_cv_prog_NMEDIT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$DLLTOOL"; then
-  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+  if test -n "$NMEDIT"; then
+  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -6578,8 +6400,8 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -6589,10 +6411,10 @@ IFS=$as_save_IFS
 
 fi
 fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -6600,17 +6422,17 @@ fi
 
 
 fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
-  ac_ct_DLLTOOL=$DLLTOOL
-  # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
+if test -z "$ac_cv_prog_NMEDIT"; then
+  ac_ct_NMEDIT=$NMEDIT
+  # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_DLLTOOL"; then
-  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+  if test -n "$ac_ct_NMEDIT"; then
+  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -6618,8 +6440,8 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_NMEDIT="nmedit"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -6629,17 +6451,17 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-if test -n "$ac_ct_DLLTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_DLLTOOL" = x; then
-    DLLTOOL="false"
+  if test "x$ac_ct_NMEDIT" = x; then
+    NMEDIT=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
@@ -6647,114 +6469,62 @@ yes:)
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    DLLTOOL=$ac_ct_DLLTOOL
+    NMEDIT=$ac_ct_NMEDIT
   fi
 else
-  DLLTOOL="$ac_cv_prog_DLLTOOL"
+  NMEDIT="$ac_cv_prog_NMEDIT"
 fi
 
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
-  case `$DLLTOOL --help 2>&1` in
-  *--identify-strict*)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-    ;;
-  *)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-    ;;
-  esac
-  ;;
-*)
-  # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
-  ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  for ac_prog in ar
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-    test -n "$AR" && break
-  done
 fi
-if test -z "$AR"; then
-  ac_ct_AR=$AR
-  for ac_prog in ar
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+if test -z "$ac_cv_prog_LIPO"; then
+  ac_ct_LIPO=$LIPO
+  # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+  if test -n "$ac_ct_LIPO"; then
+  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -6762,8 +6532,8 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_AR="$ac_prog"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_LIPO="lipo"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -6773,21 +6543,17 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-
-  test -n "$ac_ct_AR" && break
-done
-
-  if test "x$ac_ct_AR" = x; then
-    AR="false"
+  if test "x$ac_ct_LIPO" = x; then
+    LIPO=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
@@ -6795,91 +6561,22 @@ yes:)
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    AR=$ac_ct_AR
+    LIPO=$ac_ct_LIPO
   fi
-fi
-
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-$as_echo_n "checking for archiver @FILE support... " >&6; }
-if ${lt_cv_ar_at_file+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ar_at_file=no
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  echo conftest.$ac_objext > conftest.lst
-      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
-      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-  (eval $lt_ar_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-      if test "$ac_status" -eq 0; then
-       # Ensure the archiver fails upon bogus file names.
-       rm -f conftest.$ac_objext libconftest.a
-       { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-  (eval $lt_ar_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-       if test "$ac_status" -ne 0; then
-          lt_cv_ar_at_file=@
-        fi
-      fi
-      rm -f conftest.* libconftest.a
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-$as_echo "$lt_cv_ar_at_file" >&6; }
-
-if test "x$lt_cv_ar_at_file" = xno; then
-  archiver_list_spec=
 else
-  archiver_list_spec=$lt_cv_ar_at_file
+  LIPO="$ac_cv_prog_LIPO"
 fi
 
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
+if ${ac_cv_prog_OTOOL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+  if test -n "$OTOOL"; then
+  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -6887,8 +6584,8 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -6898,10 +6595,10 @@ IFS=$as_save_IFS
 
 fi
 fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -6909,17 +6606,17 @@ fi
 
 
 fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
+if test -z "$ac_cv_prog_OTOOL"; then
+  ac_ct_OTOOL=$OTOOL
+  # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+  if test -n "$ac_ct_OTOOL"; then
+  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -6927,8 +6624,8 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_STRIP="strip"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OTOOL="otool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -6938,17 +6635,17 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
+  if test "x$ac_ct_OTOOL" = x; then
+    OTOOL=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
@@ -6956,29 +6653,22 @@ yes:)
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    STRIP=$ac_ct_STRIP
+    OTOOL=$ac_ct_OTOOL
   fi
 else
-  STRIP="$ac_cv_prog_STRIP"
+  OTOOL="$ac_cv_prog_OTOOL"
 fi
 
-test -z "$STRIP" && STRIP=:
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
+if ${ac_cv_prog_OTOOL64+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+  if test -n "$OTOOL64"; then
+  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -6986,8 +6676,8 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -6997,10 +6687,10 @@ IFS=$as_save_IFS
 
 fi
 fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -7008,17 +6698,17 @@ fi
 
 
 fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
+if test -z "$ac_cv_prog_OTOOL64"; then
+  ac_ct_OTOOL64=$OTOOL64
+  # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+  if test -n "$ac_ct_OTOOL64"; then
+  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -7026,8 +6716,8 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OTOOL64="otool64"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -7037,17 +6727,17 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
+  if test "x$ac_ct_OTOOL64" = x; then
+    OTOOL64=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
@@ -7055,42 +6745,17 @@ yes:)
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    RANLIB=$ac_ct_RANLIB
+    OTOOL64=$ac_ct_OTOOL64
   fi
 else
-  RANLIB="$ac_cv_prog_RANLIB"
+  OTOOL64="$ac_cv_prog_OTOOL64"
 fi
 
-test -z "$RANLIB" && RANLIB=:
-
-
 
 
 
 
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
 
-case $host_os in
-  darwin*)
-    lock_old_archive_extraction=yes ;;
-  *)
-    lock_old_archive_extraction=no ;;
-esac
 
 
 
 
 
 
-for ac_prog in gawk mawk nawk awk
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+  lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+       # By default we will add the -single_module flag. You can override
+       # by either setting the environment variable LT_MULTI_MODULE
+       # non-empty at configure time, or by adding -multi_module to the
+       # link flags.
+       rm -rf libconftest.dylib*
+       echo "int foo(void){return 1;}" > conftest.c
+       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+       # If there is a non-empty error log, and "single_module"
+       # appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+         cat conftest.err >&5
+       # Otherwise, if the output was created with a 0 exit code from
+       # the compiler, it worked.
+       elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+         lt_cv_apple_cc_single_mod=yes
+       else
+         cat conftest.err >&5
+       fi
+       rm -rf libconftest.dylib*
+       rm -f conftest.*
+      fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_AWK="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+  lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_ld_exported_symbols_list=yes
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  lt_cv_ld_exported_symbols_list=no
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+       LDFLAGS="$save_LDFLAGS"
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
 
-  test -n "$AWK" && break
-done
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+      echo "$AR cru libconftest.a conftest.o" >&5
+      $AR cru libconftest.a conftest.o 2>&5
+      echo "$RANLIB libconftest.a" >&5
+      $RANLIB libconftest.a 2>&5
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -s conftest.err && $GREP force_load conftest.err; then
+       cat conftest.err >&5
+      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+       lt_cv_ld_force_load=yes
+      else
+       cat conftest.err >&5
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+    case $host_os in
+    rhapsody* | darwin1.[012])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+       10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+       10.[012]*)
+         _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+       10.*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
 
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
 
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
 
+fi
 
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
 
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
 
+fi
 
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
 
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
 
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
 
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
+fi
 
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-# Allow CC to be a program name with arguments.
-compiler=$CC
+fi
 
+done
 
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
-$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if ${lt_cv_sys_global_symbol_pipe+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+for ac_header in dlfcn.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
 
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
+fi
 
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+done
 
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[BCDT]'
-  ;;
-cygwin* | mingw* | pw32* | cegcc*)
-  symcode='[ABCDGISTW]'
-  ;;
-hpux*)
-  if test "$host_cpu" = ia64; then
-    symcode='[ABCDEGRST]'
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[BCDEGRST]'
-  ;;
-osf*)
-  symcode='[BCDEGQRST]'
-  ;;
-solaris*)
-  symcode='[BDRT]'
-  ;;
-sco3.2v5*)
-  symcode='[DT]'
-  ;;
-sysv4.2uw2*)
-  symcode='[DT]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[ABDT]'
-  ;;
-sysv4)
-  symcode='[DFNSTU]'
-  ;;
-esac
 
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[ABCDGIRSTW]' ;;
-esac
 
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
 
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
 
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
+# Set options
+enable_win32_dll=yes
 
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AS"; then
+  ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AS="${ac_tool_prefix}as"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
+fi
+fi
+AS=$ac_cv_prog_AS
+if test -n "$AS"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
+$as_echo "$AS" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-  # Write the raw and C identifiers.
-  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
-    # Also find C++ and __fastcall symbols from MSVC++,
-    # which start with @ or ?.
-    lt_cv_sys_global_symbol_pipe="$AWK '"\
-"     {last_section=section; section=\$ 3};"\
-"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-"     \$ 0!~/External *\|/{next};"\
-"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-"     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-"     ' prfx=^$ac_symprfx"
-  else
-    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+fi
+if test -z "$ac_cv_prog_AS"; then
+  ac_ct_AS=$AS
+  # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AS"; then
+  ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AS="as"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
-  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+done
+  done
+IFS=$as_save_IFS
 
-  # Check to see that the pipe works correctly.
-  pipe_works=no
+fi
+fi
+ac_ct_AS=$ac_cv_prog_ac_ct_AS
+if test -n "$ac_ct_AS"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
+$as_echo "$ac_ct_AS" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-  rm -f conftest*
-  cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
-  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-       mv -f "$nlist"T "$nlist"
-      else
-       rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
-       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
-         cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
-   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-# define LT_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data.  */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
-         # Now generate the symbol file.
-         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
-         cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols.  */
-LT_DLSYM_CONST struct {
-  const char *name;
-  void       *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[] =
-{
-  { "@PROGRAM@", (void *) 0 },
-_LT_EOF
-         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
-         cat <<\_LT_EOF >> conftest.$ac_ext
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
-         # Now try linking the two files.
-         mv conftest.$ac_objext conftstm.$ac_objext
-         lt_globsym_save_LIBS=$LIBS
-         lt_globsym_save_CFLAGS=$CFLAGS
-         LIBS="conftstm.$ac_objext"
-         CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
-         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
-           pipe_works=yes
-         fi
-         LIBS=$lt_globsym_save_LIBS
-         CFLAGS=$lt_globsym_save_CFLAGS
-       else
-         echo "cannot find nm_test_func in $nlist" >&5
-       fi
-      else
-       echo "cannot find nm_test_var in $nlist" >&5
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
-    fi
+  if test "x$ac_ct_AS" = x; then
+    AS="false"
   else
-    echo "$progname: failed program was:" >&5
-    cat conftest.$ac_ext >&5
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AS=$ac_ct_AS
   fi
-  rm -rf conftest* conftst*
+else
+  AS="$ac_cv_prog_AS"
+fi
 
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
 done
+  done
+IFS=$as_save_IFS
 
 fi
-
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  lt_cv_sys_global_symbol_to_cdecl=
 fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-  nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
-  nm_file_list_spec='@'
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
 
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
 
+  ;;
+esac
 
+test -z "$AS" && AS=as
 
 
 
 
 
+test -z "$DLLTOOL" && DLLTOOL=dlltool
 
 
 
 
 
+test -z "$OBJDUMP" && OBJDUMP=objdump
 
 
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-$as_echo_n "checking for sysroot... " >&6; }
-
-# Check whether --with-sysroot was given.
-if test "${with_sysroot+set}" = set; then :
-  withval=$with_sysroot;
-else
-  with_sysroot=no
-fi
-
-
-lt_sysroot=
-case ${with_sysroot} in #(
- yes)
-   if test "$GCC" = yes; then
-     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-   fi
-   ;; #(
- /*)
-   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-   ;; #(
- no|'')
-   ;; #(
- *)
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
-$as_echo "${with_sysroot}" >&6; }
-   as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
-   ;;
-esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-$as_echo "${lt_sysroot:-no}" >&6; }
-
-
-
-
 
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then :
-  enableval=$enable_libtool_lock;
-fi
 
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+        enable_dlopen=no
 
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.$ac_objext` in
-      *ELF-32*)
-       HPUX_IA64_MODE="32"
-       ;;
-      *ELF-64*)
-       HPUX_IA64_MODE="64"
-       ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
-      case `/usr/bin/file conftest.$ac_objext` in
-       *32-bit*)
-         LD="${LD-ld} -melf32bsmip"
-         ;;
-       *N32*)
-         LD="${LD-ld} -melf32bmipn32"
-         ;;
-       *64-bit*)
-         LD="${LD-ld} -melf64bmip"
-       ;;
-      esac
-    else
-      case `/usr/bin/file conftest.$ac_objext` in
-       *32-bit*)
-         LD="${LD-ld} -32"
-         ;;
-       *N32*)
-         LD="${LD-ld} -n32"
-         ;;
-       *64-bit*)
-         LD="${LD-ld} -64"
-         ;;
-      esac
-    fi
-  fi
-  rm -rf conftest*
-  ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.o` in
-      *32-bit*)
-       case $host in
-         x86_64-*kfreebsd*-gnu)
-           LD="${LD-ld} -m elf_i386_fbsd"
-           ;;
-         x86_64-*linux*)
-           LD="${LD-ld} -m elf_i386"
-           ;;
-         ppc64-*linux*|powerpc64-*linux*)
-           LD="${LD-ld} -m elf32ppclinux"
-           ;;
-         s390x-*linux*)
-           LD="${LD-ld} -m elf_s390"
-           ;;
-         sparc64-*linux*)
-           LD="${LD-ld} -m elf32_sparc"
-           ;;
-       esac
-       ;;
-      *64-bit*)
-       case $host in
-         x86_64-*kfreebsd*-gnu)
-           LD="${LD-ld} -m elf_x86_64_fbsd"
-           ;;
-         x86_64-*linux*)
-           LD="${LD-ld} -m elf_x86_64"
-           ;;
-         ppc*-*linux*|powerpc*-*linux*)
-           LD="${LD-ld} -m elf64ppc"
-           ;;
-         s390*-*linux*|s390*-*tpf*)
-           LD="${LD-ld} -m elf64_s390"
-           ;;
-         sparc*-*linux*)
-           LD="${LD-ld} -m elf64_sparc"
-           ;;
-       esac
-       ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
 
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
-$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if ${lt_cv_cc_needs_belf+:} false; then :
-  $as_echo_n "(cached) " >&6
+            # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
-  ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+  enable_shared=yes
+fi
 
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  lt_cv_cc_needs_belf=yes
-else
-  lt_cv_cc_needs_belf=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-     ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
-$as_echo "$lt_cv_cc_needs_belf" >&6; }
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-*-*solaris*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*)
-        case $host in
-        i?86-*-solaris*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        sparc*-*-solaris*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-        esac
-        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
-        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD="${LD-ld}_sol2"
-        fi
-        ;;
-      *)
-       if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
-         LD="${LD-ld} -64"
+
+
+
+
+
+  # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
        fi
-       ;;
-      esac
+      done
+      IFS="$lt_save_ifs"
       ;;
     esac
-  fi
-  rm -rf conftest*
-  ;;
-esac
+else
+  enable_static=yes
+fi
 
-need_locks="$enable_libtool_lock"
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-set dummy ${ac_tool_prefix}mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MANIFEST_TOOL"; then
-  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-fi
-fi
-MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-if test -n "$MANIFEST_TOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-$as_echo "$MANIFEST_TOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
 
-fi
-if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
-  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
-  # Extract the first word of "mt", so it can be a program name with args.
-set dummy mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_MANIFEST_TOOL"; then
-  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-fi
-fi
-ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-if test -n "$ac_ct_MANIFEST_TOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
-  if test "x$ac_ct_MANIFEST_TOOL" = x; then
-    MANIFEST_TOOL=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
-  fi
-else
-  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
-fi
 
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-if ${lt_cv_path_mainfest_tool+:} false; then :
-  $as_echo_n "(cached) " >&6
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+  withval=$with_pic; lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for lt_pkg in $withval; do
+       IFS="$lt_save_ifs"
+       if test "X$lt_pkg" = "X$lt_p"; then
+         pic_mode=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
-  lt_cv_path_mainfest_tool=no
-  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
-  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-  cat conftest.err >&5
-  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-    lt_cv_path_mainfest_tool=yes
-  fi
-  rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
-  MANIFEST_TOOL=:
+  pic_mode=default
 fi
 
 
+test -z "$pic_mode" && pic_mode=default
 
 
 
 
-  case $host_os in
-    rhapsody* | darwin*)
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DSYMUTIL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DSYMUTIL"; then
-  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-fi
-fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
-$as_echo "$DSYMUTIL" >&6; }
+
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  enable_fast_install=yes
 fi
 
 
-fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
-  ac_ct_DSYMUTIL=$DSYMUTIL
-  # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DSYMUTIL"; then
-  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-fi
-fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
-$as_echo "$ac_ct_DSYMUTIL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
-  if test "x$ac_ct_DSYMUTIL" = x; then
-    DSYMUTIL=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DSYMUTIL=$ac_ct_DSYMUTIL
-  fi
-else
-  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
-fi
 
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_NMEDIT+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$NMEDIT"; then
-  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-fi
-fi
-NMEDIT=$ac_cv_prog_NMEDIT
-if test -n "$NMEDIT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
-$as_echo "$NMEDIT" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
 
-fi
-if test -z "$ac_cv_prog_NMEDIT"; then
-  ac_ct_NMEDIT=$NMEDIT
-  # Extract the first word of "nmedit", so it can be a program name with args.
-set dummy nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_NMEDIT"; then
-  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_NMEDIT="nmedit"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-fi
-fi
-ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
-if test -n "$ac_ct_NMEDIT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
-$as_echo "$ac_ct_NMEDIT" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
-  if test "x$ac_ct_NMEDIT" = x; then
-    NMEDIT=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    NMEDIT=$ac_ct_NMEDIT
-  fi
-else
-  NMEDIT="$ac_cv_prog_NMEDIT"
-fi
 
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
-set dummy ${ac_tool_prefix}lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_LIPO+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$LIPO"; then
-  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
 
-fi
-fi
-LIPO=$ac_cv_prog_LIPO
-if test -n "$LIPO"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
-$as_echo "$LIPO" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
 
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
 fi
-if test -z "$ac_cv_prog_LIPO"; then
-  ac_ct_LIPO=$LIPO
-  # Extract the first word of "lipo", so it can be a program name with args.
-set dummy lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_LIPO"; then
-  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
 else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_LIPO="lipo"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
 fi
-ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
-if test -n "$ac_ct_LIPO"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
-$as_echo "$ac_ct_LIPO" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+rmdir .libs 2>/dev/null
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
 
-  if test "x$ac_ct_LIPO" = x; then
-    LIPO=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    LIPO=$ac_ct_LIPO
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
   fi
-else
-  LIPO="$ac_cv_prog_LIPO"
-fi
+  ;;
+esac
 
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL+:} false; then :
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$OTOOL"; then
-  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
 
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
 fi
-fi
-OTOOL=$ac_cv_prog_OTOOL
-if test -n "$OTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
-$as_echo "$OTOOL" >&6; }
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-fi
-if test -z "$ac_cv_prog_OTOOL"; then
-  ac_ct_OTOOL=$OTOOL
-  # Extract the first word of "otool", so it can be a program name with args.
-set dummy otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_OTOOL"; then
-  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_OTOOL="otool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
 
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
 fi
-fi
-ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
-if test -n "$ac_ct_OTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
-$as_echo "$ac_ct_OTOOL" >&6; }
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_OTOOL" = x; then
-    OTOOL=":"
+
   else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OTOOL=$ac_ct_OTOOL
+    MAGIC_CMD=:
   fi
-else
-  OTOOL="$ac_cv_prog_OTOOL"
 fi
 
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OTOOL64"; then
-  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
   fi
-done
-  done
-IFS=$as_save_IFS
+  ;;
+esac
 
-fi
-fi
-OTOOL64=$ac_cv_prog_OTOOL64
-if test -n "$OTOOL64"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
-$as_echo "$OTOOL64" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+# Use C for the default configuration in the libtool script
 
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-fi
-if test -z "$ac_cv_prog_OTOOL64"; then
-  ac_ct_OTOOL64=$OTOOL64
-  # Extract the first word of "otool64", so it can be a program name with args.
-set dummy otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OTOOL64"; then
-  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_OTOOL64="otool64"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-fi
-fi
-ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
-if test -n "$ac_ct_OTOOL64"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
-$as_echo "$ac_ct_OTOOL64" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+# Source file extension for C test sources.
+ac_ext=c
 
-  if test "x$ac_ct_OTOOL64" = x; then
-    OTOOL64=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OTOOL64=$ac_ct_OTOOL64
-  fi
-else
-  OTOOL64="$ac_cv_prog_OTOOL64"
-fi
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
 
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
 
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
 
 
 
 
 
 
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 
+# Allow CC to be a program name with arguments.
+compiler=$CC
 
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
 
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
 
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
 
 
+if test -n "$compiler"; then
 
+lt_prog_compiler_no_builtin_flag=
 
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+  *)
+    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+  esac
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $RM conftest*
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
 
+fi
 
 
 
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
-$as_echo_n "checking for -single_module linker flag... " >&6; }
-if ${lt_cv_apple_cc_single_mod+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
-       # By default we will add the -single_module flag. You can override
-       # by either setting the environment variable LT_MULTI_MODULE
-       # non-empty at configure time, or by adding -multi_module to the
-       # link flags.
-       rm -rf libconftest.dylib*
-       echo "int foo(void){return 1;}" > conftest.c
-       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&5
-       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
-        _lt_result=$?
-       # If there is a non-empty error log, and "single_module"
-       # appears in it, assume the flag caused a linker warning
-        if test -s conftest.err && $GREP single_module conftest.err; then
-         cat conftest.err >&5
-       # Otherwise, if the output was created with a 0 exit code from
-       # the compiler, it worked.
-       elif test -f libconftest.dylib && test $_lt_result -eq 0; then
-         lt_cv_apple_cc_single_mod=yes
-       else
-         cat conftest.err >&5
-       fi
-       rm -rf libconftest.dylib*
-       rm -f conftest.*
-      fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
-$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
-$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if ${lt_cv_ld_exported_symbols_list+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_exported_symbols_list=no
-      save_LDFLAGS=$LDFLAGS
-      echo "_main" > conftest.sym
-      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  lt_cv_ld_exported_symbols_list=yes
-else
-  lt_cv_ld_exported_symbols_list=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-       LDFLAGS="$save_LDFLAGS"
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
-$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
-$as_echo_n "checking for -force_load linker flag... " >&6; }
-if ${lt_cv_ld_force_load+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_force_load=no
-      cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
-      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
-      echo "$AR cru libconftest.a conftest.o" >&5
-      $AR cru libconftest.a conftest.o 2>&5
-      echo "$RANLIB libconftest.a" >&5
-      $RANLIB libconftest.a 2>&5
-      cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
-      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
-      _lt_result=$?
-      if test -s conftest.err && $GREP force_load conftest.err; then
-       cat conftest.err >&5
-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
-       lt_cv_ld_force_load=yes
-      else
-       cat conftest.err >&5
-      fi
-        rm -f conftest.err libconftest.a conftest conftest.c
-        rm -rf conftest.dSYM
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
-$as_echo "$lt_cv_ld_force_load" >&6; }
-    case $host_os in
-    rhapsody* | darwin1.[012])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
-    darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*) # darwin 5.x on
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-       10.0,*86*-darwin8*|10.0,*-darwin[91]*)
-         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-       10.[012]*)
-         _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-       10.*)
-         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+        ;;
       esac
-    ;;
-  esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
-      _lt_dar_single_mod='$single_module'
-    fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
-    else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
-      _lt_dsymutil='~$DSYMUTIL $lib || :'
-    else
-      _lt_dsymutil=
-    fi
-    ;;
-  esac
+      ;;
 
-for ac_header in dlfcn.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
-"
-if test "x$ac_cv_header_dlfcn_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DLFCN_H 1
-_ACEOF
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
 
-fi
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
 
-done
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
 
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static=
+      ;;
 
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='-fPIC'
+       ;;
+      esac
+      ;;
 
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
 
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
 
-# Set options
-enable_win32_dll=yes
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
 
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
-set dummy ${ac_tool_prefix}as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AS+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AS"; then
-  ac_cv_prog_AS="$AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_AS="${ac_tool_prefix}as"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
 
-fi
-fi
-AS=$ac_cv_prog_AS
-if test -n "$AS"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
-$as_echo "$AS" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
 
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl='-Xlinker '
+      if test -n "$lt_prog_compiler_pic"; then
+        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+      fi
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      else
+       lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
 
-fi
-if test -z "$ac_cv_prog_AS"; then
-  ac_ct_AS=$AS
-  # Extract the first word of "as", so it can be a program name with args.
-set dummy as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AS+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_AS"; then
-  ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_AS="as"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
 
-fi
-fi
-ac_ct_AS=$ac_cv_prog_ac_ct_AS
-if test -n "$ac_ct_AS"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
-$as_echo "$ac_ct_AS" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
 
-  if test "x$ac_ct_AS" = x; then
-    AS="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    AS=$ac_ct_AS
-  fi
-else
-  AS="$ac_cv_prog_AS"
-fi
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
 
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DLLTOOL"; then
-  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='--shared'
+       lt_prog_compiler_static='--static'
+       ;;
+      nagfor*)
+       # NAG Fortran compiler
+       lt_prog_compiler_wl='-Wl,-Wl,,'
+       lt_prog_compiler_pic='-PIC'
+       lt_prog_compiler_static='-Bstatic'
+       ;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fpic'
+       lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-qpic'
+       lt_prog_compiler_static='-qstaticlink'
+       ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+         # Sun Fortran 8.3 passes all unrecognized flags to the linker
+         lt_prog_compiler_pic='-KPIC'
+         lt_prog_compiler_static='-Bstatic'
+         lt_prog_compiler_wl=''
+         ;;
+       *Sun\ F* | *Sun*Fortran*)
+         lt_prog_compiler_pic='-KPIC'
+         lt_prog_compiler_static='-Bstatic'
+         lt_prog_compiler_wl='-Qoption ld '
+         ;;
+       *Sun\ C*)
+         # Sun C 5.9
+         lt_prog_compiler_pic='-KPIC'
+         lt_prog_compiler_static='-Bstatic'
+         lt_prog_compiler_wl='-Wl,'
+         ;;
+        *Intel*\ [CF]*Compiler*)
+         lt_prog_compiler_wl='-Wl,'
+         lt_prog_compiler_pic='-fPIC'
+         lt_prog_compiler_static='-static'
+         ;;
+       *Portland\ Group*)
+         lt_prog_compiler_wl='-Wl,'
+         lt_prog_compiler_pic='-fpic'
+         lt_prog_compiler_static='-Bstatic'
+         ;;
+       esac
+       ;;
+      esac
+      ;;
 
-fi
-fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
 
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
 
-fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
-  ac_ct_DLLTOOL=$DLLTOOL
-  # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DLLTOOL"; then
-  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
 
-fi
-fi
-ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-if test -n "$ac_ct_DLLTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+    rdos*)
+      lt_prog_compiler_static='-non_shared'
+      ;;
 
-  if test "x$ac_ct_DLLTOOL" = x; then
-    DLLTOOL="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DLLTOOL=$ac_ct_DLLTOOL
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+       lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic='-Kconform_pic'
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
   fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  DLLTOOL="$ac_cv_prog_DLLTOOL"
+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
 
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$OBJDUMP"; then
-  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
+  lt_cv_prog_compiler_pic_works=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works=yes
+     fi
+   fi
+   $RM conftest*
 
 fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
-  ac_ct_OBJDUMP=$OBJDUMP
-  # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OBJDUMP"; then
-  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_OBJDUMP="objdump"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
 
-fi
-fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
 fi
 
-  if test "x$ac_ct_OBJDUMP" = x; then
-    OBJDUMP="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OBJDUMP=$ac_ct_OBJDUMP
-  fi
-else
-  OBJDUMP="$ac_cv_prog_OBJDUMP"
 fi
 
-  ;;
-esac
-
-test -z "$AS" && AS=as
-
-
-
-
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-
-
-
 
 
-test -z "$OBJDUMP" && OBJDUMP=objdump
 
 
 
@@ -8765,31 +8269,46 @@ test -z "$OBJDUMP" && OBJDUMP=objdump
 
 
 
-        enable_dlopen=no
 
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
 
-            # Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
-  enableval=$enable_shared; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_shared=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+    :
 else
-  enable_shared=yes
+    lt_prog_compiler_static=
 fi
 
 
 
 
 
-
-
-  # Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
-  enableval=$enable_static; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_static=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  enable_static=yes
-fi
-
-
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 
 
 
 
 
 
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
-  withval=$with_pic; lt_p=${PACKAGE-default}
-    case $withval in
-    yes|no) pic_mode=$withval ;;
-    *)
-      pic_mode=default
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for lt_pkg in $withval; do
-       IFS="$lt_save_ifs"
-       if test "X$lt_pkg" = "X$lt_p"; then
-         pic_mode=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  pic_mode=default
-fi
-
-
-test -z "$pic_mode" && pic_mode=default
-
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 
 
 
 
-  # Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then :
-  enableval=$enable_fast_install; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_fast_install=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
 else
-  enable_fast_install=yes
+  need_locks=no
 fi
 
 
 
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
 
+  runpath_var=
+  allow_undefined_flag=
+  always_export_symbols=no
+  archive_cmds=
+  archive_expsym_cmds=
+  compiler_needs_object=no
+  enable_shared_with_static_runtimes=no
+  export_dynamic_flag_spec=
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic=no
+  hardcode_direct=no
+  hardcode_direct_absolute=no
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_separator=
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  inherit_rpath=no
+  link_all_deplibs=unknown
+  module_cmds=
+  module_expsym_cmds=
+  old_archive_from_new_cmds=
+  old_archive_from_expsyms_cmds=
+  thread_safe_flag_spec=
+  whole_archive_flag_spec=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
 
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  linux* | k*bsd*-gnu | gnu*)
+    link_all_deplibs=no
+    ;;
+  esac
 
+  ld_shlibs=yes
 
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+         *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
 
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-
-
-
-
-
-
-
-
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
 
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
 
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
 
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
 
+_LT_EOF
+      fi
+      ;;
 
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
 
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
 
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      export_dynamic_flag_spec='${wl}--export-all-symbols'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
 
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
 
+    haiku*)
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs=yes
+      ;;
 
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
 
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+       case $cc_basename in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+        && test "$tmp_diet" = no
+      then
+       tmp_addflag=' $pic_flag'
+       tmp_sharedflag='-shared'
+       case $cc_basename,$host_cpu in
+        pgcc*)                         # Portland Group C compiler
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95* | pgfortran*)
+                                       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       lf95*)                          # Lahey Fortran 8.1
+         whole_archive_flag_spec=
+         tmp_sharedflag='--shared' ;;
+       xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+         tmp_sharedflag='-qmkshrobj'
+         tmp_addflag= ;;
+       nvcc*)  # Cuda Compiler Driver 2.2
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object=yes
+         ;;
+       esac
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object=yes
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       esac
+       archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+           echo "local: *; };" >> $output_objdir/$libname.ver~
+           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
 
+       case $cc_basename in
+       xlf* | bgf* | bgxlf* | mpixlf*)
+         # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+         whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+         hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+         archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+         if test "x$supports_anon_versioning" = xyes; then
+           archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+             echo "local: *; };" >> $output_objdir/$libname.ver~
+             $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+         fi
+         ;;
+       esac
+      else
+        ld_shlibs=no
+      fi
+      ;;
 
+    netbsd* | netbsdelf*-gnu)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
 
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
 
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
 
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
 
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
 
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
 
+_LT_EOF
+       ;;
+       *)
+         # For security reasons, it is highly recommended that you always
+         # use absolute paths for naming shared libraries, and exclude the
+         # DT_RUNPATH tag from executables and libraries.  But doing so
+         # requires that you compile everything twice, which is a pain.
+         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+           hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+           archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         else
+           ld_shlibs=no
+         fi
+       ;;
+      esac
+      ;;
 
-test -z "$LN_S" && LN_S="ln -s"
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
 
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+    esac
 
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct=unsupported
+      fi
+      ;;
 
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       # Also, AIX nm treats weak defined symbols like other global
+       # defined symbols, whereas GNU nm marks them as "W".
+       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+         export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
 
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
 
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
 
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
 
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_direct_absolute=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      file_list_spec='${wl}-f,'
 
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         :
+         else
+         # We have old collect2
+         hardcode_direct=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L=yes
+         hardcode_libdir_flag_spec='-L$libdir'
+         hardcode_libdir_separator=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+       link_all_deplibs=no
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
 
+      export_dynamic_flag_spec='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
 
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+         /^0/ {
+             s/^0  *\([^ ]*\) *$/\1/
+             p
+         }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_="/usr/lib:/lib"
+  fi
 
+fi
 
-if test -n "${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
+  aix_libpath=$lt_cv_aix_libpath_
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
-$as_echo_n "checking for objdir... " >&6; }
-if ${lt_cv_objdir+:} false; then :
-  $as_echo_n "(cached) " >&6
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag="-z nodefs"
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
 else
-  rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
-$as_echo "$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
-
-
-
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+int
+main ()
+{
 
-cat >>confdefs.h <<_ACEOF
-#define LT_OBJDIR "$lt_cv_objdir/"
+  ;
+  return 0;
+}
 _ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
 
-
-
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+         /^0/ {
+             s/^0  *\([^ ]*\) *$/\1/
+             p
+         }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_="/usr/lib:/lib"
   fi
-  ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
 
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+fi
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+  aix_libpath=$lt_cv_aix_libpath_
+fi
 
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag=' ${wl}-bernotok'
+         allow_undefined_flag=' ${wl}-berok'
+         if test "$with_gnu_ld" = yes; then
+           # We only use this code for GNU lds that support --whole-archive.
+           whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           whole_archive_flag_spec='$convenience'
+         fi
+         archive_cmds_need_lc=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
 
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
 
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
 
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
-$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $MAGIC_CMD in
-[\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/${ac_tool_prefix}file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
-      if test -n "$file_magic_test_file"; then
-       case $deplibs_check_method in
-       "file_magic "*)
-         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-           $EGREP "$file_magic_regex" > /dev/null; then
-           :
-         else
-           cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
-$as_echo_n "checking for file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $MAGIC_CMD in
-[\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/file"
-      if test -n "$file_magic_test_file"; then
-       case $deplibs_check_method in
-       "file_magic "*)
-         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-           $EGREP "$file_magic_regex" > /dev/null; then
-           :
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+       # Native MSVC
+       hardcode_libdir_flag_spec=' '
+       allow_undefined_flag=unsupported
+       always_export_symbols=yes
+       file_list_spec='@'
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=".dll"
+       # FIXME: Setting linknames here is a bad hack.
+       archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+       archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+           sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
          else
-           cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
+           sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+         fi~
+         $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+         linknames='
+       # The linker will not automatically build a static lib if we build a DLL.
+       # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+       enable_shared_with_static_runtimes=yes
+       exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+       export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+       # Don't use ranlib
+       old_postinstall_cmds='chmod 644 $oldlib'
+       postlink_cmds='lt_outputfile="@OUTPUT@"~
+         lt_tool_outputfile="@TOOL_OUTPUT@"~
+         case $lt_outputfile in
+           *.exe|*.EXE) ;;
+           *)
+             lt_outputfile="$lt_outputfile.exe"
+             lt_tool_outputfile="$lt_tool_outputfile.exe"
+             ;;
+         esac~
+         if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+           $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+           $RM "$lt_outputfile.manifest";
+         fi'
+       ;;
+      *)
+       # Assume MSVC wrapper
+       hardcode_libdir_flag_spec=' '
+       allow_undefined_flag=unsupported
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=".dll"
+       # FIXME: Setting linknames here is a bad hack.
+       archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+       # The linker will automatically build a .lib file if we build a DLL.
+       old_archive_from_new_cmds='true'
+       # FIXME: Should let the user specify the lib program.
+       old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+       enable_shared_with_static_runtimes=yes
+       ;;
+      esac
+      ;;
 
-_LT_EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac
-fi
+    darwin* | rhapsody*)
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
+  archive_cmds_need_lc=no
+  hardcode_direct=no
+  hardcode_automatic=yes
+  hardcode_shlibpath_var=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
 
   else
-    MAGIC_CMD=:
+    whole_archive_flag_spec=''
   fi
-fi
+  link_all_deplibs=yes
+  allow_undefined_flag="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
 
+  else
+  ld_shlibs=no
   fi
-  ;;
-esac
 
-# Use C for the default configuration in the libtool script
-
-lt_save_CC="$CC"
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-objext=$objext
+      ;;
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
 
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
 
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
 
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
 
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
 
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
 
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator=:
+       hardcode_direct=yes
+       hardcode_direct_absolute=yes
+       export_dynamic_flag_spec='${wl}-E'
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       hardcode_minus_L=yes
+      fi
+      ;;
 
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
 
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
-if test -n "$compiler"; then
-
-lt_prog_compiler_no_builtin_flag=
-
-if test "$GCC" = yes; then
-  case $cc_basename in
-  nvcc*)
-    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
-  *)
-    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
-  esac
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+         # Older versions of the 11.00 compiler do not understand -b yet
+         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  lt_cv_prog_compiler_rtti_exceptions=no
-   ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_rtti_exceptions=yes
+  lt_cv_prog_compiler__b=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS -b"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler__b=yes
+       fi
+     else
+       lt_cv_prog_compiler__b=yes
      fi
    fi
-   $RM conftest*
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
 
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
-    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 else
-    :
-fi
-
+    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
 fi
 
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator=:
 
+       case $host_cpu in
+       hppa*64*|ia64*)
+         hardcode_direct=no
+         hardcode_shlibpath_var=no
+         ;;
+       *)
+         hardcode_direct=yes
+         hardcode_direct_absolute=yes
+         export_dynamic_flag_spec='${wl}-E'
 
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L=yes
+         ;;
+       esac
+      fi
+      ;;
 
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       # Try to use the -exported_symbol ld option, if it does not
+       # work, assume that -exports_file does not work either and
+       # implicitly export all symbols.
+       # This should be the same for all languages, so no per-tag cache variable.
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  save_LDFLAGS="$LDFLAGS"
+          LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_irix_exported_symbol=yes
+else
+  lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+           LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+       if test "$lt_cv_irix_exported_symbol" = yes; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+       fi
+      else
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      inherit_rpath=yes
+      link_all_deplibs=yes
+      ;;
 
-
-  lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
-
-
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl='-Wl,'
-    lt_prog_compiler_static='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       lt_prog_compiler_static='-Bstatic'
+    netbsd* | netbsdelf*-gnu)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
       fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
       ;;
 
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            lt_prog_compiler_pic='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
       ;;
 
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
+    *nto* | *qnx*)
       ;;
 
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      lt_prog_compiler_pic='-DDLL_EXPORT'
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+       hardcode_direct_absolute=yes
+       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+         export_dynamic_flag_spec='${wl}-E'
+       else
+         case $host_os in
+          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+            archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+            hardcode_libdir_flag_spec='-R$libdir'
+            ;;
+          *)
+            archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+            ;;
+         esac
+       fi
+      else
+       ld_shlibs=no
+      fi
       ;;
 
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic='-fno-common'
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
       ;;
 
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      lt_prog_compiler_static=
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
       ;;
 
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-       # +Z the default
-       ;;
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_separator=:
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z defs'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+       case `$CC -V 2>&1` in
+       *"Compilers 5.0"*)
+         wlarc=''
+         archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+         ;;
+       *)
+         wlarc='${wl}'
+         archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         ;;
+       esac
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
       *)
-       lt_prog_compiler_pic='-fPIC'
+       # The compiler driver will combine and reorder linker options,
+       # but understands `-z linker_flag'.  GCC discards it without `$wl',
+       # but is careful enough not to reorder.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       if test "$GCC" = yes; then
+         whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+       else
+         whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+       fi
        ;;
       esac
+      link_all_deplibs=yes
       ;;
 
-    interix[3-9]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
       ;;
 
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      lt_prog_compiler_can_build_shared=no
-      enable_shared=no
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds='$CC -r -o $output$reload_objs'
+         hardcode_direct=no
+        ;;
+       motorola)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
       ;;
 
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      lt_prog_compiler_pic='-fPIC -shared'
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
       ;;
 
     sysv4*MP*)
       if test -d /usr/nec; then
-       lt_prog_compiler_pic=-Kconform_pic
+       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs=yes
       fi
       ;;
 
-    *)
-      lt_prog_compiler_pic='-fPIC'
-      ;;
-    esac
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag='${wl}-z,text'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
 
-    case $cc_basename in
-    nvcc*) # Cuda Compiler Driver 2.2
-      lt_prog_compiler_wl='-Xlinker '
-      if test -n "$lt_prog_compiler_pic"; then
-        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl='-Wl,'
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       lt_prog_compiler_static='-Bstatic'
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-       lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic='-DDLL_EXPORT'
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
       ;;
 
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-       # +Z the default
-       ;;
-      *)
-       lt_prog_compiler_pic='+Z'
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+       export_dynamic_flag_spec='${wl}-Blargedynsym'
        ;;
       esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static='${wl}-a ${wl}archive'
-      ;;
+    fi
+  fi
 
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static='-non_shared'
-      ;;
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
-      case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
-      ecc*)
-       lt_prog_compiler_wl='-Wl,'
-       lt_prog_compiler_pic='-KPIC'
-       lt_prog_compiler_static='-static'
-        ;;
-      # icc used to be incompatible with GCC.
-      # ICC 10 doesn't accept -KPIC any more.
-      icc* | ifort*)
-       lt_prog_compiler_wl='-Wl,'
-       lt_prog_compiler_pic='-fPIC'
-       lt_prog_compiler_static='-static'
-        ;;
-      # Lahey Fortran 8.1.
-      lf95*)
-       lt_prog_compiler_wl='-Wl,'
-       lt_prog_compiler_pic='--shared'
-       lt_prog_compiler_static='--static'
-       ;;
-      nagfor*)
-       # NAG Fortran compiler
-       lt_prog_compiler_wl='-Wl,-Wl,,'
-       lt_prog_compiler_pic='-PIC'
-       lt_prog_compiler_static='-Bstatic'
-       ;;
-      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-       # which looks to be a dead project)
-       lt_prog_compiler_wl='-Wl,'
-       lt_prog_compiler_pic='-fpic'
-       lt_prog_compiler_static='-Bstatic'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static='-non_shared'
-        ;;
-      xl* | bgxl* | bgf* | mpixl*)
-       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
-       lt_prog_compiler_wl='-Wl,'
-       lt_prog_compiler_pic='-qpic'
-       lt_prog_compiler_static='-qstaticlink'
-       ;;
-      *)
-       case `$CC -V 2>&1 | sed 5q` in
-       *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
-         # Sun Fortran 8.3 passes all unrecognized flags to the linker
-         lt_prog_compiler_pic='-KPIC'
-         lt_prog_compiler_static='-Bstatic'
-         lt_prog_compiler_wl=''
-         ;;
-       *Sun\ F* | *Sun*Fortran*)
-         lt_prog_compiler_pic='-KPIC'
-         lt_prog_compiler_static='-Bstatic'
-         lt_prog_compiler_wl='-Qoption ld '
-         ;;
-       *Sun\ C*)
-         # Sun C 5.9
-         lt_prog_compiler_pic='-KPIC'
-         lt_prog_compiler_static='-Bstatic'
-         lt_prog_compiler_wl='-Wl,'
-         ;;
-        *Intel*\ [CF]*Compiler*)
-         lt_prog_compiler_wl='-Wl,'
-         lt_prog_compiler_pic='-fPIC'
-         lt_prog_compiler_static='-static'
-         ;;
-       *Portland\ Group*)
-         lt_prog_compiler_wl='-Wl,'
-         lt_prog_compiler_pic='-fpic'
-         lt_prog_compiler_static='-Bstatic'
-         ;;
-       esac
-       ;;
-      esac
-      ;;
+with_gnu_ld=$with_gnu_ld
 
-    newsos6)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
 
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      lt_prog_compiler_pic='-fPIC -shared'
-      ;;
 
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static='-non_shared'
-      ;;
 
-    rdos*)
-      lt_prog_compiler_static='-non_shared'
-      ;;
 
-    solaris*)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
-       lt_prog_compiler_wl='-Qoption ld ';;
-      *)
-       lt_prog_compiler_wl='-Wl,';;
-      esac
-      ;;
 
-    sunos4*)
-      lt_prog_compiler_wl='-Qoption ld '
-      lt_prog_compiler_pic='-PIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
 
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
 
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-       lt_prog_compiler_pic='-Kconform_pic'
-       lt_prog_compiler_static='-Bstatic'
-      fi
-      ;;
 
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
 
-    unicos*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_can_build_shared=no
-      ;;
 
-    uts4*)
-      lt_prog_compiler_pic='-pic'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
 
-    *)
-      lt_prog_compiler_can_build_shared=no
-      ;;
-    esac
-  fi
 
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic=
-    ;;
-  *)
-    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-    ;;
-esac
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-if ${lt_cv_prog_compiler_pic+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
 
 #
-# Check to make sure the PIC flag actually works.
+# Do we need to explicitly link libc?
 #
-if test -n "$lt_prog_compiler_pic"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works+:} false; then :
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  lt_cv_prog_compiler_pic_works=no
-   ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_pic_works=yes
-     fi
-   fi
-   $RM conftest*
+  $RM conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+       if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$lt_prog_compiler_wl
+         pic_flag=$lt_prog_compiler_pic
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$allow_undefined_flag
+         allow_undefined_flag=
+         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+         then
+           lt_cv_archive_cmds_need_lc=no
+         else
+           lt_cv_archive_cmds_need_lc=yes
+         fi
+         allow_undefined_flag=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM conftest*
 
-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
-    case $lt_prog_compiler_pic in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
-     esac
-else
-    lt_prog_compiler_pic=
-     lt_prog_compiler_can_build_shared=no
 fi
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_static_works=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler_static_works=yes
-       fi
-     else
-       lt_cv_prog_compiler_static_works=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
-$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
-    :
-else
-    lt_prog_compiler_static=
-fi
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
-  hard_links=yes
-  $RM conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
-  runpath_var=
-  allow_undefined_flag=
-  always_export_symbols=no
-  archive_cmds=
-  archive_expsym_cmds=
-  compiler_needs_object=no
-  enable_shared_with_static_runtimes=no
-  export_dynamic_flag_spec=
-  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  hardcode_automatic=no
-  hardcode_direct=no
-  hardcode_direct_absolute=no
-  hardcode_libdir_flag_spec=
-  hardcode_libdir_separator=
-  hardcode_minus_L=no
-  hardcode_shlibpath_var=unsupported
-  inherit_rpath=no
-  link_all_deplibs=unknown
-  module_cmds=
-  module_expsym_cmds=
-  old_archive_from_new_cmds=
-  old_archive_from_expsyms_cmds=
-  thread_safe_flag_spec=
-  whole_archive_flag_spec=
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-  extract_expsyms_cmds=
-
-  case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  ld_shlibs=yes
-
-  # On some targets, GNU ld is compatible enough with the native linker
-  # that we're better off using the native interface for both.
-  lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
-    case $host_os in
-      aix*)
-       # The AIX port of GNU ld has always aspired to compatibility
-       # with the native linker.  However, as the warning in the GNU ld
-       # block says, versions before 2.19.5* couldn't really create working
-       # shared libraries, regardless of the interface used.
-       case `$LD -v 2>&1` in
-         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
-         *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
-         *\ \(GNU\ Binutils\)\ [3-9]*) ;;
-         *)
-           lt_use_gnu_ld_interface=yes
-           ;;
-       esac
-       ;;
-      *)
-       lt_use_gnu_ld_interface=yes
-       ;;
-    esac
-  fi
-
-  if test "$lt_use_gnu_ld_interface" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      whole_archive_flag_spec=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>&1` in
-      *GNU\ gold*) supports_anon_versioning=yes ;;
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[3-9]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-       ld_shlibs=no
-       cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            archive_expsym_cmds=''
-        ;;
-      m68k)
-            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            hardcode_libdir_flag_spec='-L$libdir'
-            hardcode_minus_L=yes
-        ;;
-      esac
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-       allow_undefined_flag=unsupported
-       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-       # support --undefined.  This deserves some investigation.  FIXME
-       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-       ld_shlibs=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec='-L$libdir'
-      export_dynamic_flag_spec='${wl}--export-all-symbols'
-      allow_undefined_flag=unsupported
-      always_export_symbols=no
-      enable_shared_with_static_runtimes=yes
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
-
-      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-       # If the export-symbols file already is a .def file (1st line
-       # is EXPORTS), use it as is; otherwise, prepend...
-       archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-         cp $export_symbols $output_objdir/$soname.def;
-       else
-         echo EXPORTS > $output_objdir/$soname.def;
-         cat $export_symbols >> $output_objdir/$soname.def;
-       fi~
-       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-       ld_shlibs=no
-      fi
-      ;;
-
-    haiku*)
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      link_all_deplibs=yes
-      ;;
-
-    interix[3-9]*)
-      hardcode_direct=no
-      hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
-      tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
-       case $cc_basename in
-         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
-       esac
-      fi
-      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-        && test "$tmp_diet" = no
-      then
-       tmp_addflag=' $pic_flag'
-       tmp_sharedflag='-shared'
-       case $cc_basename,$host_cpu in
-        pgcc*)                         # Portland Group C compiler
-         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag'
-         ;;
-       pgf77* | pgf90* | pgf95* | pgfortran*)
-                                       # Portland Group f77 and f90 compilers
-         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag -Mnomain' ;;
-       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
-         tmp_addflag=' -i_dynamic' ;;
-       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
-         tmp_addflag=' -i_dynamic -nofor_main' ;;
-       ifc* | ifort*)                  # Intel Fortran compiler
-         tmp_addflag=' -nofor_main' ;;
-       lf95*)                          # Lahey Fortran 8.1
-         whole_archive_flag_spec=
-         tmp_sharedflag='--shared' ;;
-       xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
-         tmp_sharedflag='-qmkshrobj'
-         tmp_addflag= ;;
-       nvcc*)  # Cuda Compiler Driver 2.2
-         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         compiler_needs_object=yes
-         ;;
-       esac
-       case `$CC -V 2>&1 | sed 5q` in
-       *Sun\ C*)                       # Sun C 5.9
-         whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-         compiler_needs_object=yes
-         tmp_sharedflag='-G' ;;
-       *Sun\ F*)                       # Sun Fortran 8.3
-         tmp_sharedflag='-G' ;;
-       esac
-       archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-        if test "x$supports_anon_versioning" = xyes; then
-          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-           echo "local: *; };" >> $output_objdir/$libname.ver~
-           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-        fi
-
-       case $cc_basename in
-       xlf* | bgf* | bgxlf* | mpixlf*)
-         # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
-         whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-         hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-         archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-         if test "x$supports_anon_versioning" = xyes; then
-           archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-             echo "local: *; };" >> $output_objdir/$libname.ver~
-             $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-         fi
-         ;;
-       esac
-      else
-        ld_shlibs=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-       wlarc=
-      else
-       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
-       ld_shlibs=no
-       cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-       ld_shlibs=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
-       ld_shlibs=no
-       cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-       ;;
-       *)
-         # For security reasons, it is highly recommended that you always
-         # use absolute paths for naming shared libraries, and exclude the
-         # DT_RUNPATH tag from executables and libraries.  But doing so
-         # requires that you compile everything twice, which is a pain.
-         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-           hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-           archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-           archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-         else
-           ld_shlibs=no
-         fi
-       ;;
-      esac
-      ;;
-
-    sunos4*)
-      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-       ld_shlibs=no
-      fi
-      ;;
-    esac
-
-    if test "$ld_shlibs" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec=
-      export_dynamic_flag_spec=
-      whole_archive_flag_spec=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag=unsupported
-      always_export_symbols=yes
-      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-       # Neither direct hardcoding nor static linking is supported with a
-       # broken collect2.
-       hardcode_direct=unsupported
-      fi
-      ;;
-
-    aix[4-9]*)
-      if test "$host_cpu" = ia64; then
-       # On IA64, the linker does run time linking by default, so we don't
-       # have to do anything special.
-       aix_use_runtimelinking=no
-       exp_sym_flag='-Bexport'
-       no_entry_flag=""
-      else
-       # If we're using GNU nm, then we don't want the "-C" option.
-       # -C means demangle to AIX nm, but means don't demangle with GNU nm
-       # Also, AIX nm treats weak defined symbols like other global
-       # defined symbols, whereas GNU nm marks them as "W".
-       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-         export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-       else
-         export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-       fi
-       aix_use_runtimelinking=no
-
-       # Test if we are trying to use run time linking or normal
-       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-       # need to do runtime linking.
-       case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-         for ld_flag in $LDFLAGS; do
-         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-           aix_use_runtimelinking=yes
-           break
-         fi
-         done
-         ;;
-       esac
-
-       exp_sym_flag='-bexport'
-       no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      archive_cmds=''
-      hardcode_direct=yes
-      hardcode_direct_absolute=yes
-      hardcode_libdir_separator=':'
-      link_all_deplibs=yes
-      file_list_spec='${wl}-f,'
-
-      if test "$GCC" = yes; then
-       case $host_os in aix4.[012]|aix4.[012].*)
-       # We only want to do this on AIX 4.2 and lower, the check
-       # below for broken collect2 doesn't work under 4.3+
-         collect2name=`${CC} -print-prog-name=collect2`
-         if test -f "$collect2name" &&
-          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-         then
-         # We have reworked collect2
-         :
-         else
-         # We have old collect2
-         hardcode_direct=unsupported
-         # It fails to find uninstalled libraries when the uninstalled
-         # path is not listed in the libpath.  Setting hardcode_minus_L
-         # to unsupported forces relinking
-         hardcode_minus_L=yes
-         hardcode_libdir_flag_spec='-L$libdir'
-         hardcode_libdir_separator=
-         fi
-         ;;
-       esac
-       shared_flag='-shared'
-       if test "$aix_use_runtimelinking" = yes; then
-         shared_flag="$shared_flag "'${wl}-G'
-       fi
-      else
-       # not using gcc
-       if test "$host_cpu" = ia64; then
-       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-       # chokes on -Wl,-G. The following line is correct:
-         shared_flag='-G'
-       else
-         if test "$aix_use_runtimelinking" = yes; then
-           shared_flag='${wl}-G'
-         else
-           shared_flag='${wl}-bM:SRE'
-         fi
-       fi
-      fi
-
-      export_dynamic_flag_spec='${wl}-bexpall'
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      always_export_symbols=yes
-      if test "$aix_use_runtimelinking" = yes; then
-       # Warning - without using the other runtime loading flags (-brtl),
-       # -berok will link without error, but may produce a broken library.
-       allow_undefined_flag='-berok'
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        if test "${lt_cv_aix_libpath+set}" = set; then
-  aix_libpath=$lt_cv_aix_libpath
-else
-  if ${lt_cv_aix_libpath_+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-  lt_aix_libpath_sed='
-      /Import File Strings/,/^$/ {
-         /^0/ {
-             s/^0  *\([^ ]*\) *$/\1/
-             p
-         }
-      }'
-  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  # Check for a 64-bit object if we didn't find anything.
-  if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_="/usr/lib:/lib"
-  fi
-
-fi
-
-  aix_libpath=$lt_cv_aix_libpath_
-fi
-
-        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-      else
-       if test "$host_cpu" = ia64; then
-         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
-         allow_undefined_flag="-z nodefs"
-         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-       else
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        if test "${lt_cv_aix_libpath+set}" = set; then
-  aix_libpath=$lt_cv_aix_libpath
-else
-  if ${lt_cv_aix_libpath_+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-  lt_aix_libpath_sed='
-      /Import File Strings/,/^$/ {
-         /^0/ {
-             s/^0  *\([^ ]*\) *$/\1/
-             p
-         }
-      }'
-  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  # Check for a 64-bit object if we didn't find anything.
-  if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_="/usr/lib:/lib"
-  fi
-
-fi
-
-  aix_libpath=$lt_cv_aix_libpath_
-fi
-
-        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-         # Warning - without using the other run time loading flags,
-         # -berok will link without error, but may produce a broken library.
-         no_undefined_flag=' ${wl}-bernotok'
-         allow_undefined_flag=' ${wl}-berok'
-         if test "$with_gnu_ld" = yes; then
-           # We only use this code for GNU lds that support --whole-archive.
-           whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-         else
-           # Exported symbols can be pulled into shared objects from archives
-           whole_archive_flag_spec='$convenience'
-         fi
-         archive_cmds_need_lc=yes
-         # This is similar to how AIX traditionally builds its shared libraries.
-         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-       fi
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            archive_expsym_cmds=''
-        ;;
-      m68k)
-            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            hardcode_libdir_flag_spec='-L$libdir'
-            hardcode_minus_L=yes
-        ;;
-      esac
-      ;;
-
-    bsdi[45]*)
-      export_dynamic_flag_spec=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      case $cc_basename in
-      cl*)
-       # Native MSVC
-       hardcode_libdir_flag_spec=' '
-       allow_undefined_flag=unsupported
-       always_export_symbols=yes
-       file_list_spec='@'
-       # Tell ltmain to make .lib files, not .a files.
-       libext=lib
-       # Tell ltmain to make .dll files, not .so files.
-       shrext_cmds=".dll"
-       # FIXME: Setting linknames here is a bad hack.
-       archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-       archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-           sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-         else
-           sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-         fi~
-         $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-         linknames='
-       # The linker will not automatically build a static lib if we build a DLL.
-       # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
-       enable_shared_with_static_runtimes=yes
-       exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
-       export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-       # Don't use ranlib
-       old_postinstall_cmds='chmod 644 $oldlib'
-       postlink_cmds='lt_outputfile="@OUTPUT@"~
-         lt_tool_outputfile="@TOOL_OUTPUT@"~
-         case $lt_outputfile in
-           *.exe|*.EXE) ;;
-           *)
-             lt_outputfile="$lt_outputfile.exe"
-             lt_tool_outputfile="$lt_tool_outputfile.exe"
-             ;;
-         esac~
-         if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-           $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-           $RM "$lt_outputfile.manifest";
-         fi'
-       ;;
-      *)
-       # Assume MSVC wrapper
-       hardcode_libdir_flag_spec=' '
-       allow_undefined_flag=unsupported
-       # Tell ltmain to make .lib files, not .a files.
-       libext=lib
-       # Tell ltmain to make .dll files, not .so files.
-       shrext_cmds=".dll"
-       # FIXME: Setting linknames here is a bad hack.
-       archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-       # The linker will automatically build a .lib file if we build a DLL.
-       old_archive_from_new_cmds='true'
-       # FIXME: Should let the user specify the lib program.
-       old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
-       enable_shared_with_static_runtimes=yes
-       ;;
-      esac
-      ;;
-
-    darwin* | rhapsody*)
-
-
-  archive_cmds_need_lc=no
-  hardcode_direct=no
-  hardcode_automatic=yes
-  hardcode_shlibpath_var=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-
-  else
-    whole_archive_flag_spec=''
-  fi
-  link_all_deplibs=yes
-  allow_undefined_flag="$_lt_dar_allow_undefined"
-  case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
-     *) _lt_dar_can_shared=$GCC ;;
-  esac
-  if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=func_echo_all
-    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-
-  else
-  ld_shlibs=no
-  fi
-
-      ;;
-
-    dgux*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_shlibpath_var=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2.*)
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-       archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-       archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator=:
-      hardcode_direct=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L=yes
-      export_dynamic_flag_spec='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-       archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-       hardcode_libdir_separator=:
-       hardcode_direct=yes
-       hardcode_direct_absolute=yes
-       export_dynamic_flag_spec='${wl}-E'
-       # hardcode_minus_L: Not really in the search PATH,
-       # but as the default location of the library.
-       hardcode_minus_L=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*)
-         archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       ia64*)
-         archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-         archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       esac
-      else
-       case $host_cpu in
-       hppa*64*)
-         archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       ia64*)
-         archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-
-         # Older versions of the 11.00 compiler do not understand -b yet
-         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
-         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
-$as_echo_n "checking if $CC understands -b... " >&6; }
-if ${lt_cv_prog_compiler__b+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler__b=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS -b"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler__b=yes
-       fi
-     else
-       lt_cv_prog_compiler__b=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
-$as_echo "$lt_cv_prog_compiler__b" >&6; }
-
-if test x"$lt_cv_prog_compiler__b" = xyes; then
-    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-else
-    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-fi
-
-         ;;
-       esac
-      fi
-      if test "$with_gnu_ld" = no; then
-       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-       hardcode_libdir_separator=:
-
-       case $host_cpu in
-       hppa*64*|ia64*)
-         hardcode_direct=no
-         hardcode_shlibpath_var=no
-         ;;
-       *)
-         hardcode_direct=yes
-         hardcode_direct_absolute=yes
-         export_dynamic_flag_spec='${wl}-E'
-
-         # hardcode_minus_L: Not really in the search PATH,
-         # but as the default location of the library.
-         hardcode_minus_L=yes
-         ;;
-       esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-       # Try to use the -exported_symbol ld option, if it does not
-       # work, assume that -exports_file does not work either and
-       # implicitly export all symbols.
-       # This should be the same for all languages, so no per-tag cache variable.
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-if ${lt_cv_irix_exported_symbol+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  save_LDFLAGS="$LDFLAGS"
-          LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-int foo (void) { return 0; }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  lt_cv_irix_exported_symbol=yes
-else
-  lt_cv_irix_exported_symbol=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-           LDFLAGS="$save_LDFLAGS"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-$as_echo "$lt_cv_irix_exported_symbol" >&6; }
-       if test "$lt_cv_irix_exported_symbol" = yes; then
-          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-       fi
-      else
-       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      inherit_rpath=yes
-      link_all_deplibs=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    newsos6)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      hardcode_shlibpath_var=no
-      ;;
-
-    *nto* | *qnx*)
-      ;;
-
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-       hardcode_direct=yes
-       hardcode_shlibpath_var=no
-       hardcode_direct_absolute=yes
-       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-         archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-         export_dynamic_flag_spec='${wl}-E'
-       else
-         case $host_os in
-          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-            archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-            hardcode_libdir_flag_spec='-R$libdir'
-            ;;
-          *)
-            archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-            ;;
-         esac
-       fi
-      else
-       ld_shlibs=no
-      fi
-      ;;
-
-    os2*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      allow_undefined_flag=unsupported
-      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       allow_undefined_flag=' -expect_unresolved \*'
-       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      ;;
-
-    osf4* | osf5*)     # as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-       archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      else
-       allow_undefined_flag=' -expect_unresolved \*'
-       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
-       # Both c and cxx compiler support -rpath directly
-       hardcode_libdir_flag_spec='-rpath $libdir'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_separator=:
-      ;;
-
-    solaris*)
-      no_undefined_flag=' -z defs'
-      if test "$GCC" = yes; then
-       wlarc='${wl}'
-       archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-       archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-         $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-      else
-       case `$CC -V 2>&1` in
-       *"Compilers 5.0"*)
-         wlarc=''
-         archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
-         ;;
-       *)
-         wlarc='${wl}'
-         archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
-         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-         ;;
-       esac
-      fi
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_shlibpath_var=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
-       # The compiler driver will combine and reorder linker options,
-       # but understands `-z linker_flag'.  GCC discards it without `$wl',
-       # but is careful enough not to reorder.
-       # Supported since Solaris 2.6 (maybe 2.5.1?)
-       if test "$GCC" = yes; then
-         whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-       else
-         whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
-       fi
-       ;;
-      esac
-      link_all_deplibs=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-       # Use $CC to link under sequent, because it throws in some extra .o
-       # files that make .init and .fini sections work.
-       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-       sni)
-         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         hardcode_direct=yes # is this really true???
-       ;;
-       siemens)
-         ## LD is ld it makes a PLAMLIB
-         ## CC just makes a GrossModule.
-         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-         reload_cmds='$CC -r -o $output$reload_objs'
-         hardcode_direct=no
-        ;;
-       motorola)
-         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
-       ;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var=no
-      ;;
-
-    sysv4.3*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var=no
-      export_dynamic_flag_spec='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-       hardcode_shlibpath_var=no
-       runpath_var=LD_RUN_PATH
-       hardcode_runpath_var=yes
-       ld_shlibs=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag='${wl}-z,text'
-      archive_cmds_need_lc=no
-      hardcode_shlibpath_var=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      no_undefined_flag='${wl}-z,text'
-      allow_undefined_flag='${wl}-z,nodefs'
-      archive_cmds_need_lc=no
-      hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-R,$libdir'
-      hardcode_libdir_separator=':'
-      link_all_deplibs=yes
-      export_dynamic_flag_spec='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_shlibpath_var=no
-      ;;
-
-    *)
-      ld_shlibs=no
-      ;;
-    esac
-
-    if test x$host_vendor = xsni; then
-      case $host in
-      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-       export_dynamic_flag_spec='${wl}-Blargedynsym'
-       ;;
-      esac
-    fi
-  fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
-$as_echo "$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
-
-with_gnu_ld=$with_gnu_ld
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  $RM conftest*
-       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-       if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } 2>conftest.err; then
-         soname=conftest
-         lib=conftest
-         libobjs=conftest.$ac_objext
-         deplibs=
-         wl=$lt_prog_compiler_wl
-         pic_flag=$lt_prog_compiler_pic
-         compiler_flags=-v
-         linker_flags=-v
-         verstring=
-         output_objdir=.
-         libname=conftest
-         lt_save_allow_undefined_flag=$allow_undefined_flag
-         allow_undefined_flag=
-         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
-  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-         then
-           lt_cv_archive_cmds_need_lc=no
-         else
-           lt_cv_archive_cmds_need_lc=yes
-         fi
-         allow_undefined_flag=$lt_save_allow_undefined_flag
-       else
-         cat conftest.err 1>&5
-       fi
-       $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
-      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
-      ;;
-    esac
-  fi
-  ;;
-esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+      ;;
+    esac
+  fi
+  ;;
+esac
 
 
 
@@ -11598,17 +10203,6 @@ freebsd* | dragonfly*)
   esac
   ;;
 
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
 haiku*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
@@ -11725,7 +10319,7 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
@@ -11739,428 +10333,2389 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
   if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  lt_cv_shlibpath_overrides_runpath=no
-    save_LDFLAGS=$LDFLAGS
-    save_libdir=$libdir
-    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
-        LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+        LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+   test "$inherit_rpath" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+  if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+    ;;
+
+  *)
+    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+  lt_cv_dlopen="shl_load"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_shl_load=yes
+else
+  ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_svld_dlopen=yes
+else
+  ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_dld_link=yes
+else
+  ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+    ;;
+  *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+  # Report which library types will actually be built
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[4-9]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+
+# checks for native programs to generate building tool
+
+if test ${cross_compiling} = yes; then
+  # Extract the first word of "${build}-gcc", so it can be a program name with args.
+set dummy ${build}-gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC_BUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC_BUILD"; then
+  ac_cv_prog_CC_BUILD="$CC_BUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC_BUILD="${build}-gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC_BUILD=$ac_cv_prog_CC_BUILD
+if test -n "$CC_BUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_BUILD" >&5
+$as_echo "$CC_BUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -z "${CC_BUILD}" && # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC_BUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC_BUILD"; then
+  ac_cv_prog_CC_BUILD="$CC_BUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC_BUILD="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC_BUILD=$ac_cv_prog_CC_BUILD
+if test -n "$CC_BUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_BUILD" >&5
+$as_echo "$CC_BUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -z "${CC_BUILD}" && # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC_BUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC_BUILD"; then
+  ac_cv_prog_CC_BUILD="$CC_BUILD" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC_BUILD="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC_BUILD
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC_BUILD to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC_BUILD="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC_BUILD=$ac_cv_prog_CC_BUILD
+if test -n "$CC_BUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_BUILD" >&5
+$as_echo "$CC_BUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -z "${CC_BUILD}" && as_fn_error $? "cannot find native C compiler" "$LINENO" 5
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of native executables" >&5
+$as_echo_n "checking for suffix of native executables... " >&6; }
+  rm -f a.* b.* a_out.exe conftest.*
+  echo > conftest.c "int main() { return 0;}"
+  ${CC_BUILD} conftest.c || as_fn_error $? "native C compiler is not working" "$LINENO" 5
+  rm -f conftest.c
+  if test -x a.out -o -x b.out -o -x conftest; then
+    EXEEXT_BUILD=""
+  elif test -x a_out.exe -o -x conftest.exe; then
+    EXEEXT_BUILD=".exe"
+  elif test -x conftest.*; then
+    EXEEXT_BUILD=`echo conftest.* | sed -n '1s/^.*\././'`
+  fi
+  rm -f a.* b.* a_out.exe conftest.*
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXEEXT_BUILD" >&5
+$as_echo "$EXEEXT_BUILD" >&6; }
+else
+  CC_BUILD=${CC}
+  EXEEXT_BUILD=${EXEEXT}
+fi
+
+
+
+
+
+# auxiliary programs
+
+# Extract the first word of "rmdir", so it can be a program name with args.
+set dummy rmdir; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RMDIR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RMDIR"; then
+  ac_cv_prog_RMDIR="$RMDIR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RMDIR="rmdir"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RMDIR=$ac_cv_prog_RMDIR
+if test -n "$RMDIR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RMDIR" >&5
+$as_echo "$RMDIR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+# Since this file will be finally moved to another directory we make
+# the path of the install script absolute.  This small code snippet has
+# been taken from automake's `ylwrap' script.
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+case "$INSTALL" in
+/*)
+  ;;
+*/*)
+  INSTALL="`pwd`/$INSTALL"
+  ;;
+esac
+
+
+# checks for header files
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+for ac_header in fcntl.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+# checks for typedefs, structures, and compiler characteristics
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this sort of thing.  */
+  typedef int charset[2];
+  const charset cs = { 0, 0 };
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *pcpcc;
+  char **ppc;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  pcpcc = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++pcpcc;
+  ppc = (char**) pcpcc;
+  pcpcc = (char const *const *) ppc;
+  { /* SCO 3.2v4 cc rejects this sort of thing.  */
+    char tx;
+    char *t = &tx;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+    *t++ = 0;
+    if (s) return 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; } bx;
+    struct s *b = &bx; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+    if (!foo) return 0;
+  }
+  return !cs[0] && !zero.x;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_const=yes
+else
+  ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if ${ac_cv_sizeof_int+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int"        "$ac_includes_default"; then :
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
-  lt_cv_shlibpath_overrides_runpath=yes
-fi
+else
+  if test "$ac_cv_type_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (int)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_int=0
+   fi
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    LDFLAGS=$save_LDFLAGS
-    libdir=$save_libdir
 
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
 
-  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
 
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
 
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
 
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if ${ac_cv_sizeof_long+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :
 
-newsos6)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
+else
+  if test "$ac_cv_type_long" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_long=0
+   fi
+fi
 
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
 
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-       shlibpath_overrides_runpath=no
-       ;;
-      *)
-       shlibpath_overrides_runpath=yes
-       ;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
 
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
 
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
 
-rdos*)
-  dynamic_linker=no
-  ;;
 
-solaris*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
 
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
 
-sysv4 | sysv4.3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
+# check whether cpp computation of size of int and long in ftconfig.in works
 
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cpp computation of bit length in ftconfig.in works" >&5
+$as_echo_n "checking whether cpp computation of bit length in ftconfig.in works... " >&6; }
+orig_CPPFLAGS="${CPPFLAGS}"
+CPPFLAGS="-I${srcdir} -I. ${CPPFLAGS}"
 
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-       ;;
-    esac
+ac_clean_files=
+for f in ft2build.h ftoption.h ftstdlib.h; do
+  if test ! -f $f; then
+    ac_clean_files="$ac_clean_files $f"
+    touch $f
   fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
+done
+
+cat > conftest.c <<\_ACEOF
+#include <limits.h>
+#define FT_CONFIG_OPTIONS_H "ftoption.h"
+#define FT_CONFIG_STANDARD_LIBRARY_H "ftstdlib.h"
+#define FT_UINT_MAX  UINT_MAX
+#define FT_ULONG_MAX ULONG_MAX
+#include "ftconfig.in"
+_ACEOF
+echo >> conftest.c "#if FT_SIZEOF_INT == "${ac_cv_sizeof_int}
+echo >> conftest.c "ac_cpp_ft_sizeof_int="${ac_cv_sizeof_int}
+echo >> conftest.c "#endif"
+echo >> conftest.c "#if FT_SIZEOF_LONG == "${ac_cv_sizeof_long}
+echo >> conftest.c "ac_cpp_ft_sizeof_long="${ac_cv_sizeof_long}
+echo >> conftest.c "#endif"
 
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
+${CPP} ${CPPFLAGS} conftest.c | ${GREP} ac_cpp_ft > conftest.sh
+eval `cat conftest.sh`
+rm -f conftest.* $ac_clean_files
 
-uts4*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
+if test x != "x${ac_cpp_ft_sizeof_int}" \
+   -a x != x"${ac_cpp_ft_sizeof_long}"; then
+  unset ft_use_autoconf_sizeof_types
+else
+  ft_use_autoconf_sizeof_types=yes
+fi
 
-*)
-  dynamic_linker=no
-  ;;
+# Check whether --enable-biarch-config was given.
+if test "${enable_biarch_config+set}" = set; then :
+  enableval=$enable_biarch_config;
+fi
+
+
+case :${ft_use_autoconf_sizeof_types}:${enable_biarch_config}: in
+  :yes:yes:)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: broken but use it" >&5
+$as_echo "broken but use it" >&6; }
+    unset ft_use_autoconf_sizeof_types
+    ;;
+  ::no:)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: works but ignore it" >&5
+$as_echo "works but ignore it" >&6; }
+    ft_use_autoconf_sizeof_types=yes
+    ;;
+  ::yes: | :::)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    unset ft_use_autoconf_sizeof_types
+    ;;
+  *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    ft_use_autoconf_sizeof_types=yes
+    ;;
 esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+if test x"${ft_use_autoconf_sizeof_types}" = xyes; then
+
+$as_echo "#define FT_USE_AUTOCONF_SIZEOF_TYPES /**/" >>confdefs.h
+
 fi
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+CPPFLAGS="${orig_CPPFLAGS}"
+
+
+# checks for library functions
+
+# Here we check whether we can use our mmap file component.
+
+# Check whether --enable-mmap was given.
+if test "${enable_mmap+set}" = set; then :
+  enableval=$enable_mmap; enable_mmap="no"
+else
+  enable_mmap="yes"
 fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+if test "x${enable_mmap}" != "xno"; then
+
+
+
+  for ac_header in $ac_header_list
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
 fi
 
+done
+
+
 
 
 
 
 
 
+for ac_func in getpagesize
+do :
+  ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
+if test "x$ac_cv_func_getpagesize" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GETPAGESIZE 1
+_ACEOF
 
+fi
+done
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
+$as_echo_n "checking for working mmap... " >&6; }
+if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_mmap_fixed_mapped=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+/* malloc might have been renamed as rpl_malloc. */
+#undef malloc
 
+/* Thanks to Mike Haertel and Jim Avera for this test.
+   Here is a matrix of mmap possibilities:
+       mmap private not fixed
+       mmap private fixed at somewhere currently unmapped
+       mmap private fixed at somewhere already mapped
+       mmap shared not fixed
+       mmap shared fixed at somewhere currently unmapped
+       mmap shared fixed at somewhere already mapped
+   For private mappings, we should verify that changes cannot be read()
+   back from the file, nor mmap's back from the file at a different
+   address.  (There have been systems where private was not correctly
+   implemented like the infamous i386 svr4.0, and systems where the
+   VM page cache was not coherent with the file system buffer cache
+   like early versions of FreeBSD and possibly contemporary NetBSD.)
+   For shared mappings, we should conversely verify that changes get
+   propagated back to all the places they're supposed to be.
 
+   Grep wants private fixed already mapped.
+   The main things grep needs to know about mmap are:
+   * does it exist and is it safe to write into the mmap'd area
+   * how to use it (BSD variants)  */
 
+#include <fcntl.h>
+#include <sys/mman.h>
 
+#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
+char *malloc ();
+#endif
 
+/* This mess was copied from the GNU getpagesize.h.  */
+#ifndef HAVE_GETPAGESIZE
+# ifdef _SC_PAGESIZE
+#  define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+#  ifdef HAVE_SYS_PARAM_H
+#   include <sys/param.h>
+#   ifdef EXEC_PAGESIZE
+#    define getpagesize() EXEC_PAGESIZE
+#   else /* no EXEC_PAGESIZE */
+#    ifdef NBPG
+#     define getpagesize() NBPG * CLSIZE
+#     ifndef CLSIZE
+#      define CLSIZE 1
+#     endif /* no CLSIZE */
+#    else /* no NBPG */
+#     ifdef NBPC
+#      define getpagesize() NBPC
+#     else /* no NBPC */
+#      ifdef PAGESIZE
+#       define getpagesize() PAGESIZE
+#      endif /* PAGESIZE */
+#     endif /* no NBPC */
+#    endif /* no NBPG */
+#   endif /* no EXEC_PAGESIZE */
+#  else /* no HAVE_SYS_PARAM_H */
+#   define getpagesize() 8192  /* punt totally */
+#  endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
 
+#endif /* no HAVE_GETPAGESIZE */
 
+int
+main ()
+{
+  char *data, *data2, *data3;
+  const char *cdata2;
+  int i, pagesize;
+  int fd, fd2;
 
+  pagesize = getpagesize ();
 
+  /* First, make a file with some known garbage in it. */
+  data = (char *) malloc (pagesize);
+  if (!data)
+    return 1;
+  for (i = 0; i < pagesize; ++i)
+    *(data + i) = rand ();
+  umask (0);
+  fd = creat ("conftest.mmap", 0600);
+  if (fd < 0)
+    return 2;
+  if (write (fd, data, pagesize) != pagesize)
+    return 3;
+  close (fd);
 
+  /* Next, check that the tail of a page is zero-filled.  File must have
+     non-zero length, otherwise we risk SIGBUS for entire page.  */
+  fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
+  if (fd2 < 0)
+    return 4;
+  cdata2 = "";
+  if (write (fd2, cdata2, 1) != 1)
+    return 5;
+  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
+  if (data2 == MAP_FAILED)
+    return 6;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data2 + i))
+      return 7;
+  close (fd2);
+  if (munmap (data2, pagesize))
+    return 8;
 
+  /* Next, try to mmap the file at a fixed address which already has
+     something else allocated at it.  If we can, also make sure that
+     we see the same garbage.  */
+  fd = open ("conftest.mmap", O_RDWR);
+  if (fd < 0)
+    return 9;
+  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+                    MAP_PRIVATE | MAP_FIXED, fd, 0L))
+    return 10;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data2 + i))
+      return 11;
 
+  /* Finally, make sure that changes to the mapped area do not
+     percolate back to the file as seen by read().  (This is a bug on
+     some variants of i386 svr4.0.)  */
+  for (i = 0; i < pagesize; ++i)
+    *(data2 + i) = *(data2 + i) + 1;
+  data3 = (char *) malloc (pagesize);
+  if (!data3)
+    return 12;
+  if (read (fd, data3, pagesize) != pagesize)
+    return 13;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data3 + i))
+      return 14;
+  close (fd);
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_mmap_fixed_mapped=yes
+else
+  ac_cv_func_mmap_fixed_mapped=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5
+$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; }
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
 
+$as_echo "#define HAVE_MMAP 1" >>confdefs.h
 
+fi
+rm -f conftest.mmap conftest.txt
 
+fi
+if test "x${enable_mmap}" = "xno" \
+   -o "$ac_cv_func_mmap_fixed_mapped" != "yes"; then
+  FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
+else
+  FTSYS_SRC='$(BUILD_DIR)/ftsystem.c'
 
+  ac_fn_c_check_decl "$LINENO" "munmap" "ac_cv_have_decl_munmap" "
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <sys/mman.h>
 
 
+"
+if test "x$ac_cv_have_decl_munmap" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MUNMAP $ac_have_decl
+_ACEOF
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for munmap's first parameter type" >&5
+$as_echo_n "checking for munmap's first parameter type... " >&6; }
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
 
+#include <unistd.h>
+#include <sys/mman.h>
+int munmap(void *, size_t);
 
 
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: void *" >&5
+$as_echo "void *" >&6; }
 
+$as_echo "#define MUNMAP_USES_VOIDP /**/" >>confdefs.h
 
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: char *" >&5
+$as_echo "char *" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+fi
 
 
+for ac_func in memcpy memmove
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
 
+fi
+done
 
 
 
+# get compiler flags right
+#
+#   We try to make the compiler work for C89-strict source.  Even if the
+#   C compiler is gcc and C89 flags are available, some system headers
+#   (e.g., Android Bionic libc) are broken in C89 mode.  We have to check
+#   whether the compilation finishes successfully.
+#
+#   Due to bugs in mingwrt 4.0.3 we don't use `-ansi' for MinGW.
+#
+#   To avoid zillions of
+#
+#     ISO C90 does not support 'long long'
+#
+#   warnings, we disable `-pedantic' for gcc version < 4.6.
+#
+if test "x$GCC" = xyes; then
+  XX_CFLAGS="-Wall"
+  case "$host" in
+  *-*-mingw*)
+    XX_ANSIFLAGS="-pedantic"
+    ;;
+  *)
+    GCC_VERSION=`$CC -dumpversion`
+    GCC_MAJOR=`echo "$GCC_VERSION" | sed 's/\([^.][^.]*\).*/\1/'`
+    GCC_MINOR=`echo "$GCC_VERSION" | sed 's/[^.][^.]*.\([^.][^.]*\).*/\1/'`
 
+    XX_PEDANTIC=-pedantic
+    if test $GCC_MAJOR -lt 4; then
+      XX_PEDANTIC=
+    else
+      if test $GCC_MAJOR -eq 4 -a $GCC_MINOR -lt 6; then
+        XX_PEDANTIC=
+      fi
+    fi
 
+    XX_ANSIFLAGS=""
+    for a in $XX_PEDANTIC -ansi
+    do
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking gcc compiler flag ${a} to assure ANSI C works correctly" >&5
+$as_echo_n "checking gcc compiler flag ${a} to assure ANSI C works correctly... " >&6; }
+      orig_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} ${XX_ANSIFLAGS} ${a}"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
 
+#include <stdio.h>
 
 
+int
+main ()
+{
 
 
+            {
+              puts( "" );
+              return 0;
+            }
 
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok, add it to XX_ANSIFLAGS" >&5
+$as_echo "ok, add it to XX_ANSIFLAGS" >&6; }
+         XX_ANSIFLAGS="${XX_ANSIFLAGS} ${a}"
 
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+      CFLAGS="${orig_CFLAGS}"
+    done
+    ;;
+  esac
+else
+  case "$host" in
+  *-dec-osf*)
+    CFLAGS=
+    XX_CFLAGS="-std1 -g3"
+    XX_ANSIFLAGS=
+    ;;
+  *)
+    XX_CFLAGS=
+    XX_ANSIFLAGS=
+    ;;
+  esac
+fi
 
 
 
 
+# All library tests below try `pkg-config' first.  If that fails, a function
+# from the library is tested in the traditional autoconf way (zlib, bzip2),
+# or a config script is called (libpng).
+#
+# The `xxx_reqpriv' variables are for the `Requires.private' field in
+# `freetype2.pc'.  The `xxx_libpriv' variables are for the `Libs.private'
+# field in `freetype2.pc' if pkg-config doesn't find a proper .pc file.
+#
+# The `xxx_libstaticconf' variables are for the `freetype-config' script.
+#
+# Note that a call to PKG_CHECK_MODULES(XXX, ...) sets and creates the
+# output variables `XXX_CFLAGS' and `XXX_LIBS'.  In case one or both are set
+# for a library by the user, no entry for this library is added to
+# `Requires.private'.  Instead, it gets added to `Libs.private'
 
 
+# check for system zlib
 
 
+# Check whether --with-zlib was given.
+if test "${with_zlib+set}" = set; then :
+  withval=$with_zlib;
+else
+  with_zlib=auto
+fi
 
 
+have_zlib=no
+if test x"$with_zlib" = xyes -o x"$with_zlib" = xauto; then
+  zlib_pkg="zlib"
+  have_zlib_pkg=no
 
+  if test x"$ZLIB_CFLAGS" = x -a x"$ZLIB_LIBS" = x; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$zlib_pkg\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "$zlib_pkg") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  have_zlib_pkg=yes
+fi
+  fi
 
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZLIB" >&5
+$as_echo_n "checking for ZLIB... " >&6; }
 
+if test -n "$ZLIB_CFLAGS"; then
+    pkg_cv_ZLIB_CFLAGS="$ZLIB_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$zlib_pkg\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "$zlib_pkg") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_ZLIB_CFLAGS=`$PKG_CONFIG --cflags "$zlib_pkg" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$ZLIB_LIBS"; then
+    pkg_cv_ZLIB_LIBS="$ZLIB_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$zlib_pkg\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "$zlib_pkg") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_ZLIB_LIBS=`$PKG_CONFIG --libs "$zlib_pkg" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
 
 
 
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               ZLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$zlib_pkg" 2>&1`
+        else
+               ZLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$zlib_pkg" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$ZLIB_PKG_ERRORS" >&5
 
+       :
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       :
+else
+       ZLIB_CFLAGS=$pkg_cv_ZLIB_CFLAGS
+       ZLIB_LIBS=$pkg_cv_ZLIB_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       have_zlib="yes (pkg-config)"
+fi
 
+  if test $have_zlib_pkg = yes; then
+    # we have zlib.pc
+    zlib_reqpriv="$zlib_pkg"
+    zlib_libpriv=
+    zlib_libstaticconf=`$PKG_CONFIG --static --libs "$zlib_pkg"`
+  else
+    zlib_reqpriv=
 
+    if test "$have_zlib" != no; then
+      # ZLIB_CFLAGS and ZLIB_LIBS are set by the user
+      zlib_libpriv="$ZLIB_LIBS"
+      zlib_libstaticconf="$ZLIB_LIBS"
+      have_zlib="yes (ZLIB_CFLAGS and ZLIB_LIBS)"
+    else
+      # fall back to standard autoconf test
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzsetparams in -lz" >&5
+$as_echo_n "checking for gzsetparams in -lz... " >&6; }
+if ${ac_cv_lib_z_gzsetparams+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gzsetparams ();
+int
+main ()
+{
+return gzsetparams ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_z_gzsetparams=yes
+else
+  ac_cv_lib_z_gzsetparams=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzsetparams" >&5
+$as_echo "$ac_cv_lib_z_gzsetparams" >&6; }
+if test "x$ac_cv_lib_z_gzsetparams" = xyes; then :
+  ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+  have_zlib="yes (autoconf test)"
+                                     zlib_libpriv="-lz"
+                                     zlib_libstaticconf="$zlib_libpriv"
+                                     ZLIB_LIBS="$zlib_libpriv"
+fi
 
 
+fi
 
+    fi
+  fi
+fi
 
+if test x"$with_zlib" = xyes -a "$have_zlib" = no; then
+  as_fn_error $? "external zlib support requested but library not found" "$LINENO" 5
+fi
 
 
+# check for system libbz2
 
 
+# Check whether --with-bzip2 was given.
+if test "${with_bzip2+set}" = set; then :
+  withval=$with_bzip2;
+else
+  with_bzip2=auto
+fi
 
 
+have_bzip2=no
+if test x"$with_bzip2" = xyes -o x"$with_bzip2" = xauto; then
+  bzip2_pkg="bzip2"
+  have_bzip2_pkg=no
 
+  if test x"$BZIP2_CFLAGS" = x -a x"$BZIP2_LIBS" = x; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$bzip2_pkg\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "$bzip2_pkg") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  have_bzip2_pkg=yes
+fi
+  fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" ||
-   test -n "$runpath_var" ||
-   test "X$hardcode_automatic" = "Xyes" ; then
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZIP2" >&5
+$as_echo_n "checking for BZIP2... " >&6; }
 
-  # We can hardcode non-existent directories.
-  if test "$hardcode_direct" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
-     test "$hardcode_minus_L" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action=immediate
-  fi
+if test -n "$BZIP2_CFLAGS"; then
+    pkg_cv_BZIP2_CFLAGS="$BZIP2_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$bzip2_pkg\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "$bzip2_pkg") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_BZIP2_CFLAGS=`$PKG_CONFIG --cflags "$bzip2_pkg" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action=unsupported
+  pkg_failed=yes
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
-$as_echo "$hardcode_action" >&6; }
-
-if test "$hardcode_action" = relink ||
-   test "$inherit_rpath" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
+ else
+    pkg_failed=untried
+fi
+if test -n "$BZIP2_LIBS"; then
+    pkg_cv_BZIP2_LIBS="$BZIP2_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$bzip2_pkg\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "$bzip2_pkg") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_BZIP2_LIBS=`$PKG_CONFIG --libs "$bzip2_pkg" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
 fi
 
 
 
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
-
-
-  if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               BZIP2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$bzip2_pkg" 2>&1`
+        else
+               BZIP2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$bzip2_pkg" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$BZIP2_PKG_ERRORS" >&5
 
-  mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-    ;;
+       :
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       :
+else
+       BZIP2_CFLAGS=$pkg_cv_BZIP2_CFLAGS
+       BZIP2_LIBS=$pkg_cv_BZIP2_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       have_bzip2="yes (pkg-config)"
+fi
 
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-    ;;
+  if test $have_bzip2_pkg = yes; then
+    # we have bzip2.pc
+    bzip2_reqpriv="$bzip2_pkg"
+    bzip2_libpriv=
+    bzip2_libstaticconf=`$PKG_CONFIG --static --libs "$bzip2_pkg"`
+  else
+    bzip2_reqpriv=
 
-  darwin*)
-  # if libdl is installed we need to link against it
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
+    if test "$have_bzip2" != no; then
+      # BZIP2_CFLAGS and BZIP2_LIBS are set by the user
+      bzip2_libpriv="$BZIP2_LIBS"
+      bzip2_libstaticconf="$BZIP2_LIBS"
+      have_bzip2="yes (BZIP2_CFLAGS and BZIP2_LIBS)"
+    else
+      # fall back to standard autoconf test
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompress in -lbz2" >&5
+$as_echo_n "checking for BZ2_bzDecompress in -lbz2... " >&6; }
+if ${ac_cv_lib_bz2_BZ2_bzDecompress+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
+LIBS="-lbz2  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -12170,597 +12725,957 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char dlopen ();
+char BZ2_bzDecompress ();
 int
 main ()
 {
-return dlopen ();
+return BZ2_bzDecompress ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dl_dlopen=yes
+  ac_cv_lib_bz2_BZ2_bzDecompress=yes
 else
-  ac_cv_lib_dl_dlopen=no
+  ac_cv_lib_bz2_BZ2_bzDecompress=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzDecompress" >&5
+$as_echo "$ac_cv_lib_bz2_BZ2_bzDecompress" >&6; }
+if test "x$ac_cv_lib_bz2_BZ2_bzDecompress" = xyes; then :
+  ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_bzlib_h" = xyes; then :
+  have_bzip2="yes (autoconf test)"
+                                     bzip2_libpriv="-lbz2"
+                                     bzip2_libstaticconf="$bzip2_libpriv"
+                                     BZIP2_LIBS="$bzip2_libpriv"
+fi
+
+
+fi
+
+    fi
+  fi
+fi
+
+if test x"$with_bzip2" = xyes -a "$have_bzip2" = no; then
+  as_fn_error $? "bzip2 support requested but library not found" "$LINENO" 5
+fi
+
+
+# check for system libpng
+
+
+# Check whether --with-png was given.
+if test "${with_png+set}" = set; then :
+  withval=$with_png;
 else
+  with_png=auto
+fi
 
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
 
+have_libpng=no
+if test x"$with_png" = xyes -o x"$with_png" = xauto; then
+  libpng_pkg="libpng"
+  have_libpng_pkg=no
+
+  if test x"$LIBPNG_CFLAGS" = x -a x"$LIBPNG_LIBS" = x; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$libpng_pkg\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "$libpng_pkg") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  have_libpng_pkg=yes
 fi
+  fi
 
-    ;;
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBPNG" >&5
+$as_echo_n "checking for LIBPNG... " >&6; }
 
-  *)
-    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load"
+if test -n "$LIBPNG_CFLAGS"; then
+    pkg_cv_LIBPNG_CFLAGS="$LIBPNG_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$libpng_pkg\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "$libpng_pkg") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBPNG_CFLAGS=`$PKG_CONFIG --cflags "$libpng_pkg" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if ${ac_cv_lib_dld_shl_load+:} false; then :
-  $as_echo_n "(cached) " >&6
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$LIBPNG_LIBS"; then
+    pkg_cv_LIBPNG_LIBS="$LIBPNG_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$libpng_pkg\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "$libpng_pkg") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBPNG_LIBS=`$PKG_CONFIG --libs "$libpng_pkg" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dld_shl_load=yes
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  ac_cv_lib_dld_shl_load=no
+        _pkg_short_errors_supported=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+        if test $_pkg_short_errors_supported = yes; then
+               LIBPNG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$libpng_pkg" 2>&1`
+        else
+               LIBPNG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$libpng_pkg" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$LIBPNG_PKG_ERRORS" >&5
+
+       :
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       :
+else
+       LIBPNG_CFLAGS=$pkg_cv_LIBPNG_CFLAGS
+       LIBPNG_LIBS=$pkg_cv_LIBPNG_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       have_libpng="yes (pkg-config)"
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+
+  if test $have_libpng_pkg = yes; then
+    # we have libpng.pc
+    libpng_reqpriv="$libpng_pkg"
+    libpng_libpriv=
+    libpng_libstaticconf=`$PKG_CONFIG --static --libs "$libpng_pkg"`
+  else
+    libpng_reqpriv=
+
+    if test "$have_libpng" != no; then
+      # LIBPNG_CFLAGS and LIBPNG_LIBS are set by the user
+      libpng_libpriv="$LIBPNG_LIBS"
+      libpng_libstaticconf="$LIBPNG_LIBS"
+      have_libpng="yes (LIBPNG_CFLAGS and LIBPNG_LIBS)"
+    else
+      # fall back to config script.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpng-config" >&5
+$as_echo_n "checking for libpng-config... " >&6; }
+      if which libpng-config > /dev/null 2>&1; then
+        LIBPNG_CFLAGS=`libpng-config --cflags`
+        LIBPNG_LIBS=`libpng-config --ldflags`
+        libpng_libpriv=`libpng-config --static --ldflags`
+        libpng_libstaticconf="$libpng_libpriv"
+        have_libpng="yes (libpng-config)"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      fi
+    fi
+  fi
+fi
+
+if test x"$with_png" = xyes -a "$have_libpng" = no; then
+  as_fn_error $? "libpng support requested but library not found" "$LINENO" 5
+fi
+
+
+# check for system libharfbuzz
+
+
+# Check whether --with-harfbuzz was given.
+if test "${with_harfbuzz+set}" = set; then :
+  withval=$with_harfbuzz;
 else
-  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen"
+  with_harfbuzz=auto
+fi
+
+
+have_harfbuzz=no
+if test x"$with_harfbuzz" = xyes -o x"$with_harfbuzz" = xauto; then
+  harfbuzz_pkg="harfbuzz >= 0.9.19"
+  have_harfbuzz_pkg=no
+
+  if test x"$HARFBUZZ_CFLAGS" = x -a x"$HARFBUZZ_LIBS" = x; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$harfbuzz_pkg\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "$harfbuzz_pkg") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  have_harfbuzz_pkg=yes
+fi
+  fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for HARFBUZZ" >&5
+$as_echo_n "checking for HARFBUZZ... " >&6; }
+
+if test -n "$HARFBUZZ_CFLAGS"; then
+    pkg_cv_HARFBUZZ_CFLAGS="$HARFBUZZ_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$harfbuzz_pkg\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "$harfbuzz_pkg") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_HARFBUZZ_CFLAGS=`$PKG_CONFIG --cflags "$harfbuzz_pkg" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$HARFBUZZ_LIBS"; then
+    pkg_cv_HARFBUZZ_LIBS="$HARFBUZZ_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$harfbuzz_pkg\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "$harfbuzz_pkg") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_HARFBUZZ_LIBS=`$PKG_CONFIG --libs "$harfbuzz_pkg" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dl_dlopen=yes
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  ac_cv_lib_dl_dlopen=no
+        _pkg_short_errors_supported=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+        if test $_pkg_short_errors_supported = yes; then
+               HARFBUZZ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$harfbuzz_pkg" 2>&1`
+        else
+               HARFBUZZ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$harfbuzz_pkg" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$HARFBUZZ_PKG_ERRORS" >&5
+
+       :
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       :
+else
+       HARFBUZZ_CFLAGS=$pkg_cv_HARFBUZZ_CFLAGS
+       HARFBUZZ_LIBS=$pkg_cv_HARFBUZZ_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       have_harfbuzz="yes (pkg-config)"
+fi
+
+  if test $have_harfbuzz_pkg = yes; then
+    # we have harfbuzz.pc
+    harfbuzz_reqpriv="$harfbuzz_pkg"
+    harfbuzz_libpriv=
+    harfbuzz_libstaticconf=`$PKG_CONFIG --static --libs "$harfbuzz_pkg"`
+  else
+    harfbuzz_reqpriv=
+
+    if test "$have_harfbuzz" != no; then
+      # HARFBUZZ_CFLAGS and HARFBUZZ_LIBS are set by the user
+      harfbuzz_libpriv="$HARFBUZZ_LIBS"
+      harfbuzz_libstaticconf="$HARFBUZZ_LIBS"
+      have_harfbuzz="yes (HARFBUZZ_CFLAGS and HARFBUZZ_LIBS)"
+    else
+      # since HarfBuzz is quite a new library we don't fall back to a
+      # different test; additionally, it has too many dependencies
+      :
+    fi
+  fi
+fi
+
+if test x"$with_harfbuzz" = xyes -a "$have_harfbuzz" = no; then
+  as_fn_error $? "harfbuzz support requested but library not found" "$LINENO" 5
+fi
+
+
+# Some options handling SDKs/archs in CFLAGS should be copied
+# to LDFLAGS. Apple TechNote 2137 recommends to include these
+# options in CFLAGS but not in LDFLAGS.
+
+save_config_args=$*
+set dummy ${CFLAGS}
+i=1
+while test $i -le $#
+do
+  c=$1
+
+  case "${c}" in
+  -isysroot|-arch) # options taking 1 argument
+    a=$2
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CFLAGS and LDFLAGS share ${c} ${a}" >&5
+$as_echo_n "checking whether CFLAGS and LDFLAGS share ${c} ${a}... " >&6; }
+    if expr " ${LDFLAGS} " : ".* ${c} *${a}.*" > /dev/null
+    then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, copy to LDFLAGS" >&5
+$as_echo "no, copy to LDFLAGS" >&6; }
+      LDFLAGS="${LDFLAGS} ${c} ${a}"
+    fi
+    shift 1
+    ;;
+  -m32|-m64|-march=*|-mcpu=*) # options taking no argument
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CFLAGS and LDFLAGS share ${c}" >&5
+$as_echo_n "checking whether CFLAGS and LDFLAGS share ${c}... " >&6; }
+    if expr " ${LDFLAGS} " : ".* ${c} *${a}.*" > /dev/null
+    then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, copy to LDFLAGS" >&5
+$as_echo "no, copy to LDFLAGS" >&6; }
+      LDFLAGS="${LDFLAGS} ${c}"
+    fi
+    ;;
+  # *)
+  #   AC_MSG_RESULT([${c} is not copied to LDFLAGS])
+  #   ;;
+  esac
+
+  shift 1
+done
+set ${save_config_args}
+
+
+# Whether to use Mac OS resource-based fonts.
+
+ftmac_c="" # src/base/ftmac.c should not be included in makefiles by default
+
+
+# Check whether --with-old-mac-fonts was given.
+if test "${with_old_mac_fonts+set}" = set; then :
+  withval=$with_old_mac_fonts;
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if ${ac_cv_lib_svld_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+if test x$with_old_mac_fonts = xyes; then
+  orig_LDFLAGS="${LDFLAGS}"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking CoreServices & ApplicationServices of Mac OS X" >&5
+$as_echo_n "checking CoreServices & ApplicationServices of Mac OS X... " >&6; }
+  ft2_extra_libs="-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices"
+  LDFLAGS="$LDFLAGS $ft2_extra_libs"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
+
+
+#if defined(__GNUC__) && defined(__APPLE_CC__)
+# include <CoreServices/CoreServices.h>
+# include <ApplicationServices/ApplicationServices.h>
+#else
+# include <ConditionalMacros.h>
+# include <Files.h>
 #endif
-char dlopen ();
+
+
 int
 main ()
 {
-return dlopen ();
+
+
+        short res = 0;
+
+
+        UseResFile( res );
+
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_svld_dlopen=yes
-else
-  ac_cv_lib_svld_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
-$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
-$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if ${ac_cv_lib_dld_dld_link+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+     ftmac_c='ftmac.c'
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OS_INLINE macro is ANSI compatible" >&5
+$as_echo_n "checking whether OS_INLINE macro is ANSI compatible... " >&6; }
+     orig_CFLAGS="$CFLAGS -DFT_MACINTOSH"
+     CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS"
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
+
+
+#if defined(__GNUC__) && defined(__APPLE_CC__)
+# include <CoreServices/CoreServices.h>
+# include <ApplicationServices/ApplicationServices.h>
+#else
+# include <ConditionalMacros.h>
+# include <Files.h>
 #endif
-char dld_link ();
+
+
 int
 main ()
 {
-return dld_link ();
+
+
+           /* OSHostByteOrder() is typed as OS_INLINE */
+           int32_t  os_byte_order = OSHostByteOrder();
+
+
+           if ( OSBigEndian != os_byte_order )
+             return 1;
+
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dld_dld_link=yes
-else
-  ac_cv_lib_dld_dld_link=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
-$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
-fi
-
-
-fi
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+        CFLAGS="$orig_CFLAGS"
+        CFLAGS="$CFLAGS -DHAVE_ANSI_OS_INLINE=1"
 
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, ANSI incompatible" >&5
+$as_echo "no, ANSI incompatible" >&6; }
+        CFLAGS="$orig_CFLAGS"
 
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking type ResourceIndex" >&5
+$as_echo_n "checking type ResourceIndex... " >&6; }
+     orig_CFLAGS="$CFLAGS"
+     CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS"
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
-fi
-
 
-fi
+#if defined(__GNUC__) && defined(__APPLE_CC__)
+# include <CoreServices/CoreServices.h>
+# include <ApplicationServices/ApplicationServices.h>
+#else
+# include <ConditionalMacros.h>
+# include <Files.h>
+# include <Resources.h>
+#endif
 
 
-fi
+int
+main ()
+{
 
-    ;;
-  esac
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
+           ResourceIndex i = 0;
+           return i;
 
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-    save_LDFLAGS="$LDFLAGS"
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+        CFLAGS="$orig_CFLAGS"
+        CFLAGS="$CFLAGS -DHAVE_TYPE_RESOURCE_INDEX=1"
 
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+        CFLAGS="$orig_CFLAGS"
+        CFLAGS="$CFLAGS -DHAVE_TYPE_RESOURCE_INDEX=0"
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
-$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self+:} false; then :
-  $as_echo_n "(cached) " >&6
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-         if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self=cross
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+     ft2_extra_libs=""
+     LDFLAGS="${orig_LDFLAGS}"
+     CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
-#include "confdefs.h"
+  case x$host_os in
+  xdarwin*)
+        CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"
+    ;;
+  *)
+    ;;
+  esac
+fi
 
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
 
-#include <stdio.h>
+# Whether to use FileManager, which is deprecated since Mac OS X 10.4.
 
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL          RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL                DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL                0
-#  endif
-#endif
 
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW         DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW       RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW     DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW     0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
+# Check whether --with-fsspec was given.
+if test "${with_fsspec+set}" = set; then :
+  withval=$with_fsspec;
+fi
 
-/* When -fvisbility=hidden is used, assume the code has been annotated
-   correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
+if test x$with_fsspec = xno; then
+  CFLAGS="$CFLAGS -DHAVE_FSSPEC=0"
+elif test x$with_old_mac_fonts = xyes -a x$with_fsspec != x; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking FSSpec-based FileManager" >&5
+$as_echo_n "checking FSSpec-based FileManager... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+
+#if defined(__GNUC__) && defined(__APPLE_CC__)
+# include <CoreServices/CoreServices.h>
+# include <ApplicationServices/ApplicationServices.h>
+#else
+# include <ConditionalMacros.h>
+# include <Files.h>
 #endif
 
-int fnord () { return 42; }
-int main ()
+
+int
+main ()
 {
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else
-        {
-         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
-          else puts (dlerror ());
-       }
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
 
-  return status;
+        FCBPBPtr          paramBlock;
+        short             vRefNum;
+        long              dirID;
+        ConstStr255Param  fileName;
+        FSSpec*           spec;
+
+
+        /* FSSpec functions: deprecated since Mac OS X 10.4 */
+        PBGetFCBInfoSync( paramBlock );
+        FSMakeFSSpec( vRefNum, dirID, fileName, spec );
+
+
+  ;
+  return 0;
 }
-_LT_EOF
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
-  fi
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+     CFLAGS="$CFLAGS -DHAVE_FSSPEC=1"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+     CFLAGS="$CFLAGS -DHAVE_FSSPEC=0"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi
-rm -fr conftest*
 
 
+# Whether to use FileManager in Carbon since MacOS 9.x.
+
+
+# Check whether --with-fsref was given.
+if test "${with_fsref+set}" = set; then :
+  withval=$with_fsref;
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
-$as_echo "$lt_cv_dlopen_self" >&6; }
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
-$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self_static+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-         if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self_static=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
-#include "confdefs.h"
+if test x$with_fsref = xno; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+*** WARNING
+    FreeType2 built without FSRef API cannot load
+    data-fork fonts on MacOS, except of XXX.dfont.
+    " >&5
+$as_echo "$as_me: WARNING:
+*** WARNING
+    FreeType2 built without FSRef API cannot load
+    data-fork fonts on MacOS, except of XXX.dfont.
+    " >&2;}
+  CFLAGS="$CFLAGS -DHAVE_FSREF=0"
+elif test x$with_old_mac_fonts = xyes -a x$with_fsref != x; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking FSRef-based FileManager" >&5
+$as_echo_n "checking FSRef-based FileManager... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
 
-#include <stdio.h>
 
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL          RTLD_GLOBAL
+#if defined(__GNUC__) && defined(__APPLE_CC__)
+# include <CoreServices/CoreServices.h>
+# include <ApplicationServices/ApplicationServices.h>
 #else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL                DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL                0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW         DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW       RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW     DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW     0
-#        endif
-#      endif
-#    endif
-#  endif
+# include <ConditionalMacros.h>
+# include <Files.h>
 #endif
 
-/* When -fvisbility=hidden is used, assume the code has been annotated
-   correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
 
-int fnord () { return 42; }
-int main ()
+int
+main ()
 {
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else
-        {
-         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
-          else puts (dlerror ());
-       }
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
 
-  return status;
-}
-_LT_EOF
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
-  fi
-fi
-rm -fr conftest*
+        short                vRefNum;
+        long                 dirID;
+        ConstStr255Param     fileName;
 
+        Boolean*             isDirectory;
+        UInt8*               path;
+        SInt16               desiredRefNum;
+        SInt16*              iterator;
+        SInt16*              actualRefNum;
+        HFSUniStr255*        outForkName;
+        FSVolumeRefNum       volume;
+        FSCatalogInfoBitmap  whichInfo;
+        FSCatalogInfo*       catalogInfo;
+        FSForkInfo*          forkInfo;
+        FSRef*               ref;
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
-$as_echo "$lt_cv_dlopen_self_static" >&6; }
-    fi
+#if HAVE_FSSPEC
+        FSSpec*              spec;
+#endif
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
+        /* FSRef functions: no need to check? */
+        FSGetForkCBInfo( desiredRefNum, volume, iterator,
+                         actualRefNum, forkInfo, ref,
+                         outForkName );
+        FSPathMakeRef( path, ref, isDirectory );
 
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
+#if HAVE_FSSPEC
+        FSpMakeFSRef ( spec, ref );
+        FSGetCatalogInfo( ref, whichInfo, catalogInfo,
+                          outForkName, spec, ref );
+#endif
 
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+     CFLAGS="$CFLAGS -DHAVE_FSREF=1"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+     CFLAGS="$CFLAGS -DHAVE_FSREF=0"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi
 
 
+# Whether to use QuickDraw API in ToolBox, which is deprecated since
+# Mac OS X 10.4.
 
 
+# Check whether --with-quickdraw-toolbox was given.
+if test "${with_quickdraw_toolbox+set}" = set; then :
+  withval=$with_quickdraw_toolbox;
+fi
 
+if test x$with_quickdraw_toolbox = xno; then
+  CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=0"
+elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_toolbox != x; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking QuickDraw FontManager functions in ToolBox" >&5
+$as_echo_n "checking QuickDraw FontManager functions in ToolBox... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
 
+#if defined(__GNUC__) && defined(__APPLE_CC__)
+# include <CoreServices/CoreServices.h>
+# include <ApplicationServices/ApplicationServices.h>
+#else
+# include <ConditionalMacros.h>
+# include <Fonts.h>
+#endif
 
 
+int
+main ()
+{
 
 
+        Str255     familyName;
+        SInt16     familyID   = 0;
+        FMInput*   fmIn       = NULL;
+        FMOutput*  fmOut      = NULL;
 
 
+        GetFontName( familyID, familyName );
+        GetFNum( familyName, &familyID );
+        fmOut = FMSwapFont( fmIn );
 
 
-
-striplib=
-old_striplib=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
-$as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+     CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=1"
 else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-  darwin*)
-    if test -n "$STRIP" ; then
-      striplib="$STRIP -x"
-      old_striplib="$STRIP -S"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    fi
-    ;;
-  *)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    ;;
-  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+     CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=0"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi
 
 
+# Whether to use QuickDraw API in Carbon, which is deprecated since
+# Mac OS X 10.4.
 
 
+# Check whether --with-quickdraw-carbon was given.
+if test "${with_quickdraw_carbon+set}" = set; then :
+  withval=$with_quickdraw_carbon;
+fi
 
+if test x$with_quickdraw_carbon = xno; then
+  CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=0"
+elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_carbon != x; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking QuickDraw FontManager functions in Carbon" >&5
+$as_echo_n "checking QuickDraw FontManager functions in Carbon... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
 
+#if defined(__GNUC__) && defined(__APPLE_CC__)
+# include <CoreServices/CoreServices.h>
+# include <ApplicationServices/ApplicationServices.h>
+#else
+# include <ConditionalMacros.h>
+# include <Fonts.h>
+#endif
 
 
+int
+main ()
+{
 
 
-  # Report which library types will actually be built
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
+        FMFontFamilyIterator          famIter;
+        FMFontFamily                  family;
+        Str255                        famNameStr;
+        FMFontFamilyInstanceIterator  instIter;
+        FMFontStyle                   style;
+        FMFontSize                    size;
+        FMFont                        font;
+        FSSpec*                       pathSpec;
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
-  test "$can_build_shared" = "no" && enable_shared=no
 
-  # On AIX, shared libraries and static libraries use the same namespace, and
-  # are all built from PIC.
-  case $host_os in
-  aix3*)
-    test "$enable_shared" = yes && enable_static=no
-    if test -n "$RANLIB"; then
-      archive_cmds="$archive_cmds~\$RANLIB \$lib"
-      postinstall_cmds='$RANLIB $lib'
-    fi
-    ;;
+        FMCreateFontFamilyIterator( NULL, NULL, kFMUseGlobalScopeOption,
+                                    &famIter );
+        FMGetNextFontFamily( &famIter, &family );
+        FMGetFontFamilyName( family, famNameStr );
+        FMCreateFontFamilyInstanceIterator( family, &instIter );
+        FMGetNextFontFamilyInstance( &instIter, &font, &style, &size );
+        FMDisposeFontFamilyInstanceIterator( &instIter );
+        FMDisposeFontFamilyIterator( &famIter );
+        FMGetFontContainer( font, pathSpec );
 
-  aix[4-9]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
-    fi
-    ;;
-  esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
-  # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+     CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=1"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+     CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=0"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
 
 
+# Whether to use AppleTypeService since Mac OS X.
 
 
+# Check whether --with-ats was given.
+if test "${with_ats+set}" = set; then :
+  withval=$with_ats;
 fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-CC="$lt_save_CC"
+if test x$with_ats = xno; then
+  CFLAGS="$CFLAGS -DHAVE_ATS=0"
+elif test x$with_old_mac_fonts = xyes -a x$with_ats != x; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking AppleTypeService functions" >&5
+$as_echo_n "checking AppleTypeService functions... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+
+#if defined(__GNUC__) && defined(__APPLE_CC__)
+# include <CoreServices/CoreServices.h>
+# include <ApplicationServices/ApplicationServices.h>
+#else
+# include <ConditionalMacros.h>
+# include <Files.h>
+#endif
+
+
+int
+main ()
+{
+
+
+        FSSpec*  pathSpec;
 
 
+        ATSFontFindFromName( NULL, kATSOptionFlagsUnRestrictedScope );
+#if HAVE_FSSPEC
+        ATSFontGetFileSpecification( 0, pathSpec );
+#endif
 
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+     CFLAGS="$CFLAGS -DHAVE_ATS=1"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+     CFLAGS="$CFLAGS -DHAVE_ATS=0"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
 
+case "$CFLAGS" in
+  *HAVE_FSSPEC* | *HAVE_FSREF* | *HAVE_QUICKDRAW* | *HAVE_ATS* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+*** WARNING
+    FSSpec/FSRef/QuickDraw/ATS options are explicitly given,
+    thus it is recommended to replace src/base/ftmac.c by builds/mac/ftmac.c.
+    " >&5
+$as_echo "$as_me: WARNING:
+*** WARNING
+    FSSpec/FSRef/QuickDraw/ATS options are explicitly given,
+    thus it is recommended to replace src/base/ftmac.c by builds/mac/ftmac.c.
+    " >&2;}
+    CFLAGS="$CFLAGS "'-I$(TOP_DIR)/builds/mac/'
+    ;;
+  *)
+    ;;
+esac
 
 
+# entries in Requires.private are separated by commas;
+REQUIRES_PRIVATE="$zlib_reqpriv,     \
+                  $bzip2_reqpriv,    \
+                  $libpng_reqpriv,   \
+                  $harfbuzz_reqpriv"
+# beautify
+REQUIRES_PRIVATE=`echo "$REQUIRES_PRIVATE" \
+                  | sed -e 's/^  *//'      \
+                        -e 's/  *$//'      \
+                        -e 's/, */,/g'     \
+                        -e 's/,,*/,/g'     \
+                        -e 's/^,*//'       \
+                        -e 's/,*$//'       \
+                        -e 's/,/, /g'`
 
+LIBS_PRIVATE="$zlib_libpriv     \
+              $bzip2_libpriv    \
+              $libpng_libpriv   \
+              $harfbuzz_libpriv \
+              $ft2_extra_libs"
+# beautify
+LIBS_PRIVATE=`echo "$LIBS_PRIVATE"  \
+              | sed -e 's/^  *//'   \
+                    -e 's/  *$//'   \
+                    -e 's/  */ /g'`
 
+LIBSSTATIC_CONFIG="-lfreetype              \
+                   $zlib_libstaticconf     \
+                   $bzip2_libstaticconf    \
+                   $libpng_libstaticconf   \
+                   $harfbuzz_libstaticconf \
+                   $ft2_extra_libs"
+# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later
+# on if necessary; also beautify
+LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG"          \
+                   | sed -e 's|-L */usr/lib64/* | |g' \
+                         -e 's|-L */usr/lib/* | |g'   \
+                         -e 's/^  *//'                \
+                         -e 's/  *$//'                \
+                         -e 's/  */ /g'`
 
 
 
 
 
 
-        ac_config_commands="$ac_config_commands libtool"
 
 
 
 
-# Only expand once:
 
 
+# changing LDFLAGS value should only be done after
+# lt_cv_prog_compiler_static_works test
 
+if test "$have_zlib" != no; then
+  CFLAGS="$CFLAGS $ZLIB_CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB"
+  LDFLAGS="$LDFLAGS $ZLIB_LIBS"
+fi
 
+if test "$have_bzip2" != no; then
+  CFLAGS="$CFLAGS $BZIP2_CFLAGS -DFT_CONFIG_OPTION_USE_BZIP2"
+  LDFLAGS="$LDFLAGS $BZIP2_LIBS"
+fi
+if test "$have_libpng" != no; then
+  CFLAGS="$CFLAGS $LIBPNG_CFLAGS -DFT_CONFIG_OPTION_USE_PNG"
+  LDFLAGS="$LDFLAGS $LIBPNG_LIBS"
+fi
+if test "$have_harfbuzz" != no; then
+  CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS -DFT_CONFIG_OPTION_USE_HARFBUZZ"
+  LDFLAGS="$LDFLAGS $HARFBUZZ_LIBS"
+fi
 
 
 
@@ -12776,7 +13691,7 @@ ac_config_headers="$ac_config_headers ftconfig.h:ftconfig.in"
 # create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk'
 # and `builds/unix/unix-cc.mk' that will be used by the build system
 #
-ac_config_files="$ac_config_files unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in"
+ac_config_files="$ac_config_files unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in"
 
 
 # re-generate the Jamfile to use libtool now
@@ -13190,16 +14105,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -13259,28 +14174,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-       test -d "$1/.";
-      else
-       case $1 in #(
-       -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-       ???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -13301,8 +14204,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by FreeType $as_me 2.4.9, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+This file was extended by FreeType $as_me 2.5.4, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -13367,11 +14270,11 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-FreeType config.status 2.4.9
-configured by $0, generated by GNU Autoconf 2.68,
+FreeType config.status 2.5.4
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -13461,7 +14364,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -13777,8 +14680,6 @@ do
     "ftconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS ftconfig.h:ftconfig.in" ;;
     "unix-cc.mk") CONFIG_FILES="$CONFIG_FILES unix-cc.mk:unix-cc.in" ;;
     "unix-def.mk") CONFIG_FILES="$CONFIG_FILES unix-def.mk:unix-def.in" ;;
-    "freetype-config") CONFIG_FILES="$CONFIG_FILES freetype-config" ;;
-    "freetype2.pc") CONFIG_FILES="$CONFIG_FILES freetype2.pc:freetype2.in" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
@@ -15009,4 +15910,21 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}:
+
+Library configuration:
+  external zlib: $have_zlib
+  bzip2:         $have_bzip2
+  libpng:        $have_libpng
+  harfbuzz:      $have_harfbuzz
+" >&5
+$as_echo "$as_me:
+
+Library configuration:
+  external zlib: $have_zlib
+  bzip2:         $have_bzip2
+  libpng:        $have_libpng
+  harfbuzz:      $have_harfbuzz
+" >&6;}
+
 # end of configure.raw
index a066216..ab6ee8e 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Process this file with autoconf to produce a configure script.
 #
-# Copyright 2001-2012 by
+# Copyright 2001-2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # indicate that you have read the license and understand and accept it
 # fully.
 
-AC_INIT([FreeType], [2.4.9], [freetype@nongnu.org], [freetype])
+AC_INIT([FreeType], [2.5.4], [freetype@nongnu.org], [freetype])
 AC_CONFIG_SRCDIR([ftconfig.in])
 
 
 # Don't forget to update docs/VERSION.DLL!
 
-version_info='14:1:8'
+version_info='17:3:11'
 AC_SUBST([version_info])
 ft_version=`echo $version_info | tr : .`
 AC_SUBST([ft_version])
@@ -34,6 +34,10 @@ AC_PROG_CC
 AC_PROG_CPP
 AC_SUBST(EXEEXT)
 
+PKG_PROG_PKG_CONFIG([0.24])
+
+LT_INIT(win32-dll)
+
 
 # checks for native programs to generate building tool
 
@@ -66,32 +70,8 @@ AC_SUBST(CC_BUILD)
 AC_SUBST(EXEEXT_BUILD)
 
 
-
-# get compiler flags right
-
-if test "x$GCC" = xyes; then
-  XX_CFLAGS="-Wall"
-  XX_ANSIFLAGS="-pedantic -ansi"
-else
-  case "$host" in
-  *-dec-osf*)
-    CFLAGS=
-    XX_CFLAGS="-std1 -g3"
-    XX_ANSIFLAGS=
-    ;;
-  *)
-    XX_CFLAGS=
-    XX_ANSIFLAGS=
-    ;;
-  esac
-fi
-AC_SUBST([XX_CFLAGS])
-AC_SUBST([XX_ANSIFLAGS])
-
-
 # auxiliary programs
 
-AC_CHECK_PROG([RMF], [rm], [rm -f])
 AC_CHECK_PROG([RMDIR], [rmdir], [rmdir])
 
 
@@ -127,8 +107,14 @@ AC_CHECK_SIZEOF([long])
 AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.in works])
 orig_CPPFLAGS="${CPPFLAGS}"
 CPPFLAGS="-I${srcdir} -I. ${CPPFLAGS}"
-ac_clean_files="ft2build.h ftoption.h ftstdlib.h"
-touch ft2build.h ftoption.h ftstdlib.h
+
+ac_clean_files=
+for f in ft2build.h ftoption.h ftstdlib.h; do
+  if test ! -f $f; then
+    ac_clean_files="$ac_clean_files $f"
+    touch $f
+  fi
+done
 
 cat > conftest.c <<\_ACEOF
 #include <limits.h>
@@ -147,7 +133,7 @@ echo >> conftest.c "#endif"
 
 ${CPP} ${CPPFLAGS} conftest.c | ${GREP} ac_cpp_ft > conftest.sh
 eval `cat conftest.sh`
-${RMF} conftest.c conftest.sh confft2build.h ftoption.h ftstdlib.h
+rm -f conftest.* $ac_clean_files
 
 if test x != "x${ac_cpp_ft_sizeof_int}" \
    -a x != x"${ac_cpp_ft_sizeof_long}"; then
@@ -180,7 +166,8 @@ case :${ft_use_autoconf_sizeof_types}:${enable_biarch_config}: in
 esac
 
 if test x"${ft_use_autoconf_sizeof_types}" = xyes; then
-  AC_DEFINE([FT_USE_AUTOCONF_SIZEOF_TYPES])
+  AC_DEFINE([FT_USE_AUTOCONF_SIZEOF_TYPES], [],
+            [Define if autoconf sizeof types should be used.])
 fi
 
 CPPFLAGS="${orig_CPPFLAGS}"
@@ -222,35 +209,297 @@ AC_SUBST([FTSYS_SRC])
 AC_CHECK_FUNCS([memcpy memmove])
 
 
+# get compiler flags right
+#
+#   We try to make the compiler work for C89-strict source.  Even if the
+#   C compiler is gcc and C89 flags are available, some system headers
+#   (e.g., Android Bionic libc) are broken in C89 mode.  We have to check
+#   whether the compilation finishes successfully.
+#
+#   Due to bugs in mingwrt 4.0.3 we don't use `-ansi' for MinGW.
+#
+#   To avoid zillions of
+#
+#     ISO C90 does not support 'long long'
+#
+#   warnings, we disable `-pedantic' for gcc version < 4.6.
+#
+if test "x$GCC" = xyes; then
+  XX_CFLAGS="-Wall"
+  case "$host" in
+  *-*-mingw*)
+    XX_ANSIFLAGS="-pedantic"
+    ;;
+  *)
+    GCC_VERSION=`$CC -dumpversion`
+    GCC_MAJOR=`echo "$GCC_VERSION" | sed 's/\([[^.]][[^.]]*\).*/\1/'`
+    GCC_MINOR=`echo "$GCC_VERSION" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
+
+    XX_PEDANTIC=-pedantic
+    if test $GCC_MAJOR -lt 4; then
+      XX_PEDANTIC=
+    else
+      if test $GCC_MAJOR -eq 4 -a $GCC_MINOR -lt 6; then
+        XX_PEDANTIC=
+      fi
+    fi
+
+    XX_ANSIFLAGS=""
+    for a in $XX_PEDANTIC -ansi
+    do
+      AC_MSG_CHECKING([gcc compiler flag ${a} to assure ANSI C works correctly])
+      orig_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} ${XX_ANSIFLAGS} ${a}"
+      AC_COMPILE_IFELSE([
+        AC_LANG_PROGRAM([
+
+#include <stdio.h>
+
+          ],
+          [
+
+            {
+              puts( "" );
+              return 0;
+            }
+
+          ])],
+        [AC_MSG_RESULT([ok, add it to XX_ANSIFLAGS])
+         XX_ANSIFLAGS="${XX_ANSIFLAGS} ${a}"
+        ],
+        [AC_MSG_RESULT([no])])
+      CFLAGS="${orig_CFLAGS}"
+    done
+    ;;
+  esac
+else
+  case "$host" in
+  *-dec-osf*)
+    CFLAGS=
+    XX_CFLAGS="-std1 -g3"
+    XX_ANSIFLAGS=
+    ;;
+  *)
+    XX_CFLAGS=
+    XX_ANSIFLAGS=
+    ;;
+  esac
+fi
+AC_SUBST([XX_CFLAGS])
+AC_SUBST([XX_ANSIFLAGS])
+
+
+# All library tests below try `pkg-config' first.  If that fails, a function
+# from the library is tested in the traditional autoconf way (zlib, bzip2),
+# or a config script is called (libpng).
+#
+# The `xxx_reqpriv' variables are for the `Requires.private' field in
+# `freetype2.pc'.  The `xxx_libpriv' variables are for the `Libs.private'
+# field in `freetype2.pc' if pkg-config doesn't find a proper .pc file.
+#
+# The `xxx_libstaticconf' variables are for the `freetype-config' script.
+#
+# Note that a call to PKG_CHECK_MODULES(XXX, ...) sets and creates the
+# output variables `XXX_CFLAGS' and `XXX_LIBS'.  In case one or both are set
+# for a library by the user, no entry for this library is added to
+# `Requires.private'.  Instead, it gets added to `Libs.private'
+
+
 # check for system zlib
 
-# don't quote AS_HELP_STRING!
 AC_ARG_WITH([zlib],
-  AS_HELP_STRING([--without-zlib],
-                 [use internal zlib instead of system-wide]))
-if test x$with_zlib != xno && test -z "$LIBZ"; then
-  AC_CHECK_LIB([z], [gzsetparams], [AC_CHECK_HEADER([zlib.h], [LIBZ='-lz'])])
+  [AS_HELP_STRING([--with-zlib=@<:@yes|no|auto@:>@],
+                  [use system zlib instead of internal library @<:@default=auto@:>@])],
+  [], [with_zlib=auto])
+
+have_zlib=no
+if test x"$with_zlib" = xyes -o x"$with_zlib" = xauto; then
+  zlib_pkg="zlib"
+  have_zlib_pkg=no
+
+  if test x"$ZLIB_CFLAGS" = x -a x"$ZLIB_LIBS" = x; then
+    PKG_CHECK_EXISTS([$zlib_pkg], [have_zlib_pkg=yes])
+  fi
+  PKG_CHECK_MODULES([ZLIB], [$zlib_pkg],
+                    [have_zlib="yes (pkg-config)"], [:])
+
+  if test $have_zlib_pkg = yes; then
+    # we have zlib.pc
+    zlib_reqpriv="$zlib_pkg"
+    zlib_libpriv=
+    zlib_libstaticconf=`$PKG_CONFIG --static --libs "$zlib_pkg"`
+  else
+    zlib_reqpriv=
+
+    if test "$have_zlib" != no; then
+      # ZLIB_CFLAGS and ZLIB_LIBS are set by the user
+      zlib_libpriv="$ZLIB_LIBS"
+      zlib_libstaticconf="$ZLIB_LIBS"
+      have_zlib="yes (ZLIB_CFLAGS and ZLIB_LIBS)"
+    else
+      # fall back to standard autoconf test
+      AC_CHECK_LIB([z],
+                   [gzsetparams],
+                   [AC_CHECK_HEADER([zlib.h],
+                                    [have_zlib="yes (autoconf test)"
+                                     zlib_libpriv="-lz"
+                                     zlib_libstaticconf="$zlib_libpriv"
+                                     ZLIB_LIBS="$zlib_libpriv"])])
+    fi
+  fi
 fi
-if test x$with_zlib != xno && test -n "$LIBZ"; then
-  CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB"
-  LDFLAGS="$LDFLAGS $LIBZ"
-  SYSTEM_ZLIB=yes
+
+if test x"$with_zlib" = xyes -a "$have_zlib" = no; then
+  AC_MSG_ERROR([external zlib support requested but library not found])
 fi
 
+
 # check for system libbz2
 
-# don't quote AS_HELP_STRING!
 AC_ARG_WITH([bzip2],
-  AS_HELP_STRING([--without-bzip2],
-                 [do not support bzip2 compressed fonts]))
-if test x$with_bzip2 != xno && test -z "$LIBBZ2"; then
-  AC_CHECK_LIB([bz2], [BZ2_bzDecompress], [AC_CHECK_HEADER([bzlib.h], [LIBBZ2='-lbz2'])])
+  [AS_HELP_STRING([--with-bzip2=@<:@yes|no|auto@:>@],
+                  [support bzip2 compressed fonts @<:@default=auto@:>@])],
+  [], [with_bzip2=auto])
+
+have_bzip2=no
+if test x"$with_bzip2" = xyes -o x"$with_bzip2" = xauto; then
+  bzip2_pkg="bzip2"
+  have_bzip2_pkg=no
+
+  if test x"$BZIP2_CFLAGS" = x -a x"$BZIP2_LIBS" = x; then
+    PKG_CHECK_EXISTS([$bzip2_pkg], [have_bzip2_pkg=yes])
+  fi
+  PKG_CHECK_MODULES([BZIP2], [$bzip2_pkg],
+                    [have_bzip2="yes (pkg-config)"], [:])
+
+  if test $have_bzip2_pkg = yes; then
+    # we have bzip2.pc
+    bzip2_reqpriv="$bzip2_pkg"
+    bzip2_libpriv=
+    bzip2_libstaticconf=`$PKG_CONFIG --static --libs "$bzip2_pkg"`
+  else
+    bzip2_reqpriv=
+
+    if test "$have_bzip2" != no; then
+      # BZIP2_CFLAGS and BZIP2_LIBS are set by the user
+      bzip2_libpriv="$BZIP2_LIBS"
+      bzip2_libstaticconf="$BZIP2_LIBS"
+      have_bzip2="yes (BZIP2_CFLAGS and BZIP2_LIBS)"
+    else
+      # fall back to standard autoconf test
+      AC_CHECK_LIB([bz2],
+                   [BZ2_bzDecompress],
+                   [AC_CHECK_HEADER([bzlib.h],
+                                    [have_bzip2="yes (autoconf test)"
+                                     bzip2_libpriv="-lbz2"
+                                     bzip2_libstaticconf="$bzip2_libpriv"
+                                     BZIP2_LIBS="$bzip2_libpriv"])])
+    fi
+  fi
+fi
+
+if test x"$with_bzip2" = xyes -a "$have_bzip2" = no; then
+  AC_MSG_ERROR([bzip2 support requested but library not found])
+fi
+
+
+# check for system libpng
+
+AC_ARG_WITH([png],
+  [AS_HELP_STRING([--with-png=@<:@yes|no|auto@:>@],
+                  [support png compressed OpenType embedded bitmaps @<:@default=auto@:>@])],
+  [], [with_png=auto])
+
+have_libpng=no
+if test x"$with_png" = xyes -o x"$with_png" = xauto; then
+  libpng_pkg="libpng"
+  have_libpng_pkg=no
+
+  if test x"$LIBPNG_CFLAGS" = x -a x"$LIBPNG_LIBS" = x; then
+    PKG_CHECK_EXISTS([$libpng_pkg], [have_libpng_pkg=yes])
+  fi
+  PKG_CHECK_MODULES([LIBPNG], [$libpng_pkg],
+                    [have_libpng="yes (pkg-config)"], [:])
+
+  if test $have_libpng_pkg = yes; then
+    # we have libpng.pc
+    libpng_reqpriv="$libpng_pkg"
+    libpng_libpriv=
+    libpng_libstaticconf=`$PKG_CONFIG --static --libs "$libpng_pkg"`
+  else
+    libpng_reqpriv=
+
+    if test "$have_libpng" != no; then
+      # LIBPNG_CFLAGS and LIBPNG_LIBS are set by the user
+      libpng_libpriv="$LIBPNG_LIBS"
+      libpng_libstaticconf="$LIBPNG_LIBS"
+      have_libpng="yes (LIBPNG_CFLAGS and LIBPNG_LIBS)"
+    else
+      # fall back to config script.
+      AC_MSG_CHECKING([for libpng-config])
+      if which libpng-config > /dev/null 2>&1; then
+        LIBPNG_CFLAGS=`libpng-config --cflags`
+        LIBPNG_LIBS=`libpng-config --ldflags`
+        libpng_libpriv=`libpng-config --static --ldflags`
+        libpng_libstaticconf="$libpng_libpriv"
+        have_libpng="yes (libpng-config)"
+        AC_MSG_RESULT([yes])
+      else
+        AC_MSG_RESULT([no])
+      fi
+    fi
+  fi
 fi
-if test x$with_bzip2 != xno && test -n "$LIBBZ2"; then
-  CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_USE_BZIP2"
-  LDFLAGS="$LDFLAGS $LIBBZ2"
+
+if test x"$with_png" = xyes -a "$have_libpng" = no; then
+  AC_MSG_ERROR([libpng support requested but library not found])
+fi
+
+
+# check for system libharfbuzz
+
+AC_ARG_WITH([harfbuzz],
+  [AS_HELP_STRING([--with-harfbuzz=@<:@yes|no|auto@:>@],
+                  [improve auto-hinting of OpenType fonts @<:@default=auto@:>@])],
+  [], [with_harfbuzz=auto])
+
+have_harfbuzz=no
+if test x"$with_harfbuzz" = xyes -o x"$with_harfbuzz" = xauto; then
+  harfbuzz_pkg="harfbuzz >= 0.9.19"
+  have_harfbuzz_pkg=no
+
+  if test x"$HARFBUZZ_CFLAGS" = x -a x"$HARFBUZZ_LIBS" = x; then
+    PKG_CHECK_EXISTS([$harfbuzz_pkg], [have_harfbuzz_pkg=yes])
+  fi
+  PKG_CHECK_MODULES([HARFBUZZ], [$harfbuzz_pkg],
+                    [have_harfbuzz="yes (pkg-config)"], [:])
+
+  if test $have_harfbuzz_pkg = yes; then
+    # we have harfbuzz.pc
+    harfbuzz_reqpriv="$harfbuzz_pkg"
+    harfbuzz_libpriv=
+    harfbuzz_libstaticconf=`$PKG_CONFIG --static --libs "$harfbuzz_pkg"`
+  else
+    harfbuzz_reqpriv=
+
+    if test "$have_harfbuzz" != no; then
+      # HARFBUZZ_CFLAGS and HARFBUZZ_LIBS are set by the user
+      harfbuzz_libpriv="$HARFBUZZ_LIBS"
+      harfbuzz_libstaticconf="$HARFBUZZ_LIBS"
+      have_harfbuzz="yes (HARFBUZZ_CFLAGS and HARFBUZZ_LIBS)"
+    else
+      # since HarfBuzz is quite a new library we don't fall back to a
+      # different test; additionally, it has too many dependencies
+      :
+    fi
+  fi
+fi
+
+if test x"$with_harfbuzz" = xyes -a "$have_harfbuzz" = no; then
+  AC_MSG_ERROR([harfbuzz support requested but library not found])
 fi
 
+
 # Some options handling SDKs/archs in CFLAGS should be copied
 # to LDFLAGS. Apple TechNote 2137 recommends to include these
 # options in CFLAGS but not in LDFLAGS.
@@ -276,7 +525,7 @@ do
     shift 1
     ;;
   -m32|-m64|-march=*|-mcpu=*) # options taking no argument
-    AC_MSG_RESULT([whether CFLAGS and LDFLAGS share ${c}])
+    AC_MSG_CHECKING([whether CFLAGS and LDFLAGS share ${c}])
     if expr " ${LDFLAGS} " : ".* ${c} *${a}.*" > /dev/null
     then
       AC_MSG_RESULT([yes])
@@ -299,15 +548,14 @@ set ${save_config_args}
 
 ftmac_c="" # src/base/ftmac.c should not be included in makefiles by default
 
-# don't quote AS_HELP_STRING!
 AC_ARG_WITH([old-mac-fonts],
   AS_HELP_STRING([--with-old-mac-fonts],
                  [allow Mac resource-based fonts to be used]))
 if test x$with_old_mac_fonts = xyes; then
   orig_LDFLAGS="${LDFLAGS}"
   AC_MSG_CHECKING([CoreServices & ApplicationServices of Mac OS X])
-  FT2_EXTRA_LIBS="-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices"
-  LDFLAGS="$LDFLAGS $FT2_EXTRA_LIBS"
+  ft2_extra_libs="-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices"
+  LDFLAGS="$LDFLAGS $ft2_extra_libs"
   AC_LINK_IFELSE([
     AC_LANG_PROGRAM([
 
@@ -393,7 +641,7 @@ if test x$with_old_mac_fonts = xyes; then
         CFLAGS="$CFLAGS -DHAVE_TYPE_RESOURCE_INDEX=0"
        ])],
     [AC_MSG_RESULT([not found])
-     FT2_EXTRA_LIBS=""
+     ft2_extra_libs=""
      LDFLAGS="${orig_LDFLAGS}"
      CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"])
 else
@@ -408,7 +656,7 @@ else
 fi
 
 
-# Whether to use FileManager which is deprecated since Mac OS X 10.4.
+# Whether to use FileManager, which is deprecated since Mac OS X 10.4.
 
 AC_ARG_WITH([fsspec],
   AS_HELP_STRING([--with-fsspec],
@@ -517,7 +765,7 @@ elif test x$with_old_mac_fonts = xyes -a x$with_fsref != x; then
 fi
 
 
-# Whether to use QuickDraw API in ToolBox which is deprecated since
+# Whether to use QuickDraw API in ToolBox, which is deprecated since
 # Mac OS X 10.4.
 
 AC_ARG_WITH([quickdraw-toolbox],
@@ -559,7 +807,7 @@ elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_toolbox != x; then
 fi
 
 
-# Whether to use QuickDraw API in Carbon which is deprecated since
+# Whether to use QuickDraw API in Carbon, which is deprecated since
 # Mac OS X 10.4.
 
 AC_ARG_WITH([quickdraw-carbon],
@@ -613,7 +861,6 @@ fi
 
 # Whether to use AppleTypeService since Mac OS X.
 
-# don't quote AS_HELP_STRING!
 AC_ARG_WITH([ats],
   AS_HELP_STRING([--with-ats],
                  [use AppleTypeService, if available (default=yes)]))
@@ -664,22 +911,82 @@ case "$CFLAGS" in
 esac
 
 
-AC_SUBST([ftmac_c])
-AC_SUBST([LIBZ])
-AC_SUBST([LIBBZ2])
-AC_SUBST([CFLAGS])
-AC_SUBST([LDFLAGS])
-AC_SUBST([FT2_EXTRA_LIBS])
-AC_SUBST([SYSTEM_ZLIB])
+# entries in Requires.private are separated by commas;
+REQUIRES_PRIVATE="$zlib_reqpriv,     \
+                  $bzip2_reqpriv,    \
+                  $libpng_reqpriv,   \
+                  $harfbuzz_reqpriv"
+# beautify
+REQUIRES_PRIVATE=`echo "$REQUIRES_PRIVATE" \
+                  | sed -e 's/^  *//'      \
+                        -e 's/  *$//'      \
+                        -e 's/, */,/g'     \
+                        -e 's/,,*/,/g'     \
+                        -e 's/^,*//'       \
+                        -e 's/,*$//'       \
+                        -e 's/,/, /g'`
+
+LIBS_PRIVATE="$zlib_libpriv     \
+              $bzip2_libpriv    \
+              $libpng_libpriv   \
+              $harfbuzz_libpriv \
+              $ft2_extra_libs"
+# beautify
+LIBS_PRIVATE=`echo "$LIBS_PRIVATE"  \
+              | sed -e 's/^  *//'   \
+                    -e 's/  *$//'   \
+                    -e 's/  */ /g'`
+
+LIBSSTATIC_CONFIG="-lfreetype              \
+                   $zlib_libstaticconf     \
+                   $bzip2_libstaticconf    \
+                   $libpng_libstaticconf   \
+                   $harfbuzz_libstaticconf \
+                   $ft2_extra_libs"
+# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later
+# on if necessary; also beautify
+LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG"          \
+                   | sed -e 's|-L */usr/lib64/* | |g' \
+                         -e 's|-L */usr/lib/* | |g'   \
+                         -e 's/^  *//'                \
+                         -e 's/  *$//'                \
+                         -e 's/  */ /g'`
 
 
-LT_INIT(win32-dll)
+AC_SUBST([ftmac_c])
+AC_SUBST([REQUIRES_PRIVATE])
+AC_SUBST([LIBS_PRIVATE])
+AC_SUBST([LIBSSTATIC_CONFIG])
 
 AC_SUBST([hardcode_libdir_flag_spec])
 AC_SUBST([wl])
 AC_SUBST([build_libtool_libs])
 
 
+# changing LDFLAGS value should only be done after
+# lt_cv_prog_compiler_static_works test
+
+if test "$have_zlib" != no; then
+  CFLAGS="$CFLAGS $ZLIB_CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB"
+  LDFLAGS="$LDFLAGS $ZLIB_LIBS"
+fi
+
+if test "$have_bzip2" != no; then
+  CFLAGS="$CFLAGS $BZIP2_CFLAGS -DFT_CONFIG_OPTION_USE_BZIP2"
+  LDFLAGS="$LDFLAGS $BZIP2_LIBS"
+fi
+if test "$have_libpng" != no; then
+  CFLAGS="$CFLAGS $LIBPNG_CFLAGS -DFT_CONFIG_OPTION_USE_PNG"
+  LDFLAGS="$LDFLAGS $LIBPNG_LIBS"
+fi
+if test "$have_harfbuzz" != no; then
+  CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS -DFT_CONFIG_OPTION_USE_HARFBUZZ"
+  LDFLAGS="$LDFLAGS $HARFBUZZ_LIBS"
+fi
+
+AC_SUBST([CFLAGS])
+AC_SUBST([LDFLAGS])
+
 # configuration file -- stay in 8.3 limit
 #
 # since #undef doesn't survive in configuration header files we replace
@@ -694,9 +1001,7 @@ AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in],
 # and `builds/unix/unix-cc.mk' that will be used by the build system
 #
 AC_CONFIG_FILES([unix-cc.mk:unix-cc.in
-                 unix-def.mk:unix-def.in
-                 freetype-config
-                 freetype2.pc:freetype2.in])
+                 unix-def.mk:unix-def.in])
 
 # re-generate the Jamfile to use libtool now
 #
@@ -704,4 +1009,13 @@ AC_CONFIG_FILES([unix-cc.mk:unix-cc.in
 
 AC_OUTPUT
 
+AC_MSG_NOTICE([
+
+Library configuration:
+  external zlib: $have_zlib
+  bzip2:         $have_bzip2
+  libpng:        $have_libpng
+  harfbuzz:      $have_harfbuzz
+])
+
 # end of configure.raw
index 111dbab..72543cf 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Process this file with autoconf to produce a configure script.
 #
-# Copyright 2001-2012 by
+# Copyright 2001-2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -17,7 +17,7 @@ AC_CONFIG_SRCDIR([ftconfig.in])
 
 # Don't forget to update docs/VERSION.DLL!
 
-version_info='14:1:8'
+version_info='17:4:11'
 AC_SUBST([version_info])
 ft_version=`echo $version_info | tr : .`
 AC_SUBST([ft_version])
@@ -34,6 +34,10 @@ AC_PROG_CC
 AC_PROG_CPP
 AC_SUBST(EXEEXT)
 
+PKG_PROG_PKG_CONFIG([0.24])
+
+LT_INIT(win32-dll)
+
 
 # checks for native programs to generate building tool
 
@@ -66,32 +70,8 @@ AC_SUBST(CC_BUILD)
 AC_SUBST(EXEEXT_BUILD)
 
 
-
-# get compiler flags right
-
-if test "x$GCC" = xyes; then
-  XX_CFLAGS="-Wall"
-  XX_ANSIFLAGS="-pedantic -ansi"
-else
-  case "$host" in
-  *-dec-osf*)
-    CFLAGS=
-    XX_CFLAGS="-std1 -g3"
-    XX_ANSIFLAGS=
-    ;;
-  *)
-    XX_CFLAGS=
-    XX_ANSIFLAGS=
-    ;;
-  esac
-fi
-AC_SUBST([XX_CFLAGS])
-AC_SUBST([XX_ANSIFLAGS])
-
-
 # auxiliary programs
 
-AC_CHECK_PROG([RMF], [rm], [rm -f])
 AC_CHECK_PROG([RMDIR], [rmdir], [rmdir])
 
 
@@ -127,8 +107,14 @@ AC_CHECK_SIZEOF([long])
 AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.in works])
 orig_CPPFLAGS="${CPPFLAGS}"
 CPPFLAGS="-I${srcdir} -I. ${CPPFLAGS}"
-ac_clean_files="ft2build.h ftoption.h ftstdlib.h"
-touch ft2build.h ftoption.h ftstdlib.h
+
+ac_clean_files=
+for f in ft2build.h ftoption.h ftstdlib.h; do
+  if test ! -f $f; then
+    ac_clean_files="$ac_clean_files $f"
+    touch $f
+  fi
+done
 
 cat > conftest.c <<\_ACEOF
 #include <limits.h>
@@ -147,7 +133,7 @@ echo >> conftest.c "#endif"
 
 ${CPP} ${CPPFLAGS} conftest.c | ${GREP} ac_cpp_ft > conftest.sh
 eval `cat conftest.sh`
-${RMF} conftest.c conftest.sh confft2build.h ftoption.h ftstdlib.h
+rm -f conftest.* $ac_clean_files
 
 if test x != "x${ac_cpp_ft_sizeof_int}" \
    -a x != x"${ac_cpp_ft_sizeof_long}"; then
@@ -180,7 +166,8 @@ case :${ft_use_autoconf_sizeof_types}:${enable_biarch_config}: in
 esac
 
 if test x"${ft_use_autoconf_sizeof_types}" = xyes; then
-  AC_DEFINE([FT_USE_AUTOCONF_SIZEOF_TYPES])
+  AC_DEFINE([FT_USE_AUTOCONF_SIZEOF_TYPES], [],
+            [Define if autoconf sizeof types should be used.])
 fi
 
 CPPFLAGS="${orig_CPPFLAGS}"
@@ -222,35 +209,297 @@ AC_SUBST([FTSYS_SRC])
 AC_CHECK_FUNCS([memcpy memmove])
 
 
+# get compiler flags right
+#
+#   We try to make the compiler work for C89-strict source.  Even if the
+#   C compiler is gcc and C89 flags are available, some system headers
+#   (e.g., Android Bionic libc) are broken in C89 mode.  We have to check
+#   whether the compilation finishes successfully.
+#
+#   Due to bugs in mingwrt 4.0.3 we don't use `-ansi' for MinGW.
+#
+#   To avoid zillions of
+#
+#     ISO C90 does not support 'long long'
+#
+#   warnings, we disable `-pedantic' for gcc version < 4.6.
+#
+if test "x$GCC" = xyes; then
+  XX_CFLAGS="-Wall"
+  case "$host" in
+  *-*-mingw*)
+    XX_ANSIFLAGS="-pedantic"
+    ;;
+  *)
+    GCC_VERSION=`$CC -dumpversion`
+    GCC_MAJOR=`echo "$GCC_VERSION" | sed 's/\([[^.]][[^.]]*\).*/\1/'`
+    GCC_MINOR=`echo "$GCC_VERSION" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
+
+    XX_PEDANTIC=-pedantic
+    if test $GCC_MAJOR -lt 4; then
+      XX_PEDANTIC=
+    else
+      if test $GCC_MAJOR -eq 4 -a $GCC_MINOR -lt 6; then
+        XX_PEDANTIC=
+      fi
+    fi
+
+    XX_ANSIFLAGS=""
+    for a in $XX_PEDANTIC -ansi
+    do
+      AC_MSG_CHECKING([gcc compiler flag ${a} to assure ANSI C works correctly])
+      orig_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} ${XX_ANSIFLAGS} ${a}"
+      AC_COMPILE_IFELSE([
+        AC_LANG_PROGRAM([
+
+#include <stdio.h>
+
+          ],
+          [
+
+            {
+              puts( "" );
+              return 0;
+            }
+
+          ])],
+        [AC_MSG_RESULT([ok, add it to XX_ANSIFLAGS])
+         XX_ANSIFLAGS="${XX_ANSIFLAGS} ${a}"
+        ],
+        [AC_MSG_RESULT([no])])
+      CFLAGS="${orig_CFLAGS}"
+    done
+    ;;
+  esac
+else
+  case "$host" in
+  *-dec-osf*)
+    CFLAGS=
+    XX_CFLAGS="-std1 -g3"
+    XX_ANSIFLAGS=
+    ;;
+  *)
+    XX_CFLAGS=
+    XX_ANSIFLAGS=
+    ;;
+  esac
+fi
+AC_SUBST([XX_CFLAGS])
+AC_SUBST([XX_ANSIFLAGS])
+
+
+# All library tests below try `pkg-config' first.  If that fails, a function
+# from the library is tested in the traditional autoconf way (zlib, bzip2),
+# or a config script is called (libpng).
+#
+# The `xxx_reqpriv' variables are for the `Requires.private' field in
+# `freetype2.pc'.  The `xxx_libpriv' variables are for the `Libs.private'
+# field in `freetype2.pc' if pkg-config doesn't find a proper .pc file.
+#
+# The `xxx_libstaticconf' variables are for the `freetype-config' script.
+#
+# Note that a call to PKG_CHECK_MODULES(XXX, ...) sets and creates the
+# output variables `XXX_CFLAGS' and `XXX_LIBS'.  In case one or both are set
+# for a library by the user, no entry for this library is added to
+# `Requires.private'.  Instead, it gets added to `Libs.private'
+
+
 # check for system zlib
 
-# don't quote AS_HELP_STRING!
 AC_ARG_WITH([zlib],
-  AS_HELP_STRING([--without-zlib],
-                 [use internal zlib instead of system-wide]))
-if test x$with_zlib != xno && test -z "$LIBZ"; then
-  AC_CHECK_LIB([z], [gzsetparams], [AC_CHECK_HEADER([zlib.h], [LIBZ='-lz'])])
+  [AS_HELP_STRING([--with-zlib=@<:@yes|no|auto@:>@],
+                  [use system zlib instead of internal library @<:@default=auto@:>@])],
+  [], [with_zlib=auto])
+
+have_zlib=no
+if test x"$with_zlib" = xyes -o x"$with_zlib" = xauto; then
+  zlib_pkg="zlib"
+  have_zlib_pkg=no
+
+  if test x"$ZLIB_CFLAGS" = x -a x"$ZLIB_LIBS" = x; then
+    PKG_CHECK_EXISTS([$zlib_pkg], [have_zlib_pkg=yes])
+  fi
+  PKG_CHECK_MODULES([ZLIB], [$zlib_pkg],
+                    [have_zlib="yes (pkg-config)"], [:])
+
+  if test $have_zlib_pkg = yes; then
+    # we have zlib.pc
+    zlib_reqpriv="$zlib_pkg"
+    zlib_libpriv=
+    zlib_libstaticconf=`$PKG_CONFIG --static --libs "$zlib_pkg"`
+  else
+    zlib_reqpriv=
+
+    if test "$have_zlib" != no; then
+      # ZLIB_CFLAGS and ZLIB_LIBS are set by the user
+      zlib_libpriv="$ZLIB_LIBS"
+      zlib_libstaticconf="$ZLIB_LIBS"
+      have_zlib="yes (ZLIB_CFLAGS and ZLIB_LIBS)"
+    else
+      # fall back to standard autoconf test
+      AC_CHECK_LIB([z],
+                   [gzsetparams],
+                   [AC_CHECK_HEADER([zlib.h],
+                                    [have_zlib="yes (autoconf test)"
+                                     zlib_libpriv="-lz"
+                                     zlib_libstaticconf="$zlib_libpriv"
+                                     ZLIB_LIBS="$zlib_libpriv"])])
+    fi
+  fi
 fi
-if test x$with_zlib != xno && test -n "$LIBZ"; then
-  CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB"
-  LDFLAGS="$LDFLAGS $LIBZ"
-  SYSTEM_ZLIB=yes
+
+if test x"$with_zlib" = xyes -a "$have_zlib" = no; then
+  AC_MSG_ERROR([external zlib support requested but library not found])
 fi
 
+
 # check for system libbz2
 
-# don't quote AS_HELP_STRING!
 AC_ARG_WITH([bzip2],
-  AS_HELP_STRING([--without-bzip2],
-                 [do not support bzip2 compressed fonts]))
-if test x$with_bzip2 != xno && test -z "$LIBBZ2"; then
-  AC_CHECK_LIB([bz2], [BZ2_bzDecompress], [AC_CHECK_HEADER([bzlib.h], [LIBBZ2='-lbz2'])])
+  [AS_HELP_STRING([--with-bzip2=@<:@yes|no|auto@:>@],
+                  [support bzip2 compressed fonts @<:@default=auto@:>@])],
+  [], [with_bzip2=auto])
+
+have_bzip2=no
+if test x"$with_bzip2" = xyes -o x"$with_bzip2" = xauto; then
+  bzip2_pkg="bzip2"
+  have_bzip2_pkg=no
+
+  if test x"$BZIP2_CFLAGS" = x -a x"$BZIP2_LIBS" = x; then
+    PKG_CHECK_EXISTS([$bzip2_pkg], [have_bzip2_pkg=yes])
+  fi
+  PKG_CHECK_MODULES([BZIP2], [$bzip2_pkg],
+                    [have_bzip2="yes (pkg-config)"], [:])
+
+  if test $have_bzip2_pkg = yes; then
+    # we have bzip2.pc
+    bzip2_reqpriv="$bzip2_pkg"
+    bzip2_libpriv=
+    bzip2_libstaticconf=`$PKG_CONFIG --static --libs "$bzip2_pkg"`
+  else
+    bzip2_reqpriv=
+
+    if test "$have_bzip2" != no; then
+      # BZIP2_CFLAGS and BZIP2_LIBS are set by the user
+      bzip2_libpriv="$BZIP2_LIBS"
+      bzip2_libstaticconf="$BZIP2_LIBS"
+      have_bzip2="yes (BZIP2_CFLAGS and BZIP2_LIBS)"
+    else
+      # fall back to standard autoconf test
+      AC_CHECK_LIB([bz2],
+                   [BZ2_bzDecompress],
+                   [AC_CHECK_HEADER([bzlib.h],
+                                    [have_bzip2="yes (autoconf test)"
+                                     bzip2_libpriv="-lbz2"
+                                     bzip2_libstaticconf="$bzip2_libpriv"
+                                     BZIP2_LIBS="$bzip2_libpriv"])])
+    fi
+  fi
+fi
+
+if test x"$with_bzip2" = xyes -a "$have_bzip2" = no; then
+  AC_MSG_ERROR([bzip2 support requested but library not found])
+fi
+
+
+# check for system libpng
+
+AC_ARG_WITH([png],
+  [AS_HELP_STRING([--with-png=@<:@yes|no|auto@:>@],
+                  [support png compressed OpenType embedded bitmaps @<:@default=auto@:>@])],
+  [], [with_png=auto])
+
+have_libpng=no
+if test x"$with_png" = xyes -o x"$with_png" = xauto; then
+  libpng_pkg="libpng"
+  have_libpng_pkg=no
+
+  if test x"$LIBPNG_CFLAGS" = x -a x"$LIBPNG_LIBS" = x; then
+    PKG_CHECK_EXISTS([$libpng_pkg], [have_libpng_pkg=yes])
+  fi
+  PKG_CHECK_MODULES([LIBPNG], [$libpng_pkg],
+                    [have_libpng="yes (pkg-config)"], [:])
+
+  if test $have_libpng_pkg = yes; then
+    # we have libpng.pc
+    libpng_reqpriv="$libpng_pkg"
+    libpng_libpriv=
+    libpng_libstaticconf=`$PKG_CONFIG --static --libs "$libpng_pkg"`
+  else
+    libpng_reqpriv=
+
+    if test "$have_libpng" != no; then
+      # LIBPNG_CFLAGS and LIBPNG_LIBS are set by the user
+      libpng_libpriv="$LIBPNG_LIBS"
+      libpng_libstaticconf="$LIBPNG_LIBS"
+      have_libpng="yes (LIBPNG_CFLAGS and LIBPNG_LIBS)"
+    else
+      # fall back to config script.
+      AC_MSG_CHECKING([for libpng-config])
+      if which libpng-config > /dev/null 2>&1; then
+        LIBPNG_CFLAGS=`libpng-config --cflags`
+        LIBPNG_LIBS=`libpng-config --ldflags`
+        libpng_libpriv=`libpng-config --static --ldflags`
+        libpng_libstaticconf="$libpng_libpriv"
+        have_libpng="yes (libpng-config)"
+        AC_MSG_RESULT([yes])
+      else
+        AC_MSG_RESULT([no])
+      fi
+    fi
+  fi
 fi
-if test x$with_bzip2 != xno && test -n "$LIBBZ2"; then
-  CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_USE_BZIP2"
-  LDFLAGS="$LDFLAGS $LIBBZ2"
+
+if test x"$with_png" = xyes -a "$have_libpng" = no; then
+  AC_MSG_ERROR([libpng support requested but library not found])
+fi
+
+
+# check for system libharfbuzz
+
+AC_ARG_WITH([harfbuzz],
+  [AS_HELP_STRING([--with-harfbuzz=@<:@yes|no|auto@:>@],
+                  [improve auto-hinting of OpenType fonts @<:@default=auto@:>@])],
+  [], [with_harfbuzz=auto])
+
+have_harfbuzz=no
+if test x"$with_harfbuzz" = xyes -o x"$with_harfbuzz" = xauto; then
+  harfbuzz_pkg="harfbuzz >= 0.9.19"
+  have_harfbuzz_pkg=no
+
+  if test x"$HARFBUZZ_CFLAGS" = x -a x"$HARFBUZZ_LIBS" = x; then
+    PKG_CHECK_EXISTS([$harfbuzz_pkg], [have_harfbuzz_pkg=yes])
+  fi
+  PKG_CHECK_MODULES([HARFBUZZ], [$harfbuzz_pkg],
+                    [have_harfbuzz="yes (pkg-config)"], [:])
+
+  if test $have_harfbuzz_pkg = yes; then
+    # we have harfbuzz.pc
+    harfbuzz_reqpriv="$harfbuzz_pkg"
+    harfbuzz_libpriv=
+    harfbuzz_libstaticconf=`$PKG_CONFIG --static --libs "$harfbuzz_pkg"`
+  else
+    harfbuzz_reqpriv=
+
+    if test "$have_harfbuzz" != no; then
+      # HARFBUZZ_CFLAGS and HARFBUZZ_LIBS are set by the user
+      harfbuzz_libpriv="$HARFBUZZ_LIBS"
+      harfbuzz_libstaticconf="$HARFBUZZ_LIBS"
+      have_harfbuzz="yes (HARFBUZZ_CFLAGS and HARFBUZZ_LIBS)"
+    else
+      # since HarfBuzz is quite a new library we don't fall back to a
+      # different test; additionally, it has too many dependencies
+      :
+    fi
+  fi
+fi
+
+if test x"$with_harfbuzz" = xyes -a "$have_harfbuzz" = no; then
+  AC_MSG_ERROR([harfbuzz support requested but library not found])
 fi
 
+
 # Some options handling SDKs/archs in CFLAGS should be copied
 # to LDFLAGS. Apple TechNote 2137 recommends to include these
 # options in CFLAGS but not in LDFLAGS.
@@ -276,7 +525,7 @@ do
     shift 1
     ;;
   -m32|-m64|-march=*|-mcpu=*) # options taking no argument
-    AC_MSG_RESULT([whether CFLAGS and LDFLAGS share ${c}])
+    AC_MSG_CHECKING([whether CFLAGS and LDFLAGS share ${c}])
     if expr " ${LDFLAGS} " : ".* ${c} *${a}.*" > /dev/null
     then
       AC_MSG_RESULT([yes])
@@ -299,15 +548,14 @@ set ${save_config_args}
 
 ftmac_c="" # src/base/ftmac.c should not be included in makefiles by default
 
-# don't quote AS_HELP_STRING!
 AC_ARG_WITH([old-mac-fonts],
   AS_HELP_STRING([--with-old-mac-fonts],
                  [allow Mac resource-based fonts to be used]))
 if test x$with_old_mac_fonts = xyes; then
   orig_LDFLAGS="${LDFLAGS}"
   AC_MSG_CHECKING([CoreServices & ApplicationServices of Mac OS X])
-  FT2_EXTRA_LIBS="-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices"
-  LDFLAGS="$LDFLAGS $FT2_EXTRA_LIBS"
+  ft2_extra_libs="-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices"
+  LDFLAGS="$LDFLAGS $ft2_extra_libs"
   AC_LINK_IFELSE([
     AC_LANG_PROGRAM([
 
@@ -393,7 +641,7 @@ if test x$with_old_mac_fonts = xyes; then
         CFLAGS="$CFLAGS -DHAVE_TYPE_RESOURCE_INDEX=0"
        ])],
     [AC_MSG_RESULT([not found])
-     FT2_EXTRA_LIBS=""
+     ft2_extra_libs=""
      LDFLAGS="${orig_LDFLAGS}"
      CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"])
 else
@@ -408,7 +656,7 @@ else
 fi
 
 
-# Whether to use FileManager which is deprecated since Mac OS X 10.4.
+# Whether to use FileManager, which is deprecated since Mac OS X 10.4.
 
 AC_ARG_WITH([fsspec],
   AS_HELP_STRING([--with-fsspec],
@@ -517,7 +765,7 @@ elif test x$with_old_mac_fonts = xyes -a x$with_fsref != x; then
 fi
 
 
-# Whether to use QuickDraw API in ToolBox which is deprecated since
+# Whether to use QuickDraw API in ToolBox, which is deprecated since
 # Mac OS X 10.4.
 
 AC_ARG_WITH([quickdraw-toolbox],
@@ -559,7 +807,7 @@ elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_toolbox != x; then
 fi
 
 
-# Whether to use QuickDraw API in Carbon which is deprecated since
+# Whether to use QuickDraw API in Carbon, which is deprecated since
 # Mac OS X 10.4.
 
 AC_ARG_WITH([quickdraw-carbon],
@@ -613,7 +861,6 @@ fi
 
 # Whether to use AppleTypeService since Mac OS X.
 
-# don't quote AS_HELP_STRING!
 AC_ARG_WITH([ats],
   AS_HELP_STRING([--with-ats],
                  [use AppleTypeService, if available (default=yes)]))
@@ -664,22 +911,82 @@ case "$CFLAGS" in
 esac
 
 
-AC_SUBST([ftmac_c])
-AC_SUBST([LIBZ])
-AC_SUBST([LIBBZ2])
-AC_SUBST([CFLAGS])
-AC_SUBST([LDFLAGS])
-AC_SUBST([FT2_EXTRA_LIBS])
-AC_SUBST([SYSTEM_ZLIB])
+# entries in Requires.private are separated by commas;
+REQUIRES_PRIVATE="$zlib_reqpriv,     \
+                  $bzip2_reqpriv,    \
+                  $libpng_reqpriv,   \
+                  $harfbuzz_reqpriv"
+# beautify
+REQUIRES_PRIVATE=`echo "$REQUIRES_PRIVATE" \
+                  | sed -e 's/^  *//'      \
+                        -e 's/  *$//'      \
+                        -e 's/, */,/g'     \
+                        -e 's/,,*/,/g'     \
+                        -e 's/^,*//'       \
+                        -e 's/,*$//'       \
+                        -e 's/,/, /g'`
+
+LIBS_PRIVATE="$zlib_libpriv     \
+              $bzip2_libpriv    \
+              $libpng_libpriv   \
+              $harfbuzz_libpriv \
+              $ft2_extra_libs"
+# beautify
+LIBS_PRIVATE=`echo "$LIBS_PRIVATE"  \
+              | sed -e 's/^  *//'   \
+                    -e 's/  *$//'   \
+                    -e 's/  */ /g'`
+
+LIBSSTATIC_CONFIG="-lfreetype              \
+                   $zlib_libstaticconf     \
+                   $bzip2_libstaticconf    \
+                   $libpng_libstaticconf   \
+                   $harfbuzz_libstaticconf \
+                   $ft2_extra_libs"
+# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later
+# on if necessary; also beautify
+LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG"          \
+                   | sed -e 's|-L */usr/lib64/* | |g' \
+                         -e 's|-L */usr/lib/* | |g'   \
+                         -e 's/^  *//'                \
+                         -e 's/  *$//'                \
+                         -e 's/  */ /g'`
 
 
-LT_INIT(win32-dll)
+AC_SUBST([ftmac_c])
+AC_SUBST([REQUIRES_PRIVATE])
+AC_SUBST([LIBS_PRIVATE])
+AC_SUBST([LIBSSTATIC_CONFIG])
 
 AC_SUBST([hardcode_libdir_flag_spec])
 AC_SUBST([wl])
 AC_SUBST([build_libtool_libs])
 
 
+# changing LDFLAGS value should only be done after
+# lt_cv_prog_compiler_static_works test
+
+if test "$have_zlib" != no; then
+  CFLAGS="$CFLAGS $ZLIB_CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB"
+  LDFLAGS="$LDFLAGS $ZLIB_LIBS"
+fi
+
+if test "$have_bzip2" != no; then
+  CFLAGS="$CFLAGS $BZIP2_CFLAGS -DFT_CONFIG_OPTION_USE_BZIP2"
+  LDFLAGS="$LDFLAGS $BZIP2_LIBS"
+fi
+if test "$have_libpng" != no; then
+  CFLAGS="$CFLAGS $LIBPNG_CFLAGS -DFT_CONFIG_OPTION_USE_PNG"
+  LDFLAGS="$LDFLAGS $LIBPNG_LIBS"
+fi
+if test "$have_harfbuzz" != no; then
+  CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS -DFT_CONFIG_OPTION_USE_HARFBUZZ"
+  LDFLAGS="$LDFLAGS $HARFBUZZ_LIBS"
+fi
+
+AC_SUBST([CFLAGS])
+AC_SUBST([LDFLAGS])
+
 # configuration file -- stay in 8.3 limit
 #
 # since #undef doesn't survive in configuration header files we replace
@@ -694,9 +1001,7 @@ AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in],
 # and `builds/unix/unix-cc.mk' that will be used by the build system
 #
 AC_CONFIG_FILES([unix-cc.mk:unix-cc.in
-                 unix-def.mk:unix-def.in
-                 freetype-config
-                 freetype2.pc:freetype2.in])
+                 unix-def.mk:unix-def.in])
 
 # re-generate the Jamfile to use libtool now
 #
@@ -704,4 +1009,13 @@ AC_CONFIG_FILES([unix-cc.mk:unix-cc.in
 
 AC_OUTPUT
 
+AC_MSG_NOTICE([
+
+Library configuration:
+  external zlib: $have_zlib
+  bzip2:         $have_bzip2
+  libpng:        $have_libpng
+  harfbuzz:      $have_harfbuzz
+])
+
 # end of configure.raw
index b2ae4f4..0506e7d 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2002, 2003, 2004, 2006 by
+# Copyright 1996-2000, 2002-2004, 2006, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -76,13 +76,14 @@ ifeq ($(PLATFORM),unix)
 
   have_Makefile := $(wildcard $(OBJ_DIR)/Makefile)
 
+      CONFIG_SHELL ?= /bin/sh
       setup: std_setup
   ifdef must_configure
     ifneq ($(have_Makefile),)
       # we are building FT2 not in the src tree
-             $(TOP_DIR)/builds/unix/configure $(value CFG)
+             $(CONFIG_SHELL) $(TOP_DIR)/builds/unix/configure $(value CFG)
     else
-             cd builds/unix; ./configure $(value CFG)
+             cd builds/unix; $(CONFIG_SHELL) ./configure $(value CFG)
     endif
   endif
 
index 815367b..ebc311f 100644 (file)
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 by
+# Copyright 2000-2005, 2008, 2009, 2013, 2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -9,14 +9,15 @@
 # indicate that you have read the license and understand and accept it
 # fully.
 
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-exec_prefix_set=no
-includedir=@includedir@
-libdir=@libdir@
-enable_shared=@build_libtool_libs@
-wl=@wl@
-hardcode_libdir_flag_spec='@hardcode_libdir_flag_spec@'
+LC_ALL=C
+export LC_ALL
+
+prefix="%prefix%"
+exec_prefix="%exec_prefix%"
+exec_prefix_set="no"
+includedir="%includedir%"
+libdir="%libdir%"
+enable_shared="%build_libtool_libs%"
 
 usage()
 {
@@ -37,6 +38,8 @@ Options:
   --libtool              display library name for linking with libtool
   --cflags               display flags for compiling with the FreeType
                          library
+  --static               make command line options display flags
+                         for static linking
 EOF
   exit $1
 }
@@ -72,7 +75,7 @@ while test $# -gt 0 ; do
     echo_exec_prefix=yes
     ;;
   --version)
-    echo @ft_version@
+    echo %ft_version%
     exit 0
     ;;
   --ftversion)
@@ -87,6 +90,9 @@ while test $# -gt 0 ; do
   --libtool)
     echo_libtool=yes
     ;;
+  --static)
+    show_static=yes
+    ;;
   *)
     usage 1 1>&2
     ;;
@@ -118,13 +124,13 @@ else
 fi
 
 if test "$echo_ft_version" = "yes" ; then
-  major=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \
+  major=`grep define ${SYSROOT}$includedir/freetype2/freetype.h \
          | grep FREETYPE_MAJOR \
          | sed 's/.*[  ]\([0-9][0-9]*\).*/\1/'`
-  minor=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \
+  minor=`grep define ${SYSROOT}$includedir/freetype2/freetype.h \
          | grep FREETYPE_MINOR \
          | sed 's/.*[  ]\([0-9][0-9]*\).*/\1/'`
-  patch=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \
+  patch=`grep define ${SYSROOT}$includedir/freetype2/freetype.h \
          | grep FREETYPE_PATCH \
          | sed 's/.*[  ]\([0-9][0-9]*\).*/\1/'`
   echo $major.$minor.$patch
@@ -132,20 +138,17 @@ fi
 
 if test "$echo_cflags" = "yes" ; then
   cflags="-I${SYSROOT}$includedir/freetype2"
-  if test "${SYSROOT}$includedir" != "/usr/include" ; then
-    echo $cflags -I${SYSROOT}$includedir
-  else
-    echo $cflags
-  fi
+  echo $cflags
 fi
 
 if test "$echo_libs" = "yes" ; then
-  rpath=
-  if test "$enable_shared" = "yes" ; then
-    eval "rpath=\"$hardcode_libdir_flag_spec\""
+  libs="-lfreetype"
+  staticlibs="%LIBSSTATIC_CONFIG%"
+  if test "$show_static" = "yes" ; then
+    libs="$staticlibs"
   fi
-  libs="-lfreetype @LIBZ@ @LIBBZ2@ @FT2_EXTRA_LIBS@"
-  if test "${SYSROOT}$libdir" != "/usr/lib" && test "${SYSROOT}$libdir" != "/usr/lib64"; then
+  if test "${SYSROOT}$libdir" != "/usr/lib"  &&
+     test "${SYSROOT}$libdir" != "/usr/lib64"; then
     echo -L${SYSROOT}$libdir $libs
   else
     echo $libs
index b731800..a488d96 100644 (file)
@@ -1,12 +1,14 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
+prefix=%prefix%
+exec_prefix=%exec_prefix%
+libdir=%libdir%
+includedir=%includedir%/freetype2
 
 Name: FreeType 2
+URL: http://freetype.org
 Description: A free, high-quality, and portable font engine.
-Version: @ft_version@
+Version: %ft_version%
 Requires:
+Requires.private: %REQUIRES_PRIVATE%
 Libs: -L${libdir} -lfreetype
-Libs.private: @LIBZ@ @LIBBZ2@ @FT2_EXTRA_LIBS@
-Cflags: -I${includedir}/freetype2 -I${includedir}
+Libs.private: %LIBS_PRIVATE%
+Cflags: -I${includedir}
index 3d0ecb3..3a806d9 100644 (file)
@@ -1,7 +1,7 @@
 # Configure paths for FreeType2
 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
 #
-# Copyright 2001, 2003, 2007, 2009 by
+# Copyright 2001, 2003, 2007, 2009, 2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -15,7 +15,7 @@
 # generated by Autoconf, under the same distribution terms as the rest of
 # that program.
 #
-# serial 3
+# serial 4
 
 # AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
 # Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS.
@@ -61,7 +61,7 @@ AC_DEFUN([AC_CHECK_FT2],
    fi
 
    if test "x$FT2_CONFIG" = x ; then
-     AC_PATH_PROG([FT2_CONFIG], [freetype-config], [no])
+     AC_PATH_TOOL([FT2_CONFIG], [freetype-config], [no])
    fi
 
    min_ft_version=m4_if([$1], [], [7.0.1], [$1])
diff --git a/builds/unix/ft2unix.h b/builds/unix/ft2unix.h
deleted file mode 100644 (file)
index 6a3b8d9..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ft2build.h                                                             */
-/*                                                                         */
-/*    Build macros of the FreeType 2 library.                              */
-/*                                                                         */
-/*  Copyright 1996-2001, 2003, 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.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* This is a Unix-specific version of <ft2build.h> that should be used   */
-  /* exclusively *after* installation of the library.                      */
-  /*                                                                       */
-  /* It assumes that `/usr/local/include/freetype2' (or whatever is        */
-  /* returned by the `freetype-config --cflags' or `pkg-config --cflags'   */
-  /* command) is in your compilation include path.                         */
-  /*                                                                       */
-  /* We don't need to do anything special in this release.  However, for   */
-  /* a future FreeType 2 release, the following installation changes will  */
-  /* be performed:                                                         */
-  /*                                                                       */
-  /*   - The contents of `freetype-2.x/include/freetype' will be installed */
-  /*     to `/usr/local/include/freetype2' instead of                      */
-  /*     `/usr/local/include/freetype2/freetype'.                          */
-  /*                                                                       */
-  /*   - This file will #include <freetype2/config/ftheader.h>, instead    */
-  /*     of <freetype/config/ftheader.h>.                                  */
-  /*                                                                       */
-  /*   - The contents of `ftheader.h' will be processed with `sed' to      */
-  /*     replace all `<freetype/xxx>' with `<freetype2/xxx>'.              */
-  /*                                                                       */
-  /*   - Adding `/usr/local/include/freetype2' to your compilation include */
-  /*     path will not be necessary anymore.                               */
-  /*                                                                       */
-  /* These changes will be transparent to client applications which use    */
-  /* freetype-config (or pkg-config).  No modifications will be necessary  */
-  /* to compile with the new scheme.                                       */
-  /*                                                                       */
-  /*************************************************************************/
-
-
-#ifndef __FT2_BUILD_UNIX_H__
-#define __FT2_BUILD_UNIX_H__
-
-  /* `<prefix>/include/freetype2' must be in your current inclusion path */
-#include <freetype/config/ftheader.h>
-
-#endif /* __FT2_BUILD_UNIX_H__ */
-
-
-/* END */
index 9531afd..e66f3ea 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    UNIX-specific configuration file (specification only).               */
 /*                                                                         */
-/*  Copyright 1996-2004, 2006-2009, 2011 by                                */
+/*  Copyright 1996-2004, 2006-2009, 2011, 2013, 2014 by                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -27,9 +27,9 @@
   /* Note however that if some specific modifications are needed, we       */
   /* advise you to place a modified copy in your build directory.          */
   /*                                                                       */
-  /* The build directory is usually `freetype/builds/<system>', and        */
-  /* contains system-specific files that are always included first when    */
-  /* building the library.                                                 */
+  /* The build directory is usually `builds/<system>', and contains        */
+  /* system-specific files that are always included first when building    */
+  /* the library.                                                          */
   /*                                                                       */
   /*************************************************************************/
 
@@ -52,7 +52,7 @@ FT_BEGIN_HEADER
   /* These macros can be toggled to suit a specific system.  The current   */
   /* ones are defaults used to compile FreeType in an ANSI C environment   */
   /* (16bit compilers are also supported).  Copy this file to your own     */
-  /* `freetype/builds/<system>' directory, and edit it to port the engine. */
+  /* `builds/<system>' directory, and edit it to port the engine.          */
   /*                                                                       */
   /*************************************************************************/
 
@@ -86,7 +86,7 @@ FT_BEGIN_HEADER
 #else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
 
   /* Following cpp computation of the bit length of int and long */
-  /* is copied from default include/freetype/config/ftconfig.h.  */
+  /* is copied from default include/config/ftconfig.h.           */
   /* If any improvement is required for this file, it should be  */
   /* applied to the original header file for the builders that   */
   /* does not use configure script.                              */
@@ -175,13 +175,89 @@ FT_BEGIN_HEADER
 
   /*************************************************************************/
   /*                                                                       */
-  /* IntN types                                                            */
+  /* <Section>                                                             */
+  /*    basic_types                                                        */
   /*                                                                       */
-  /*   Used to guarantee the size of some specific integers.               */
+  /*************************************************************************/
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Type>                                                                */
+  /*    FT_Int16                                                           */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    A typedef for a 16bit signed integer type.                         */
+  /*                                                                       */
+  typedef signed short  FT_Int16;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Type>                                                                */
+  /*    FT_UInt16                                                          */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    A typedef for a 16bit unsigned integer type.                       */
   /*                                                                       */
-  typedef signed short    FT_Int16;
   typedef unsigned short  FT_UInt16;
 
+  /* */
+
+
+  /* this #if 0 ... #endif clause is for documentation purposes */
+#if 0
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Type>                                                                */
+  /*    FT_Int32                                                           */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    A typedef for a 32bit signed integer type.  The size depends on    */
+  /*    the configuration.                                                 */
+  /*                                                                       */
+  typedef signed XXX  FT_Int32;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Type>                                                                */
+  /*    FT_UInt32                                                          */
+  /*                                                                       */
+  /*    A typedef for a 32bit unsigned integer type.  The size depends on  */
+  /*    the configuration.                                                 */
+  /*                                                                       */
+  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
+
 #if FT_SIZEOF_INT == 4
 
   typedef signed int      FT_Int32;
@@ -217,13 +293,24 @@ FT_BEGIN_HEADER
 
   /* 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++) */
+  /*************************************************************************/
+  /*                                                                       */
+  /* A 64-bit data type may create compilation problems if you compile     */
+  /* in strict ANSI mode.  To avoid them, we disable other 64-bit data     */
+  /* types if __STDC__ is defined.  You can however ignore this rule       */
+  /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro.     */
+  /*                                                                       */
+#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
+
+#if 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++ */
 
@@ -232,7 +319,8 @@ FT_BEGIN_HEADER
 
   /* 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++ */
 
@@ -241,38 +329,24 @@ FT_BEGIN_HEADER
 #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
-#define FT_INT64  long long int
-
-#endif /* FT_SIZEOF_LONG == 8 */
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* A 64-bit data type will create compilation problems if you compile    */
-  /* in strict ANSI mode.  To avoid them, we disable its use if __STDC__   */
-  /* is defined.  You can however ignore this rule by defining the         */
-  /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro.                     */
-  /*                                                                       */
-#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
+#define FT_INT64   long long int
+#define FT_UINT64  unsigned long long int
 
-#ifdef __STDC__
-
-  /* Undefine the 64-bit macros in strict ANSI compilation mode.  */
-  /* Since `#undef' doesn't survive in configuration header files */
-  /* we use the postprocessing facility of AC_CONFIG_HEADERS to   */
-  /* replace the leading `/' with `#'.                            */
-/undef FT_LONG64
-/undef FT_INT64
+#endif /* _MSC_VER */
 
-#endif /* __STDC__ */
+#endif /* FT_SIZEOF_LONG == 8 */
 
-#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 {
@@ -280,147 +354,6 @@ FT_BEGIN_HEADER
 #define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT
 
 
-#ifndef  FT_CONFIG_OPTION_NO_ASSEMBLER
-  /* Provide assembler fragments for performance-critical functions. */
-  /* These must be defined `static __inline__' with GCC.             */
-
-#if defined( __CC_ARM ) || defined( __ARMCC__ )  /* RVCT */
-#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm
-
-  /* documentation is in freetype.h */
-
-  static __inline FT_Int32
-  FT_MulFix_arm( FT_Int32  a,
-                 FT_Int32  b )
-  {
-    register FT_Int32  t, t2;
-
-
-    __asm
-    {
-      smull t2, t,  b,  a           /* (lo=t2,hi=t) = a*b */
-      mov   a,  t,  asr #31         /* a   = (hi >> 31) */
-      add   a,  a,  #0x8000         /* a  += 0x8000 */
-      adds  t2, t2, a               /* t2 += a */
-      adc   t,  t,  #0              /* t  += carry */
-      mov   a,  t2, lsr #16         /* a   = t2 >> 16 */
-      orr   a,  a,  t,  lsl #16     /* a  |= t << 16 */
-    }
-    return a;
-  }
-
-#endif /* __CC_ARM || __ARMCC__ */
-
-
-#ifdef __GNUC__
-
-#if defined( __arm__ ) && !defined( __thumb__ )    && \
-    !( defined( __CC_ARM ) || defined( __ARMCC__ ) )
-#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm
-
-  /* documentation is in freetype.h */
-
-  static __inline__ FT_Int32
-  FT_MulFix_arm( FT_Int32  a,
-                 FT_Int32  b )
-  {
-    register FT_Int32  t, t2;
-
-
-    __asm__ __volatile__ (
-      "smull  %1, %2, %4, %3\n\t"       /* (lo=%1,hi=%2) = a*b */
-      "mov    %0, %2, asr #31\n\t"      /* %0  = (hi >> 31) */
-      "add    %0, %0, #0x8000\n\t"      /* %0 += 0x8000 */
-      "adds   %1, %1, %0\n\t"           /* %1 += %0 */
-      "adc    %2, %2, #0\n\t"           /* %2 += carry */
-      "mov    %0, %1, lsr #16\n\t"      /* %0  = %1 >> 16 */
-      "orr    %0, %0, %2, lsl #16\n\t"  /* %0 |= %2 << 16 */
-      : "=r"(a), "=&r"(t2), "=&r"(t)
-      : "r"(a), "r"(b) );
-    return a;
-  }
-
-#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */
-
-#if defined( __i386__ )
-#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386
-
-  /* documentation is in freetype.h */
-
-  static __inline__ FT_Int32
-  FT_MulFix_i386( FT_Int32  a,
-                  FT_Int32  b )
-  {
-    register FT_Int32  result;
-
-
-    __asm__ __volatile__ (
-      "imul  %%edx\n"
-      "movl  %%edx, %%ecx\n"
-      "sarl  $31, %%ecx\n"
-      "addl  $0x8000, %%ecx\n"
-      "addl  %%ecx, %%eax\n"
-      "adcl  $0, %%edx\n"
-      "shrl  $16, %%eax\n"
-      "shll  $16, %%edx\n"
-      "addl  %%edx, %%eax\n"
-      : "=a"(result), "=d"(b)
-      : "a"(a), "d"(b)
-      : "%ecx", "cc" );
-    return result;
-  }
-
-#endif /* i386 */
-
-#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 */
-
-
-#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
-#ifdef FT_MULFIX_ASSEMBLER
-#define FT_MULFIX_INLINED  FT_MULFIX_ASSEMBLER
-#endif
-#endif
-
-
 #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
 
 #define FT_LOCAL( x )      static  x
@@ -438,6 +371,9 @@ FT_BEGIN_HEADER
 
 #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
 
+#define FT_LOCAL_ARRAY( x )      extern const  x
+#define FT_LOCAL_ARRAY_DEF( x )  const  x
+
 
 #ifndef FT_BASE
 
index 95f8271..7f7b3ac 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Unix-specific FreeType low-level system interface (body).            */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2008 by             */
+/*  Copyright 1996-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,       */
 
 
     if ( !stream )
-      return FT_Err_Invalid_Stream_Handle;
+      return FT_THROW( Invalid_Stream_Handle );
 
     /* open the file */
     file = open( filepathname, O_RDONLY );
     {
       FT_ERROR(( "FT_Stream_Open:" ));
       FT_ERROR(( " could not open `%s'\n", filepathname ));
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
     }
 
     /* Here we ensure that a "fork" will _not_ duplicate   */
 
     /* XXX: TODO -- real 64bit platform support                        */
     /*                                                                 */
-    /* `stream->size' is typedef'd to unsigned long (in                */
-    /* freetype/ftsystem.h); `stat_buf.st_size', however, is usually   */
-    /* typedef'd to off_t (in sys/stat.h).                             */
+    /* `stream->size' is typedef'd to unsigned long (in `ftsystem.h'); */
+    /* `stat_buf.st_size', however, is usually typedef'd to off_t      */
+    /* (in sys/stat.h).                                                */
     /* On some platforms, the former is 32bit and the latter is 64bit. */
     /* To avoid overflow caused by fonts in huge files larger than     */
     /* 2GB, do a test.  Temporary fix proposed by Sean McBride.        */
       }
 
       total_read_count = 0;
-      do {
+      do
+      {
         ssize_t  read_count;
 
 
     stream->size = 0;
     stream->pos  = 0;
 
-    return FT_Err_Cannot_Open_Stream;
+    return FT_THROW( Cannot_Open_Stream );
   }
 
 
index a9244eb..377bb86 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2011-01-19.21; # UTC
+scriptversion=2011-11-20.07; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,7 +35,7 @@ scriptversion=2011-01-19.21; # UTC
 # FSF changes to this file are in the public domain.
 #
 # Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
@@ -156,7 +156,7 @@ while test $# -ne 0; do
     -s) stripcmd=$stripprog;;
 
     -t) dst_arg=$2
-       # Protect names problematic for `test' and other utilities.
+       # Protect names problematic for 'test' and other utilities.
        case $dst_arg in
          -* | [=\(\)!]) dst_arg=./$dst_arg;;
        esac
@@ -190,7 +190,7 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
     fi
     shift # arg
     dst_arg=$arg
-    # Protect names problematic for `test' and other utilities.
+    # Protect names problematic for 'test' and other utilities.
     case $dst_arg in
       -* | [=\(\)!]) dst_arg=./$dst_arg;;
     esac
@@ -202,7 +202,7 @@ if test $# -eq 0; then
     echo "$0: no input file specified." >&2
     exit 1
   fi
-  # It's OK to call `install-sh -d' without argument.
+  # It's OK to call 'install-sh -d' without argument.
   # This can happen when creating conditional directories.
   exit 0
 fi
@@ -240,7 +240,7 @@ fi
 
 for src
 do
-  # Protect names problematic for `test' and other utilities.
+  # Protect names problematic for 'test' and other utilities.
   case $src in
     -* | [=\(\)!]) src=./$src;;
   esac
@@ -354,7 +354,7 @@ do
              if test -z "$dir_arg" || {
                   # Check for POSIX incompatibilities with -m.
                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-                  # other-writeable bit of parent directory when it shouldn't.
+                  # other-writable bit of parent directory when it shouldn't.
                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
                   case $ls_ld_tmpdir in
index 2e5ef08..83525ee 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2002, 2003, 2006 by
+# Copyright 1996-2000, 2002, 2003, 2006, 2013, 2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 
 # Unix installation and deinstallation targets.
 #
-# Note that we no longer install internal headers, and we remove any
-# `internal' subdirectory found in `$(includedir)/freetype2/freetype'.
+# Note that we remove any data in the `freetype' subdirectory found in
+# `$(includedir)/freetype2', which was the previous location of the header
+# files up to version 2.5.0.
 #
 install: $(PROJECT_LIBRARY)
-       $(MKINSTALLDIRS) $(DESTDIR)$(libdir)                               \
-                         $(DESTDIR)$(libdir)/pkgconfig                     \
-                         $(DESTDIR)$(includedir)/freetype2/freetype/config \
-                         $(DESTDIR)$(includedir)/freetype2/freetype/cache  \
-                         $(DESTDIR)$(bindir)                               \
-                         $(DESTDIR)$(datadir)/aclocal
+       $(MKINSTALLDIRS) $(DESTDIR)$(libdir)                      \
+                         $(DESTDIR)$(libdir)/pkgconfig            \
+                         $(DESTDIR)$(includedir)/freetype2/config \
+                         $(DESTDIR)$(bindir)                      \
+                         $(DESTDIR)$(datadir)/aclocal             \
+                         $(DESTDIR)$(mandir)/man1
        $(LIBTOOL) --mode=install $(INSTALL)                             \
                                   $(PROJECT_LIBRARY) $(DESTDIR)$(libdir)
-       -for P in $(PUBLIC_H) ; do                           \
-          $(INSTALL_DATA)                                    \
-            $$P $(DESTDIR)$(includedir)/freetype2/freetype ; \
+       -for P in $(PUBLIC_H) ; do                  \
+          $(INSTALL_DATA)                           \
+            $$P $(DESTDIR)$(includedir)/freetype2 ; \
         done
-       -for P in $(CONFIG_H) ; do                                  \
-          $(INSTALL_DATA)                                           \
-            $$P $(DESTDIR)$(includedir)/freetype2/freetype/config ; \
+       -for P in $(CONFIG_H) ; do                         \
+          $(INSTALL_DATA)                                  \
+            $$P $(DESTDIR)$(includedir)/freetype2/config ; \
         done
-       -$(DELETE) $(DESTDIR)$(includedir)/freetype2/freetype/cache/*
-       -$(DELDIR) $(DESTDIR)$(includedir)/freetype2/freetype/cache
-       -$(DELETE) $(DESTDIR)$(includedir)/freetype2/freetype/internal/*
-       -$(DELDIR) $(DESTDIR)$(includedir)/freetype2/freetype/internal
-       $(INSTALL_DATA) $(BUILD_DIR)/ft2unix.h \
-          $(DESTDIR)$(includedir)/ft2build.h
-       $(INSTALL_DATA) $(OBJ_BUILD)/ftconfig.h                        \
-          $(DESTDIR)$(includedir)/freetype2/freetype/config/ftconfig.h
-       $(INSTALL_DATA) $(OBJ_DIR)/ftmodule.h                          \
-          $(DESTDIR)$(includedir)/freetype2/freetype/config/ftmodule.h
+       -$(DELETE) $(DESTDIR)$(includedir)/freetype2/freetype/config/*
+       -$(DELDIR) $(DESTDIR)$(includedir)/freetype2/freetype/config
+       -$(DELETE) $(DESTDIR)$(includedir)/freetype2/freetype/*
+       -$(DELDIR) $(DESTDIR)$(includedir)/freetype2/freetype
+       $(INSTALL_DATA) $(OBJ_BUILD)/ftconfig.h               \
+          $(DESTDIR)$(includedir)/freetype2/config/ftconfig.h
+       $(INSTALL_DATA) $(OBJ_DIR)/ftmodule.h                 \
+          $(DESTDIR)$(includedir)/freetype2/config/ftmodule.h
        $(INSTALL_SCRIPT) -m 755 $(OBJ_BUILD)/freetype-config \
           $(DESTDIR)$(bindir)/freetype-config
        $(INSTALL_SCRIPT) -m 644 $(BUILD_DIR)/freetype2.m4 \
           $(DESTDIR)$(datadir)/aclocal/freetype2.m4
        $(INSTALL_SCRIPT) -m 644 $(OBJ_BUILD)/freetype2.pc \
           $(DESTDIR)$(libdir)/pkgconfig/freetype2.pc
+       $(INSTALL_DATA) $(TOP_DIR)/docs/freetype-config.1 \
+          $(DESTDIR)$(mandir)/man1/freetype-config.1
 
 
 uninstall:
        -$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/$(LIBRARY).$A
-       -$(DELETE) $(DESTDIR)$(includedir)/freetype2/freetype/config/*
-       -$(DELDIR) $(DESTDIR)$(includedir)/freetype2/freetype/config
-       -$(DELETE) $(DESTDIR)$(includedir)/freetype2/freetype/*
-       -$(DELDIR) $(DESTDIR)$(includedir)/freetype2/freetype
+       -$(DELETE) $(DESTDIR)$(includedir)/freetype2/config/*
+       -$(DELDIR) $(DESTDIR)$(includedir)/freetype2/config
+       -$(DELETE) $(DESTDIR)$(includedir)/freetype2/*
        -$(DELDIR) $(DESTDIR)$(includedir)/freetype2
-       -$(DELETE) $(DESTDIR)$(includedir)/ft2build.h
        -$(DELETE) $(DESTDIR)$(bindir)/freetype-config
        -$(DELETE) $(DESTDIR)$(datadir)/aclocal/freetype2.m4
        -$(DELETE) $(DESTDIR)$(libdir)/pkgconfig/freetype2.pc
+       -$(DELETE) $(DESTDIR)$(mandir)/man1/freetype-config.1
 
 
 check:
old mode 100755 (executable)
new mode 100644 (file)
index 63ae69d..a356aca
@@ -70,7 +70,7 @@
 #         compiler:            $LTCC
 #         compiler flags:              $LTCFLAGS
 #         linker:              $LD (gnu? $with_gnu_ld)
-#         $progname:   (GNU libtool) 2.4.2
+#         $progname:   (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1
 #         automake:    $automake_version
 #         autoconf:    $autoconf_version
 #
@@ -80,7 +80,7 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION=2.4.2
+VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1"
 TIMESTAMP=""
 package_revision=1.3337
 
@@ -6124,7 +6124,10 @@ func_mode_link ()
        case $pass in
        dlopen) libs="$dlfiles" ;;
        dlpreopen) libs="$dlprefiles" ;;
-       link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+       link)
+         libs="$deplibs %DEPLIBS%"
+         test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+         ;;
        esac
       fi
       if test "$linkmode,$pass" = "lib,dlpreopen"; then
@@ -6444,19 +6447,19 @@ func_mode_link ()
            # It is a libtool convenience library, so add in its objects.
            func_append convenience " $ladir/$objdir/$old_library"
            func_append old_convenience " $ladir/$objdir/$old_library"
+           tmp_libs=
+           for deplib in $dependency_libs; do
+             deplibs="$deplib $deplibs"
+             if $opt_preserve_dup_deps ; then
+               case "$tmp_libs " in
+               *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+               esac
+             fi
+             func_append tmp_libs " $deplib"
+           done
          elif test "$linkmode" != prog && test "$linkmode" != lib; then
            func_fatal_error "\`$lib' is not a convenience library"
          fi
-         tmp_libs=
-         for deplib in $dependency_libs; do
-           deplibs="$deplib $deplibs"
-           if $opt_preserve_dup_deps ; then
-             case "$tmp_libs " in
-             *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-             esac
-           fi
-           func_append tmp_libs " $deplib"
-         done
          continue
        fi # $pass = conv
 
@@ -7349,6 +7352,9 @@ func_mode_link ()
            revision="$number_minor"
            lt_irix_increment=no
            ;;
+         *)
+           func_fatal_configuration "$modename: unknown library version type \`$version_type'"
+           ;;
          esac
          ;;
        no)
diff --git a/builds/unix/pkg.m4 b/builds/unix/pkg.m4
new file mode 100644 (file)
index 0000000..f26f84c
--- /dev/null
@@ -0,0 +1,199 @@
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=m4_default([$1], [0.9.0])
+       AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no])
+               PKG_CONFIG=""
+       fi
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_default([$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes ],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+       AC_MSG_RESULT([no])
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+        ])
+elif test $pkg_failed = untried; then
+       AC_MSG_RESULT([no])
+       m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+        ])
+else
+       $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+       $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+       $3
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+    [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_INSTALLDIR
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+    [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR
index e0a7a3a..4c06a05 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2002, 2004, 2006, 2008 by
+# Copyright 1996-2000, 2002, 2004, 2006, 2008, 2013, 2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # indicate that you have read the license and understand and accept it
 # fully.
 
+SHELL := @SHELL@
 
 TOP_DIR := $(shell cd $(TOP_DIR); pwd)
 
-DELETE    := @RMF@
-DELDIR    := @RMDIR@
-CAT       := cat
-SEP       := /
+DELETE := rm -f
+DELDIR := @RMDIR@
+CAT    := cat
+SEP    := /
 
 # this is used for `make distclean' and `make install'
 OBJ_BUILD ?= $(BUILD_DIR)
@@ -33,15 +34,16 @@ INSTALL_PROGRAM := @INSTALL_PROGRAM@
 INSTALL_SCRIPT  := @INSTALL_SCRIPT@
 MKINSTALLDIRS   := $(BUILD_DIR)/mkinstalldirs
 
-DISTCLEAN += $(OBJ_BUILD)/config.cache    \
-             $(OBJ_BUILD)/config.log      \
-             $(OBJ_BUILD)/config.status   \
-             $(OBJ_BUILD)/unix-def.mk     \
-             $(OBJ_BUILD)/unix-cc.mk      \
-             $(OBJ_BUILD)/ftconfig.h      \
-             $(OBJ_BUILD)/freetype-config \
-             $(OBJ_BUILD)/freetype2.pc    \
-             $(LIBTOOL)                   \
+CLEAN += $(OBJ_BUILD)/freetype-config \
+         $(OBJ_BUILD)/freetype2.pc
+
+DISTCLEAN += $(OBJ_BUILD)/config.cache  \
+             $(OBJ_BUILD)/config.log    \
+             $(OBJ_BUILD)/config.status \
+             $(OBJ_BUILD)/unix-def.mk   \
+             $(OBJ_BUILD)/unix-cc.mk    \
+             $(OBJ_BUILD)/ftconfig.h    \
+             $(LIBTOOL)                 \
              $(OBJ_BUILD)/Makefile
 
 
@@ -54,9 +56,17 @@ bindir       := @bindir@
 includedir   := @includedir@
 datarootdir  := @datarootdir@
 datadir      := @datadir@
+mandir       := @mandir@
 
 version_info := @version_info@
 
+# Variables needed for `freetype-config' and `freetype.pc'.
+#
+REQUIRES_PRIVATE   := @REQUIRES_PRIVATE@
+LIBS_PRIVATE       := @LIBS_PRIVATE@
+LIBSSTATIC_CONFIG  := @LIBSSTATIC_CONFIG@
+build_libtool_libs := @build_libtool_libs@
+ft_version         := @ft_version@
 
 # The directory where all library files are placed.
 #
@@ -82,4 +92,57 @@ SYSTEM_ZLIB := @SYSTEM_ZLIB@
 NO_OUTPUT := 2> /dev/null
 
 
+# To support calls like
+#
+#   configure --includedir='${libdir}'/freetype2/include
+#
+# we generate `freetype-config' and `freetype.pc' at compile time so that
+# those variables are properly expanded.
+
+$(OBJ_BUILD)/freetype-config: $(TOP_DIR)/builds/unix/freetype-config.in
+       rm -f $@ $@.tmp
+       sed -e 's|%LIBSSTATIC_CONFIG%|$(LIBSSTATIC_CONFIG)|'   \
+           -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
+           -e 's|%exec_prefix%|$(exec_prefix)|'               \
+           -e 's|%ft_version%|$(ft_version)|'                 \
+           -e 's|%includedir%|$(includedir)|'                 \
+           -e 's|%libdir%|$(libdir)|'                         \
+           -e 's|%prefix%|$(prefix)|'                         \
+           $<                                                 \
+           > $@.tmp
+       chmod +x $@.tmp
+       chmod a-w $@.tmp
+       mv $@.tmp $@
+
+# To support directory names with spaces (as might easily happen on Windows
+# platforms), the right solution would be to surround the pkg-variables in
+# `freetype2.pc' with double quotes.  However, doing so ironically disables
+# the prefix override mechanism especially written for Windows.  This is a
+# bug in pkg-config version 0.28 and earlier.
+#
+# For this reason, we escape spaces with backslashes.
+
+exec_prefix_x := $(subst $(space),\\$(space),$(exec_prefix))
+includedir_x  := $(subst $(space),\\$(space),$(includedir))
+libdir_x      := $(subst $(space),\\$(space),$(libdir))
+prefix_x      := $(subst $(space),\\$(space),$(prefix))
+
+$(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in
+       rm -f $@ $@.tmp
+       sed -e 's|%REQUIRES_PRIVATE%|$(REQUIRES_PRIVATE)|'     \
+           -e 's|%LIBS_PRIVATE%|$(LIBS_PRIVATE)|'             \
+           -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
+           -e 's|%exec_prefix%|$(exec_prefix_x)|'             \
+           -e 's|%ft_version%|$(ft_version)|'                 \
+           -e 's|%includedir%|$(includedir_x)|'               \
+           -e 's|%libdir%|$(libdir_x)|'                       \
+           -e 's|%prefix%|$(prefix_x)|'                       \
+           $<                                                 \
+           > $@.tmp
+       chmod a-w $@.tmp
+       mv $@.tmp $@
+
+all: $(OBJ_BUILD)/freetype-config \
+     $(OBJ_BUILD)/freetype2.pc
+
 # EOF
index 62fadac..b309651 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    VMS-specific configuration file (specification only).                */
 /*                                                                         */
-/*  Copyright 1996-2004, 2006-2008, 2011 by                                */
+/*  Copyright 1996-2004, 2006-2008, 2011, 2013, 2014 by                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   /* Note however that if some specific modifications are needed, we       */
   /* advise you to place a modified copy in your build directory.          */
   /*                                                                       */
-  /* The build directory is usually `freetype/builds/<system>', and        */
-  /* contains system-specific files that are always included first when    */
-  /* building the library.                                                 */
+  /* The build directory is usually `builds/<system>', and contains        */
+  /* system-specific files that are always included first when building    */
+  /* the library.                                                          */
   /*                                                                       */
   /*************************************************************************/
 
-
 #ifndef __FTCONFIG_H__
 #define __FTCONFIG_H__
 
-
-  /* Include the header file containing all developer build options */
 #include <ft2build.h>
 #include FT_CONFIG_OPTIONS_H
 #include FT_CONFIG_STANDARD_LIBRARY_H
@@ -46,6 +43,7 @@
 
 FT_BEGIN_HEADER
 
+
   /*************************************************************************/
   /*                                                                       */
   /*               PLATFORM-SPECIFIC CONFIGURATION MACROS                  */
@@ -53,7 +51,7 @@ FT_BEGIN_HEADER
   /* These macros can be toggled to suit a specific system.  The current   */
   /* ones are defaults used to compile FreeType in an ANSI C environment   */
   /* (16bit compilers are also supported).  Copy this file to your own     */
-  /* `freetype/builds/<system>' directory, and edit it to port the engine. */
+  /* `builds/<system>' directory, and edit it to port the engine.          */
   /*                                                                       */
   /*************************************************************************/
 
@@ -120,19 +118,95 @@ FT_BEGIN_HEADER
 
   /*************************************************************************/
   /*                                                                       */
-  /* IntN types                                                            */
+  /* <Section>                                                             */
+  /*    basic_types                                                        */
+  /*                                                                       */
+  /*************************************************************************/
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Type>                                                                */
+  /*    FT_Int16                                                           */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    A typedef for a 16bit signed integer type.                         */
+  /*                                                                       */
+  typedef signed short  FT_Int16;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Type>                                                                */
+  /*    FT_UInt16                                                          */
   /*                                                                       */
-  /*   Used to guarantee the size of some specific integers.               */
+  /* <Description>                                                         */
+  /*    A typedef for a 16bit unsigned integer type.                       */
   /*                                                                       */
-  typedef signed short    FT_Int16;
   typedef unsigned short  FT_UInt16;
 
-#if FT_SIZEOF_INT == 4
+  /* */
+
+
+  /* this #if 0 ... #endif clause is for documentation purposes */
+#if 0
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Type>                                                                */
+  /*    FT_Int32                                                           */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    A typedef for a 32bit signed integer type.  The size depends on    */
+  /*    the configuration.                                                 */
+  /*                                                                       */
+  typedef signed XXX  FT_Int32;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Type>                                                                */
+  /*    FT_UInt32                                                          */
+  /*                                                                       */
+  /*    A typedef for a 32bit unsigned integer type.  The size depends on  */
+  /*    the configuration.                                                 */
+  /*                                                                       */
+  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
+
+#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)
 
   typedef signed int      FT_Int32;
   typedef unsigned int    FT_UInt32;
 
-#elif FT_SIZEOF_LONG == 4
+#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)
 
   typedef signed long     FT_Int32;
   typedef unsigned long   FT_UInt32;
@@ -141,13 +215,14 @@ FT_BEGIN_HEADER
 #error "no 32bit type found -- please check your configuration files"
 #endif
 
+
   /* look up an integer type that is at least 32 bits */
-#if FT_SIZEOF_INT >= 4
+#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)
 
   typedef int            FT_Fast;
   typedef unsigned int   FT_UFast;
 
-#elif FT_SIZEOF_LONG >= 4
+#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)
 
   typedef long           FT_Fast;
   typedef unsigned long  FT_UFast;
@@ -157,17 +232,28 @@ FT_BEGIN_HEADER
 
   /* determine whether we have a 64-bit int type for platforms without */
   /* Autoconf                                                          */
-#if FT_SIZEOF_LONG == 8
+#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)
 
   /* 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++) */
+  /*************************************************************************/
+  /*                                                                       */
+  /* A 64-bit data type may create compilation problems if you compile     */
+  /* in strict ANSI mode.  To avoid them, we disable other 64-bit data     */
+  /* types if __STDC__ is defined.  You can however ignore this rule       */
+  /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro.     */
+  /*                                                                       */
+#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
+
+#if 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++ */
 
@@ -176,7 +262,8 @@ FT_BEGIN_HEADER
 
   /* 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++ */
 
@@ -185,15 +272,24 @@ FT_BEGIN_HEADER
 #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
-#define FT_INT64  long long int
+#define FT_INT64   long long int
+#define FT_UINT64  unsigned long long int
+
+#endif /* _MSC_VER */
+
+#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
 
-#endif /* FT_SIZEOF_LONG == 8 */
+#ifdef FT_LONG64
+  typedef FT_INT64   FT_Int64;
+  typedef FT_UINT64  FT_UInt64;
+#endif
 
 
 #define FT_BEGIN_STMNT  do {
@@ -201,26 +297,6 @@ FT_BEGIN_HEADER
 #define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* A 64-bit data type will create compilation problems if you compile    */
-  /* in strict ANSI mode.  To avoid them, we disable their use if          */
-  /* __STDC__ is defined.  You can however ignore this rule by             */
-  /* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro.        */
-  /*                                                                       */
-#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
-
-#ifdef __STDC__
-
-  /* undefine the 64-bit macros in strict ANSI compilation mode */
-#undef FT_LONG64
-#undef FT_INT64
-
-#endif /* __STDC__ */
-
-#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
-
-
 #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
 
 #define FT_LOCAL( x )      static  x
@@ -238,6 +314,9 @@ FT_BEGIN_HEADER
 
 #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
 
+#define FT_LOCAL_ARRAY( x )      extern const  x
+#define FT_LOCAL_ARRAY_DEF( x )  const  x
+
 
 #ifndef FT_BASE
 
@@ -253,9 +332,9 @@ FT_BEGIN_HEADER
 #ifndef FT_BASE_DEF
 
 #ifdef __cplusplus
-#define FT_BASE_DEF( x )  extern "C"  x
+#define FT_BASE_DEF( x )  x
 #else
-#define FT_BASE_DEF( x )  extern  x
+#define FT_BASE_DEF( x )  x
 #endif
 
 #endif /* !FT_BASE_DEF */
index fb35967..5c2819e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    VMS-specific FreeType low-level system interface (body).             */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2005, 2010 by                               */
+/*  Copyright 1996-2002, 2005, 2010, 2013 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 
     if ( !stream )
-      return FT_Err_Invalid_Stream_Handle;
+      return FT_THROW( Invalid_Stream_Handle );
 
     /* open the file */
     file = open( filepathname, O_RDONLY );
     {
       FT_ERROR(( "FT_Stream_Open:" ));
       FT_ERROR(( " could not open `%s'\n", filepathname ));
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
     }
 
     if ( fstat( file, &stat_buf ) < 0 )
     stream->size = 0;
     stream->pos  = 0;
 
-    return FT_Err_Cannot_Open_Stream;
+    return FT_THROW( Cannot_Open_Stream );
   }
 
 
diff --git a/builds/win32/vc2010/freetype.vcxproj b/builds/win32/vc2010/freetype.vcxproj
deleted file mode 100644 (file)
index e88c45f..0000000
+++ /dev/null
@@ -1,832 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <ItemGroup Label="ProjectConfigurations">\r
-    <ProjectConfiguration Include="Debug Multithreaded|Win32">\r
-      <Configuration>Debug Multithreaded</Configuration>\r
-      <Platform>Win32</Platform>\r
-    </ProjectConfiguration>\r
-    <ProjectConfiguration Include="Debug Singlethreaded|Win32">\r
-      <Configuration>Debug Singlethreaded</Configuration>\r
-      <Platform>Win32</Platform>\r
-    </ProjectConfiguration>\r
-    <ProjectConfiguration Include="Debug|Win32">\r
-      <Configuration>Debug</Configuration>\r
-      <Platform>Win32</Platform>\r
-    </ProjectConfiguration>\r
-    <ProjectConfiguration Include="Release Multithreaded|Win32">\r
-      <Configuration>Release Multithreaded</Configuration>\r
-      <Platform>Win32</Platform>\r
-    </ProjectConfiguration>\r
-    <ProjectConfiguration Include="Release Singlethreaded|Win32">\r
-      <Configuration>Release Singlethreaded</Configuration>\r
-      <Platform>Win32</Platform>\r
-    </ProjectConfiguration>\r
-    <ProjectConfiguration Include="Release|Win32">\r
-      <Configuration>Release</Configuration>\r
-      <Platform>Win32</Platform>\r
-    </ProjectConfiguration>\r
-  </ItemGroup>\r
-  <PropertyGroup Label="Globals">\r
-    <ProjectGuid>{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}</ProjectGuid>\r
-  </PropertyGroup>\r
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'" Label="Configuration">\r
-    <ConfigurationType>StaticLibrary</ConfigurationType>\r
-    <UseOfMfc>false</UseOfMfc>\r
-    <CharacterSet>MultiByte</CharacterSet>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'" Label="Configuration">\r
-    <ConfigurationType>StaticLibrary</ConfigurationType>\r
-    <UseOfMfc>false</UseOfMfc>\r
-    <CharacterSet>MultiByte</CharacterSet>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
-    <ConfigurationType>StaticLibrary</ConfigurationType>\r
-    <UseOfMfc>false</UseOfMfc>\r
-    <CharacterSet>MultiByte</CharacterSet>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'" Label="Configuration">\r
-    <ConfigurationType>StaticLibrary</ConfigurationType>\r
-    <UseOfMfc>false</UseOfMfc>\r
-    <CharacterSet>MultiByte</CharacterSet>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'" Label="Configuration">\r
-    <ConfigurationType>StaticLibrary</ConfigurationType>\r
-    <UseOfMfc>false</UseOfMfc>\r
-    <CharacterSet>MultiByte</CharacterSet>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
-    <ConfigurationType>StaticLibrary</ConfigurationType>\r
-    <UseOfMfc>false</UseOfMfc>\r
-    <CharacterSet>MultiByte</CharacterSet>\r
-  </PropertyGroup>\r
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
-  <ImportGroup Label="ExtensionSettings">\r
-  </ImportGroup>\r
-  <PropertyGroup>\r
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\..\..\..\objs\win32\vc2010\</OutDir>\r
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\..\..\..\objs\release\</IntDir>\r
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">.\..\..\..\objs\win32\vc2010\</OutDir>\r
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">.\..\..\..\objs\release_mt\</IntDir>\r
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">.\..\..\..\objs\win32\vc2010\</OutDir>\r
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">.\..\..\..\objs\release_st\</IntDir>\r
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\..\..\..\objs\win32\vc2010\</OutDir>\r
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\..\..\..\objs\debug\</IntDir>\r
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">.\..\..\..\objs\win32\vc2010\</OutDir>\r
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">.\..\..\..\objs\debug_st\</IntDir>\r
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">.\..\..\..\objs\win32\vc2010\</OutDir>\r
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">.\..\..\..\objs\debug_mt\</IntDir>\r
-    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
-    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'" />\r
-    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'" />\r
-    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
-    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'" />\r
-    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'" />\r
-    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
-    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
-    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
-    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
-    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'" />\r
-    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'" />\r
-    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
-    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'" />\r
-    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'" />\r
-    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
-    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
-    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">freetype249_D</TargetName>\r
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">freetype249MT_D</TargetName>\r
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">freetype249ST_D</TargetName>\r
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">freetype249</TargetName>\r
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">freetype249MT</TargetName>\r
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">freetype249ST</TargetName>\r
-  </PropertyGroup>\r
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
-    <ClCompile>\r
-      <Optimization>MaxSpeed</Optimization>\r
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <StringPooling>true</StringPooling>\r
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
-      <FunctionLevelLinking>true</FunctionLevelLinking>\r
-      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
-      <WarningLevel>Level4</WarningLevel>\r
-      <DebugInformationFormat>\r
-      </DebugInformationFormat>\r
-      <CompileAs>Default</CompileAs>\r
-      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-    </ClCompile>\r
-    <ResourceCompile>\r
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Culture>0x0409</Culture>\r
-    </ResourceCompile>\r
-    <Lib>\r
-      <SuppressStartupBanner>true</SuppressStartupBanner>\r
-    </Lib>\r
-  </ItemDefinitionGroup>\r
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">\r
-    <ClCompile>\r
-      <Optimization>MaxSpeed</Optimization>\r
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <StringPooling>true</StringPooling>\r
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
-      <FunctionLevelLinking>true</FunctionLevelLinking>\r
-      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
-      <WarningLevel>Level4</WarningLevel>\r
-      <DebugInformationFormat>\r
-      </DebugInformationFormat>\r
-      <CompileAs>Default</CompileAs>\r
-      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-    </ClCompile>\r
-    <ResourceCompile>\r
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Culture>0x0409</Culture>\r
-    </ResourceCompile>\r
-    <Lib>\r
-      <SuppressStartupBanner>true</SuppressStartupBanner>\r
-    </Lib>\r
-  </ItemDefinitionGroup>\r
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">\r
-    <ClCompile>\r
-      <Optimization>MaxSpeed</Optimization>\r
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <StringPooling>true</StringPooling>\r
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
-      <FunctionLevelLinking>true</FunctionLevelLinking>\r
-      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
-      <WarningLevel>Level4</WarningLevel>\r
-      <DebugInformationFormat>\r
-      </DebugInformationFormat>\r
-      <CompileAs>Default</CompileAs>\r
-      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-    </ClCompile>\r
-    <ResourceCompile>\r
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Culture>0x0409</Culture>\r
-    </ResourceCompile>\r
-    <Lib />\r
-  </ItemDefinitionGroup>\r
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
-    <ClCompile>\r
-      <Optimization>Disabled</Optimization>\r
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
-      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
-      <WarningLevel>Level4</WarningLevel>\r
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <CompileAs>Default</CompileAs>\r
-      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-    </ClCompile>\r
-    <ResourceCompile>\r
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Culture>0x0409</Culture>\r
-    </ResourceCompile>\r
-    <Lib>\r
-      <SuppressStartupBanner>true</SuppressStartupBanner>\r
-    </Lib>\r
-  </ItemDefinitionGroup>\r
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">\r
-    <ClCompile>\r
-      <Optimization>Disabled</Optimization>\r
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
-      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
-      <WarningLevel>Level4</WarningLevel>\r
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <CompileAs>Default</CompileAs>\r
-      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-    </ClCompile>\r
-    <ResourceCompile>\r
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Culture>0x0409</Culture>\r
-    </ResourceCompile>\r
-    <Lib>\r
-      <SuppressStartupBanner>true</SuppressStartupBanner>\r
-    </Lib>\r
-  </ItemDefinitionGroup>\r
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">\r
-    <ClCompile>\r
-      <Optimization>Disabled</Optimization>\r
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <PreprocessToFile>false</PreprocessToFile>\r
-      <PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers>\r
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
-      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
-      <WarningLevel>Level4</WarningLevel>\r
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <CompileAs>Default</CompileAs>\r
-      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-    </ClCompile>\r
-    <ResourceCompile>\r
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Culture>0x0409</Culture>\r
-    </ResourceCompile>\r
-    <Lib>\r
-      <SuppressStartupBanner>true</SuppressStartupBanner>\r
-    </Lib>\r
-  </ItemDefinitionGroup>\r
-  <ItemGroup>\r
-    <ClCompile Include="..\..\..\src\autofit\autofit.c" />\r
-    <ClCompile Include="..\..\..\src\bdf\bdf.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\cff\cff.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\base\ftbase.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\base\ftbitmap.c" />\r
-    <ClCompile Include="..\..\..\src\cache\ftcache.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\ftdebug.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">false</DisableLanguageExtensions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">false</DisableLanguageExtensions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableLanguageExtensions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">false</DisableLanguageExtensions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">false</DisableLanguageExtensions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</DisableLanguageExtensions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\base\ftfstype.c" />\r
-    <ClCompile Include="..\..\..\src\base\ftgasp.c" />\r
-    <ClCompile Include="..\..\..\src\base\ftglyph.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\gzip\ftgzip.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\base\ftinit.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\lzw\ftlzw.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\base\ftstroke.c" />\r
-    <ClCompile Include="..\..\..\src\base\ftsystem.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\smooth\smooth.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\base\ftbbox.c" />\r
-    <ClCompile Include="..\..\..\src\base\ftmm.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\base\ftpfr.c" />\r
-    <ClCompile Include="..\..\..\src\base\ftsynth.c" />\r
-    <ClCompile Include="..\..\..\src\base\fttype1.c" />\r
-    <ClCompile Include="..\..\..\src\base\ftwinfnt.c" />\r
-    <ClCompile Include="..\..\..\src\base\ftxf86.c" />\r
-    <ClCompile Include="..\..\..\src\base\ftlcdfil.c" />\r
-    <ClCompile Include="..\..\..\src\base\ftgxval.c" />\r
-    <ClCompile Include="..\..\..\src\base\ftotval.c" />\r
-    <ClCompile Include="..\..\..\src\base\ftpatent.c" />\r
-    <ClCompile Include="..\..\..\src\pcf\pcf.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\pfr\pfr.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\psaux\psaux.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\pshinter\pshinter.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\psnames\psmodule.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\raster\raster.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\sfnt\sfnt.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\truetype\truetype.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\type1\type1.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\cid\type1cid.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\type42\type42.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\src\winfonts\winfnt.c">\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-    </ClCompile>\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <ClInclude Include="..\..\..\include\ft2build.h" />\r
-    <ClInclude Include="..\..\..\include\freetype\config\ftconfig.h" />\r
-    <ClInclude Include="..\..\..\include\freetype\config\ftheader.h" />\r
-    <ClInclude Include="..\..\..\include\freetype\config\ftmodule.h" />\r
-    <ClInclude Include="..\..\..\include\freetype\config\ftoption.h" />\r
-    <ClInclude Include="..\..\..\include\freetype\config\ftstdlib.h" />\r
-  </ItemGroup>\r
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
-  <ImportGroup Label="ExtensionTargets">\r
-  </ImportGroup>\r
-</Project>\r
diff --git a/builds/win32/vc2010/index.html b/builds/win32/vc2010/index.html
deleted file mode 100644 (file)
index 1d492fb..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<html>
-<header>
-<title>
-  FreeType&nbsp;2 Project Files for VS.NET&nbsp;2010
-</title>
-
-<body>
-<h1>
-  FreeType&nbsp;2 Project Files for VS.NET&nbsp;2010
-</h1>
-
-<p>This directory contains a project file for Visual C++, named
-<tt>freetype.vcxproj</tt>, and Visual Studio, called <tt>freetype.sln</tt>.  It
-compiles the following libraries from the FreeType 2.4.9 sources:</p>
-
-<ul>
-  <pre>
-    freetype249.lib     - release build; single threaded
-    freetype249_D.lib   - debug build;   single threaded
-    freetype249MT.lib   - release build; multi-threaded
-    freetype249MT_D.lib - debug build;   multi-threaded</pre>
-</ul>
-
-<p>Be sure to extract the files with the Windows (CR+LF) line endings.  ZIP
-archives are already stored this way, so no further action is required.  If
-you use some <tt>.tar.*z</tt> archives, be sure to configure your extracting
-tool to convert the line endings.  For example, with <a
-href="http://www.winzip.com">WinZip</a>, you should activate the <it>TAR
-file smart CR/LF Conversion</it> option.  Alternatively, you may consider
-using the <tt>unix2dos</tt> or <tt>u2d</tt> utilities that are floating
-around, which specifically deal with this particular problem.
-
-<p>Build directories are placed in the top-level <tt>objs</tt>
-directory.</p>
-
-</body>
-</html>
index 272415d..24f9658 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Debugging and logging component for WinCE (body).                    */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2005, 2008, 2009 by                         */
+/*  Copyright 1996-2002, 2005, 2008, 2009, 2013 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -71,7 +71,8 @@
 
 
   FT_BASE_DEF( void )
-  FT_Message( const char*  fmt, ... )
+  FT_Message( const char*  fmt,
+              ... )
   {
     static char  buf[8192];
     va_list      ap;
@@ -87,7 +88,8 @@
 
 
   FT_BASE_DEF( void )
-  FT_Panic( const char*  fmt, ... )
+  FT_Panic( const char*  fmt,
+            ... )
   {
     static char  buf[8192];
     va_list      ap;
   }
 
 
+  /* 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;
+  }
+
 #ifdef FT_DEBUG_LEVEL_TRACE
 
 
   /* for the memory and stream components which are set to 6 and 5,        */
   /* respectively.                                                         */
   /*                                                                       */
-  /* See the file <freetype/internal/fttrace.h> for details of the         */
-  /* available toggle names.                                               */
+  /* See the file <internal/fttrace.h> for details of the available toggle */
+  /* names.                                                                */
   /*                                                                       */
   /* The level must be between 0 and 6; 0 means quiet (except for serious  */
   /* runtime errors), and 6 means _very_ verbose.                          */
         while ( *p && *p != ':' )
           p++;
 
+        if ( !*p )
+          break;
+
         if ( *p == ':' && p > q )
         {
-          int  n, i, len = p - q;
+          int  n, i, len = (int)( p - q );
           int  level = -1, found = -1;
 
 
           p++;
           if ( *p )
           {
-            level = *p++ - '0';
+            level = *p - '0';
             if ( level < 0 || level > 7 )
               level = -1;
           }
index fa0e986..5614235 100644 (file)
@@ -21,7 +21,7 @@
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
@@ -41,7 +41,7 @@
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
@@ -61,7 +61,7 @@
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
@@ -81,7 +81,7 @@
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249MT.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255MT.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249MT.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255MT.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249MT.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255MT.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249MT.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255MT.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249MT.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255MT.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249MT.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255MT.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249ST.lib" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255ST.lib" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249ST.lib" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255ST.lib" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249ST.lib" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255ST.lib" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249ST.lib" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255ST.lib" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249ST.lib" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255ST.lib" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249ST.lib" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255ST.lib" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249ST_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255ST_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249ST_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255ST_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249ST_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255ST_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249ST_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255ST_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249ST_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255ST_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249ST_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255ST_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249MT_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255MT_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249MT_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255MT_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249MT_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255MT_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249MT_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255MT_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249MT_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255MT_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249MT_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255MT_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249MT.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255MT.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype249MT_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\wince\vc2005-ce\freetype255MT_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
     <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl">\r
       <File RelativePath="..\..\..\include\ft2build.h">\r
       </File>\r
-      <File RelativePath="..\..\..\include\freetype\config\ftconfig.h">\r
+      <File RelativePath="..\..\..\include\config\ftconfig.h">\r
       </File>\r
-      <File RelativePath="..\..\..\include\freetype\config\ftheader.h">\r
+      <File RelativePath="..\..\..\include\config\ftheader.h">\r
       </File>\r
-      <File RelativePath="..\..\..\include\freetype\config\ftmodule.h">\r
+      <File RelativePath="..\..\..\include\config\ftmodule.h">\r
       </File>\r
-      <File RelativePath="..\..\..\include\freetype\config\ftoption.h">\r
+      <File RelativePath="..\..\..\include\config\ftoption.h">\r
       </File>\r
-      <File RelativePath="..\..\..\include\freetype\config\ftstdlib.h">\r
+      <File RelativePath="..\..\..\include\config\ftstdlib.h">\r
       </File>\r
     </Filter>\r
   </Files>\r
index cffa8cb..e2160f6 100644 (file)
@@ -21,14 +21,14 @@ the following targets:
   <li>PPC/SP WM6 (Windows Mobile 6)</li>
 </ul>
 
-It compiles the following libraries from the FreeType 2.4.9 sources:</p>
+It compiles the following libraries from the FreeType 2.5.5 sources:</p>
 
 <ul>
   <pre>
-    freetype249.lib     - release build; single threaded
-    freetype249_D.lib   - debug build;   single threaded
-    freetype249MT.lib   - release build; multi-threaded
-    freetype249MT_D.lib - debug build;   multi-threaded</pre>
+    freetype255.lib     - release build; single threaded
+    freetype255_D.lib   - debug build;   single threaded
+    freetype255MT.lib   - release build; multi-threaded
+    freetype255MT_D.lib - debug build;   multi-threaded</pre>
 </ul>
 
 <p>Be sure to extract the files with the Windows (CR+LF) line endings.  ZIP
index 1f052c1..e36ccb0 100644 (file)
@@ -88,7 +88,7 @@
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\wince\vc2008-ce\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftconfig.h"\r
+                               RelativePath="..\..\..\include\config\ftconfig.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftheader.h"\r
+                               RelativePath="..\..\..\include\config\ftheader.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftmodule.h"\r
+                               RelativePath="..\..\..\include\config\ftmodule.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftoption.h"\r
+                               RelativePath="..\..\..\include\config\ftoption.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftstdlib.h"\r
+                               RelativePath="..\..\..\include\config\ftstdlib.h"\r
                                >\r
                        </File>\r
                </Filter>\r
index 0c636b6..469baef 100644 (file)
@@ -21,14 +21,14 @@ the following targets:
   <li>PPC/SP WM6 (Windows Mobile 6)</li>
 </ul>
 
-It compiles the following libraries from the FreeType 2.4.9 sources:</p>
+It compiles the following libraries from the FreeType 2.5.5 sources:</p>
 
 <ul>
   <pre>
-    freetype249.lib     - release build; single threaded
-    freetype249_D.lib   - debug build;   single threaded
-    freetype249MT.lib   - release build; multi-threaded
-    freetype249MT_D.lib - debug build;   multi-threaded</pre>
+    freetype255.lib     - release build; single threaded
+    freetype255_D.lib   - debug build;   single threaded
+    freetype255MT.lib   - release build; multi-threaded
+    freetype255MT_D.lib - debug build;   multi-threaded</pre>
 </ul>
 
 <p>Be sure to extract the files with the Windows (CR+LF) line endings.  ZIP
diff --git a/builds/windows/.gitignore b/builds/windows/.gitignore
new file mode 100644 (file)
index 0000000..41456a4
--- /dev/null
@@ -0,0 +1,5 @@
+# user-specific cache/settings files
+*.opensdf
+*.sdf
+*.suo
+*.user
similarity index 95%
rename from builds/win32/detect.mk
rename to builds/windows/detect.mk
index 1906539..9dca261 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2004, 2006, 2007 by
+# Copyright 1996-2000, 2003, 2004, 2006, 2007, 2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -23,7 +23,7 @@ ifeq ($(PLATFORM),ansi)
   #
   ifeq ($(OS),Windows_NT)
 
-    PLATFORM := win32
+    PLATFORM := windows
 
   else
 
@@ -44,7 +44,8 @@ ifeq ($(PLATFORM),ansi)
     #
     # A better test is to check whether there are both the environment
     # variables `winbootdir' and `windir'.  The first indicates an
-    # underlying DOS 7.x, while the second is set only if win32 is available.
+    # underlying DOS 7.x, while the second is set only if windows is
+    # available.
     #
     # Note that on Windows NT, such an environment variable will not be seen
     # from DOS-based tools like DJGPP's make; this is not actually a problem
@@ -53,7 +54,7 @@ ifeq ($(PLATFORM),ansi)
     ifdef winbootdir
       ifdef windir
 
-        PLATFORM := win32
+        PLATFORM := windows
 
       endif
     endif
@@ -62,7 +63,7 @@ ifeq ($(PLATFORM),ansi)
 
 endif # test PLATFORM ansi
 
-ifeq ($(PLATFORM),win32)
+ifeq ($(PLATFORM),windows)
 
   DELETE := del
   CAT    := type
@@ -177,7 +178,7 @@ ifeq ($(PLATFORM),win32)
     .PHONY: devel-gcc
   endif
 
-endif   # test PLATFORM win32
+endif   # test PLATFORM windows
 
 
 # EOF
similarity index 90%
rename from builds/win32/ftdebug.c
rename to builds/windows/ftdebug.c
index d1ca15a..dd2c2ad 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Debugging and logging component for Win32 (body).                    */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2005, 2008, 2009 by                         */
+/*  Copyright 1996-2002, 2005, 2008, 2009, 2013 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -47,7 +47,6 @@
 
 #ifdef FT_DEBUG_LEVEL_ERROR
 
-
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
 #include <windows.h>
 
 
+  /* documentation is in ftdebug.h */
+
   FT_BASE_DEF( void )
-  FT_Message( const char*  fmt, ... )
+  FT_Message( const char*  fmt,
+              ... )
   {
     static char  buf[8192];
     va_list      ap;
   }
 
 
+  /* documentation is in ftdebug.h */
+
   FT_BASE_DEF( void )
-  FT_Panic( const char*  fmt, ... )
+  FT_Panic( const char*  fmt,
+            ... )
   {
     static char  buf[8192];
     va_list      ap;
   }
 
 
+  /* 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;
+  }
+
+
 #ifdef FT_DEBUG_LEVEL_TRACE
 
 
   /* for the memory and stream components which are set to 6 and 5,        */
   /* respectively.                                                         */
   /*                                                                       */
-  /* See the file <freetype/internal/fttrace.h> for details of the         */
-  /* available toggle names.                                               */
+  /* See the file <internal/fttrace.h> for details of the available toggle */
+  /* names.                                                                */
   /*                                                                       */
   /* The level must be between 0 and 6; 0 means quiet (except for serious  */
   /* runtime errors), and 6 means _very_ verbose.                          */
         while ( *p && *p != ':' )
           p++;
 
+        if ( !*p )
+          break;
+
         if ( *p == ':' && p > q )
         {
-          int  n, i, len = p - q;
+          int  n, i, len = (int)( p - q );
           int  level = -1, found = -1;
 
 
           p++;
           if ( *p )
           {
-            level = *p++ - '0';
+            level = *p - '0';
             if ( level < 0 || level > 7 )
               level = -1;
           }
similarity index 97%
rename from builds/win32/vc2005/freetype.vcproj
rename to builds/windows/vc2005/freetype.vcproj
index 6f17352..5880b7d 100644 (file)
@@ -16,7 +16,7 @@
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\win32\vc2005\freetype249.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\win32\vc2005\freetype255.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
@@ -33,7 +33,7 @@
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\win32\vc2005\freetype249MT.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\win32\vc2005\freetype255MT.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
@@ -50,7 +50,7 @@
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\win32\vc2005\freetype249ST.lib" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\win32\vc2005\freetype255ST.lib" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
@@ -67,7 +67,7 @@
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\win32\vc2005\freetype249_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\win32\vc2005\freetype255_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
@@ -84,7 +84,7 @@
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\win32\vc2005\freetype249ST_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\win32\vc2005\freetype255ST_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
       <Tool Name="VCManagedResourceCompilerTool" />\r
       <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" />\r
       <Tool Name="VCPreLinkEventTool" />\r
-      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\win32\vc2005\freetype249MT_D.lib" SuppressStartupBanner="true" />\r
+      <Tool Name="VCLibrarianTool" OutputFile="..\..\..\objs\win32\vc2005\freetype255MT_D.lib" SuppressStartupBanner="true" />\r
       <Tool Name="VCALinkTool" />\r
       <Tool Name="VCXDCMakeTool" />\r
       <Tool Name="VCBscMakeTool" />\r
     <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl">\r
       <File RelativePath="..\..\..\include\ft2build.h">\r
       </File>\r
-      <File RelativePath="..\..\..\include\freetype\config\ftconfig.h">\r
+      <File RelativePath="..\..\..\include\config\ftconfig.h">\r
       </File>\r
-      <File RelativePath="..\..\..\include\freetype\config\ftheader.h">\r
+      <File RelativePath="..\..\..\include\config\ftheader.h">\r
       </File>\r
-      <File RelativePath="..\..\..\include\freetype\config\ftmodule.h">\r
+      <File RelativePath="..\..\..\include\config\ftmodule.h">\r
       </File>\r
-      <File RelativePath="..\..\..\include\freetype\config\ftoption.h">\r
+      <File RelativePath="..\..\..\include\config\ftoption.h">\r
       </File>\r
-      <File RelativePath="..\..\..\include\freetype\config\ftstdlib.h">\r
+      <File RelativePath="..\..\..\include\config\ftstdlib.h">\r
       </File>\r
     </Filter>\r
   </Files>\r
similarity index 76%
rename from builds/win32/vc2005/index.html
rename to builds/windows/vc2005/index.html
index bc4291c..4929dcd 100644 (file)
 
 <p>This directory contains project files for Visual C++, named
 <tt>freetype.vcproj</tt>, and Visual Studio, called <tt>freetype.sln</tt>.  It
-compiles the following libraries from the FreeType 2.4.9 sources:</p>
+compiles the following libraries from the FreeType 2.5.5 sources:</p>
 
 <ul>
   <pre>
-    freetype249.lib     - release build; single threaded
-    freetype249_D.lib   - debug build;   single threaded
-    freetype249MT.lib   - release build; multi-threaded
-    freetype249MT_D.lib - debug build;   multi-threaded</pre>
+    freetype255.lib     - release build; single threaded
+    freetype255_D.lib   - debug build;   single threaded
+    freetype255MT.lib   - release build; multi-threaded
+    freetype255MT_D.lib - debug build;   multi-threaded</pre>
 </ul>
 
 <p>Be sure to extract the files with the Windows (CR+LF) line endings.  ZIP
similarity index 94%
rename from builds/win32/vc2008/freetype.vcproj
rename to builds/windows/vc2008/freetype.vcproj
index 897c5e5..95d722b 100644 (file)
@@ -70,7 +70,7 @@
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\win32\vc2008\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\win32\vc2008\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\win32\vc2008\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\win32\vc2008\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\win32\vc2008\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\win32\vc2008\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\win32\vc2008\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\win32\vc2008\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\win32\vc2008\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\win32\vc2008\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\win32\vc2008\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\win32\vc2008\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftconfig.h"\r
+                               RelativePath="..\..\..\include\config\ftconfig.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftheader.h"\r
+                               RelativePath="..\..\..\include\config\ftheader.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftmodule.h"\r
+                               RelativePath="..\..\..\include\config\ftmodule.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftoption.h"\r
+                               RelativePath="..\..\..\include\config\ftoption.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftstdlib.h"\r
+                               RelativePath="..\..\..\include\config\ftstdlib.h"\r
                                >\r
                        </File>\r
                </Filter>\r
similarity index 76%
rename from builds/win32/vc2008/index.html
rename to builds/windows/vc2008/index.html
index 9ad33ea..7e0d154 100644 (file)
 
 <p>This directory contains project files for Visual C++, named
 <tt>freetype.vcproj</tt>, and Visual Studio, called <tt>freetype.sln</tt>.  It
-compiles the following libraries from the FreeType 2.4.9 sources:</p>
+compiles the following libraries from the FreeType 2.5.5 sources:</p>
 
 <ul>
   <pre>
-    freetype249.lib     - release build; single threaded
-    freetype249_D.lib   - debug build;   single threaded
-    freetype249MT.lib   - release build; multi-threaded
-    freetype249MT_D.lib - debug build;   multi-threaded</pre>
+    freetype255.lib     - release build; single threaded
+    freetype255_D.lib   - debug build;   single threaded
+    freetype255MT.lib   - release build; multi-threaded
+    freetype255MT_D.lib - debug build;   multi-threaded</pre>
 </ul>
 
 <p>Be sure to extract the files with the Windows (CR+LF) line endings.  ZIP
similarity index 56%
rename from builds/win32/vc2010/freetype.sln
rename to builds/windows/vc2010/freetype.sln
index 3439f62..3bd176a 100644 (file)
@@ -1,30 +1,48 @@
 \r
 Microsoft Visual Studio Solution File, Format Version 11.00\r
-# Visual Studio 2010\r
+# Visual Studio Express 2012 for Windows Desktop\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "freetype.vcxproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}"\r
 EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+               Debug|Win32 = Debug|Win32\r
+               Debug|x64 = Debug|x64\r
                Debug Multithreaded|Win32 = Debug Multithreaded|Win32\r
+               Debug Multithreaded|x64 = Debug Multithreaded|x64\r
                Debug Singlethreaded|Win32 = Debug Singlethreaded|Win32\r
-               Debug|Win32 = Debug|Win32\r
+               Debug Singlethreaded|x64 = Debug Singlethreaded|x64\r
+               Release|Win32 = Release|Win32\r
+               Release|x64 = Release|x64\r
                Release Multithreaded|Win32 = Release Multithreaded|Win32\r
+               Release Multithreaded|x64 = Release Multithreaded|x64\r
                Release Singlethreaded|Win32 = Release Singlethreaded|Win32\r
-               Release|Win32 = Release|Win32\r
+               Release Singlethreaded|x64 = Release Singlethreaded|x64\r
        EndGlobalSection\r
        GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|x64\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.Build.0 = Debug|x64\r
                {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.ActiveCfg = Debug Multithreaded|Win32\r
                {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.Build.0 = Debug Multithreaded|Win32\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|x64.ActiveCfg = Debug Multithreaded|x64\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|x64.Build.0 = Debug Multithreaded|x64\r
                {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|Win32.ActiveCfg = Debug Singlethreaded|Win32\r
                {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|Win32.Build.0 = Debug Singlethreaded|Win32\r
-               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32\r
-               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|x64.ActiveCfg = Debug Singlethreaded|x64\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|x64.Build.0 = Debug Singlethreaded|x64\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|x64\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.Build.0 = Release|x64\r
                {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|Win32.ActiveCfg = Release Multithreaded|Win32\r
                {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|Win32.Build.0 = Release Multithreaded|Win32\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|x64.ActiveCfg = Release Multithreaded|x64\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|x64.Build.0 = Release Multithreaded|x64\r
                {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|Win32.ActiveCfg = Release Singlethreaded|Win32\r
                {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|Win32.Build.0 = Release Singlethreaded|Win32\r
-               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32\r
-               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|x64.ActiveCfg = Release Singlethreaded|x64\r
+               {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|x64.Build.0 = Release Singlethreaded|x64\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
diff --git a/builds/windows/vc2010/freetype.user.props b/builds/windows/vc2010/freetype.user.props
new file mode 100644 (file)
index 0000000..234dd5d
--- /dev/null
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!--\r
+ * freetype.user.props\r
+ *\r
+ *\r
+ * You can specify custom options here without altering the project file.\r
+ *\r
+ * Multiple entries within each property are separated by semicolons (;).\r
+ *\r
+ * NOTE: If you want to link against zlib, libpng, bzip2 or harfbuzz, you\r
+ *       should alter these values appropriately.\r
+ -->\r
+\r
+<Project ToolsVersion="4.0"\r
+         xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <PropertyGroup Label="Globals">\r
+\r
+    <!--\r
+     * `;'-separated list of symbols to #define\r
+     -->\r
+    <UserDefines></UserDefines>\r
+\r
+    <!--\r
+     * path where your custom `ftoption.h' lives;\r
+     * this is searched BEFORE any other path\r
+     -->\r
+    <!-- <UserOptionDirectory>..\..\..\devel</UserOptionDirectory> -->\r
+    <UserOptionDirectory></UserOptionDirectory>\r
+\r
+    <!--\r
+     * `;'-separated list of paths to additional include directories,\r
+     * e.g., where to find zlib.h, png.h, etc.;\r
+     * this is searched AFTER any other path\r
+     -->\r
+    <!-- <UserIncludeDirectories>..\..\..\..\zlib-1.2.8;..\..\..\..\libpng-1.6.12</UserIncludeDirectories> -->\r
+    <UserIncludeDirectories></UserIncludeDirectories>\r
+\r
+    <!--\r
+     * `;'-separated list of paths to additional library directories,\r
+     * e.g., where to find zlib.lib, libpng.lib, etc.\r
+     -->\r
+    <!-- <UserLibraryDirectories>..\..\..\..\zlib-1.2.8;..\..\..\..\libpng-1.6.12</UserLibraryDirectories> -->\r
+    <UserLibraryDirectories></UserLibraryDirectories>\r
+\r
+    <!--\r
+     * `;'-separated list of additional linker dependencies,\r
+     * e.g., zlib.lib, libpng.lib, etc.\r
+     -->\r
+    <!-- <UserDependencies>zlib.lib;libpng16.lib</UserDependencies> -->\r
+    <UserDependencies></UserDependencies>\r
+\r
+  </PropertyGroup>\r
+\r
+  <!--\r
+   * Example configuration for x64 debug build only\r
+   -->\r
+\r
+  <!--\r
+    <PropertyGroup Label="DebugProperties"\r
+                   Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+      <UserDefines>ENABLE_DEBUG_HELPER;ENABLE_DEBUG_LOGGING</UserDefines>\r
+      <UserOptionDirectory>config\debug</UserOptionDirectory>\r
+      <UserIncludeDirectories>C:\mydebughelp\include</UserIncludeDirectories>\r
+      <UserLibraryDirectories>C:\mydebughelp\lib</UserLibraryDirectories>\r
+      <UserDependencies>dhelper64.lib</UserDependencies>\r
+    </PropertyGroup>\r
+   -->\r
+</Project>\r
diff --git a/builds/windows/vc2010/freetype.vcxproj b/builds/windows/vc2010/freetype.vcxproj
new file mode 100644 (file)
index 0000000..7cafe45
--- /dev/null
@@ -0,0 +1,1718 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug Multithreaded|Win32">\r
+      <Configuration>Debug Multithreaded</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug Multithreaded|x64">\r
+      <Configuration>Debug Multithreaded</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug Singlethreaded|Win32">\r
+      <Configuration>Debug Singlethreaded</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug Singlethreaded|x64">\r
+      <Configuration>Debug Singlethreaded</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release Multithreaded|Win32">\r
+      <Configuration>Release Multithreaded</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release Multithreaded|x64">\r
+      <Configuration>Release Multithreaded</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release Singlethreaded|Win32">\r
+      <Configuration>Release Singlethreaded</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release Singlethreaded|x64">\r
+      <Configuration>Release Singlethreaded</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}</ProjectGuid>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v100</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v100</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v100</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v100</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v100</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v100</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v100</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v100</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v100</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v100</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v100</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v100</PlatformToolset>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\..\..\..\objs\vc2010\$(Platform)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\..\..\..\objs\vc2010\$(Platform)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">.\..\..\..\objs\vc2010\$(Platform)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">.\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">.\..\..\..\objs\vc2010\$(Platform)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">.\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">.\..\..\..\objs\vc2010\$(Platform)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">.\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">.\..\..\..\objs\vc2010\$(Platform)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">.\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\..\..\..\objs\vc2010\$(Platform)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\..\..\..\objs\vc2010\$(Platform)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">.\..\..\..\objs\vc2010\$(Platform)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">.\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">.\..\..\..\objs\vc2010\$(Platform)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">.\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">.\..\..\..\objs\vc2010\$(Platform)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">.\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">.\..\..\..\objs\vc2010\$(Platform)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">.\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\</IntDir>\r
+    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
+    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
+    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
+    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
+    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'" />\r
+    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'" />\r
+    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'" />\r
+    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'" />\r
+    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'" />\r
+    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'" />\r
+    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'" />\r
+    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'" />\r
+    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
+    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
+    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
+    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
+    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'" />\r
+    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'" />\r
+    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'" />\r
+    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'" />\r
+    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'" />\r
+    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'" />\r
+    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'" />\r
+    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'" />\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">freetype255d</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">freetype255d</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">freetype255MTd</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">freetype255MTd</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">freetype255STd</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">freetype255STd</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">freetype255</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">freetype255</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">freetype255MT</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">freetype255MT</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">freetype255ST</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">freetype255ST</TargetName>\r
+  </PropertyGroup>\r
+  <Import Project="$(SolutionDir)\freetype.user.props" Condition="exists('$(SolutionDir)\freetype.user.props')" Label="UserProperties" />\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+      <CompileAsManaged>false</CompileAsManaged>\r
+      <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>\r
+      <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+    </ResourceCompile>\r
+    <Lib>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+      <CompileAsManaged>false</CompileAsManaged>\r
+      <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>\r
+      <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+    </ResourceCompile>\r
+    <Lib>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;_CRT_SECURE_NO_DEPRECATE;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessToFile>false</PreprocessToFile>\r
+      <PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+      <CompileAsManaged>false</CompileAsManaged>\r
+      <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>\r
+      <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+    </ResourceCompile>\r
+    <Lib>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;_CRT_SECURE_NO_DEPRECATE;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessToFile>false</PreprocessToFile>\r
+      <PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+      <CompileAsManaged>false</CompileAsManaged>\r
+      <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>\r
+      <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+    </ResourceCompile>\r
+    <Lib>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+      <CompileAsManaged>false</CompileAsManaged>\r
+      <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>\r
+      <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+    </ResourceCompile>\r
+    <Lib>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+      <CompileAsManaged>false</CompileAsManaged>\r
+      <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>\r
+      <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+    </ResourceCompile>\r
+    <Lib>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <ClCompile>\r
+      <Optimization>Full</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
+      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <FloatingPointExceptions>false</FloatingPointExceptions>\r
+      <CreateHotpatchableImage>false</CreateHotpatchableImage>\r
+      <CompileAsManaged>false</CompileAsManaged>\r
+      <ProgramDataBaseFileName>\r
+      </ProgramDataBaseFileName>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <DebugInformationFormat>\r
+      </DebugInformationFormat>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+    </ResourceCompile>\r
+    <Lib>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <ClCompile>\r
+      <Optimization>Full</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
+      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <FloatingPointExceptions>false</FloatingPointExceptions>\r
+      <CreateHotpatchableImage>false</CreateHotpatchableImage>\r
+      <CompileAsManaged>false</CompileAsManaged>\r
+      <ProgramDataBaseFileName>\r
+      </ProgramDataBaseFileName>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <DebugInformationFormat>\r
+      </DebugInformationFormat>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+    </ResourceCompile>\r
+    <Lib>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">\r
+    <ClCompile>\r
+      <Optimization>Full</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
+      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <FloatingPointExceptions>false</FloatingPointExceptions>\r
+      <CreateHotpatchableImage>false</CreateHotpatchableImage>\r
+      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r
+      <CompileAsManaged>false</CompileAsManaged>\r
+      <ProgramDataBaseFileName>\r
+      </ProgramDataBaseFileName>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <DebugInformationFormat>\r
+      </DebugInformationFormat>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+    </ResourceCompile>\r
+    <Lib>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">\r
+    <ClCompile>\r
+      <Optimization>Full</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
+      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <FloatingPointExceptions>false</FloatingPointExceptions>\r
+      <CreateHotpatchableImage>false</CreateHotpatchableImage>\r
+      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r
+      <CompileAsManaged>false</CompileAsManaged>\r
+      <ProgramDataBaseFileName>\r
+      </ProgramDataBaseFileName>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <DebugInformationFormat>\r
+      </DebugInformationFormat>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+    </ResourceCompile>\r
+    <Lib>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">\r
+    <ClCompile>\r
+      <Optimization>Full</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
+      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <FloatingPointExceptions>false</FloatingPointExceptions>\r
+      <CreateHotpatchableImage>false</CreateHotpatchableImage>\r
+      <CompileAsManaged>false</CompileAsManaged>\r
+      <ProgramDataBaseFileName>\r
+      </ProgramDataBaseFileName>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <DebugInformationFormat>\r
+      </DebugInformationFormat>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+    </ResourceCompile>\r
+    <Lib />\r
+    <Lib>\r
+      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">\r
+    <ClCompile>\r
+      <Optimization>Full</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <AdditionalIncludeDirectories>$(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <DisableLanguageExtensions>true</DisableLanguageExtensions>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4001</DisableSpecificWarnings>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
+      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <FloatingPointExceptions>false</FloatingPointExceptions>\r
+      <CreateHotpatchableImage>false</CreateHotpatchableImage>\r
+      <CompileAsManaged>false</CompileAsManaged>\r
+      <ProgramDataBaseFileName>\r
+      </ProgramDataBaseFileName>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <DebugInformationFormat>\r
+      </DebugInformationFormat>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;$(UserDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+    </ResourceCompile>\r
+    <Lib />\r
+    <Lib>\r
+      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <AdditionalLibraryDirectories>$(UserLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>$(UserDependencies);%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\..\src\autofit\autofit.c" />\r
+    <ClCompile Include="..\..\..\src\bdf\bdf.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\cff\cff.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\base\ftbase.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\base\ftbitmap.c" />\r
+    <ClCompile Include="..\..\..\src\cache\ftcache.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\ftdebug.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">false</DisableLanguageExtensions>\r
+      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">false</DisableLanguageExtensions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">false</DisableLanguageExtensions>\r
+      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">false</DisableLanguageExtensions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableLanguageExtensions>\r
+      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</DisableLanguageExtensions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">false</DisableLanguageExtensions>\r
+      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">false</DisableLanguageExtensions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">false</DisableLanguageExtensions>\r
+      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">false</DisableLanguageExtensions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</DisableLanguageExtensions>\r
+      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</DisableLanguageExtensions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\base\ftfstype.c" />\r
+    <ClCompile Include="..\..\..\src\base\ftgasp.c" />\r
+    <ClCompile Include="..\..\..\src\base\ftglyph.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\gzip\ftgzip.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\base\ftinit.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\lzw\ftlzw.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\base\ftstroke.c" />\r
+    <ClCompile Include="..\..\..\src\base\ftsystem.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\smooth\smooth.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\base\ftbbox.c" />\r
+    <ClCompile Include="..\..\..\src\base\ftmm.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\base\ftpfr.c" />\r
+    <ClCompile Include="..\..\..\src\base\ftsynth.c" />\r
+    <ClCompile Include="..\..\..\src\base\fttype1.c" />\r
+    <ClCompile Include="..\..\..\src\base\ftwinfnt.c" />\r
+    <ClCompile Include="..\..\..\src\base\ftxf86.c" />\r
+    <ClCompile Include="..\..\..\src\base\ftlcdfil.c" />\r
+    <ClCompile Include="..\..\..\src\base\ftgxval.c" />\r
+    <ClCompile Include="..\..\..\src\base\ftotval.c" />\r
+    <ClCompile Include="..\..\..\src\base\ftpatent.c" />\r
+    <ClCompile Include="..\..\..\src\pcf\pcf.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\pfr\pfr.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\psaux\psaux.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\pshinter\pshinter.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\psnames\psmodule.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\raster\raster.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\sfnt\sfnt.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\truetype\truetype.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\type1\type1.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\cid\type1cid.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\type42\type42.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\src\winfonts\winfnt.c">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Multithreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug Singlethreaded|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>\r
+      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Multithreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Singlethreaded|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\..\include\ft2build.h" />\r
+    <ClInclude Include="..\..\..\include\config\ftconfig.h" />\r
+    <ClInclude Include="..\..\..\include\config\ftheader.h" />\r
+    <ClInclude Include="..\..\..\include\config\ftmodule.h" />\r
+    <ClInclude Include="..\..\..\include\config\ftoption.h" />\r
+    <ClInclude Include="..\..\..\include\config\ftstdlib.h" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
     <ClInclude Include="..\..\..\include\ft2build.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\..\..\include\freetype\config\ftconfig.h">\r
+    <ClInclude Include="..\..\..\include\config\ftconfig.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\..\..\include\freetype\config\ftheader.h">\r
+    <ClInclude Include="..\..\..\include\config\ftheader.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\..\..\include\freetype\config\ftmodule.h">\r
+    <ClInclude Include="..\..\..\include\config\ftmodule.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\..\..\include\freetype\config\ftoption.h">\r
+    <ClInclude Include="..\..\..\include\config\ftoption.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\..\..\include\freetype\config\ftstdlib.h">\r
+    <ClInclude Include="..\..\..\include\config\ftstdlib.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
   </ItemGroup>\r
diff --git a/builds/windows/vc2010/index.html b/builds/windows/vc2010/index.html
new file mode 100644 (file)
index 0000000..cb205aa
--- /dev/null
@@ -0,0 +1,52 @@
+<html>
+<header>
+<title>
+  FreeType&nbsp;2 Project Files for VS.NET&nbsp;2010 or newer
+</title>
+
+<body>
+<h1>
+  FreeType&nbsp;2 Project Files for VS.NET&nbsp;2010 or newer
+</h1>
+
+<p>This directory contains a project file for Visual C++ (VS.NET&nbsp;2010
+or newer), named <tt>freetype.vcxproj</tt>, and Visual Studio, called
+<tt>freetype.sln</tt>.  It compiles the following libraries from the
+FreeType 2.5.5 sources:</p>
+
+<ul>
+  <pre>
+freetype255.lib     - release build
+freetype255d.lib    - debug build
+freetype255ST.lib   - release build; single threaded
+freetype255STd.lib  - debug build;   single threaded
+freetype255MT.lib   - release build; multi-threaded
+freetype255MTd.lib  - debug build;   multi-threaded</pre>
+</ul>
+
+<p>Both Win32 and x64 builds are supported.</p>
+
+<p>Be sure to extract the files with the Windows (CR+LF) line endings.  ZIP
+archives are already stored this way, so no further action is required.  If
+you use some <tt>.tar.*z</tt> archives, be sure to configure your extracting
+tool to convert the line endings.  For example, with <a
+href="http://www.winzip.com">WinZip</a>, you should activate the <em>TAR
+file smart CR/LF Conversion</em> option.  Alternatively, you may consider
+using the <tt>unix2dos</tt> or <tt>u2d</tt> utilities that are floating
+around, which specifically deal with this particular problem.
+
+<p>Build directories are placed in the top-level <tt>objs\vc2010</tt>
+directory.</p>
+
+<p>Customization of the FreeType library is done by editing the
+<tt>ftoptions.h</tt> header file in the top-level <tt>devel</tt> path.
+Alternatively, you may copy the file to another directory and change the
+include directory in <tt>freetype.users.props</tt>.</p>
+
+<p>To configure library dependencies like <em>zlib</em> and <em>libpng</em>,
+edit the <tt>freetype.users.props</tt> file in this directory.  It also
+simplifies automated (command-line) builds using <a
+href="http://msdn.microsoft.com/library/dd393574%28v=vs.100%29.aspx">msbuild</a>.</p>
+
+</body>
+</html>
similarity index 86%
rename from builds/win32/visualc/freetype.dsp
rename to builds/windows/visualc/freetype.dsp
index 274a763..cf76f7c 100644 (file)
@@ -7,23 +7,23 @@
 CFG=freetype - Win32 Debug Singlethreaded\r
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
 !MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE NMAKE /f "freetype.mak".\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE You can specify a configuration when running NMAKE\r
 !MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE NMAKE /f "freetype.mak" CFG="freetype - Win32 Debug Singlethreaded"\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE "freetype - Win32 Release" (based on "Win32 (x86) Static Library")\r
 !MESSAGE "freetype - Win32 Debug" (based on "Win32 (x86) Static Library")\r
 !MESSAGE "freetype - Win32 Debug Multithreaded" (based on "Win32 (x86) Static Library")\r
 !MESSAGE "freetype - Win32 Release Multithreaded" (based on "Win32 (x86) Static Library")\r
 !MESSAGE "freetype - Win32 Release Singlethreaded" (based on "Win32 (x86) Static Library")\r
 !MESSAGE "freetype - Win32 Debug Singlethreaded" (based on "Win32 (x86) Static Library")\r
-!MESSAGE \r
+!MESSAGE\r
 \r
 # Begin Project\r
 # PROP AllowPerConfigDependencies 0\r
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LIB32=link.exe -lib\r
 # ADD BASE LIB32 /nologo\r
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249.lib"\r
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255.lib"\r
 \r
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug"\r
 \r
@@ -78,7 +78,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LIB32=link.exe -lib\r
 # ADD BASE LIB32 /nologo\r
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249_D.lib"\r
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255_D.lib"\r
 \r
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug Multithreaded"\r
 \r
@@ -92,7 +92,7 @@ LIB32=link.exe -lib
 # PROP Output_Dir "..\..\..\objs\debug_mt"\r
 # PROP Intermediate_Dir "..\..\..\objs\debug_mt"\r
 # PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /Za /W3 /Gm /GX /ZI /Od /I "..\freetype\include\\" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /GZ /c\r
+# ADD BASE CPP /nologo /Za /W3 /Gm /GX /ZI /Od /I "..\include\\" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /GZ /c\r
 # SUBTRACT BASE CPP /X\r
 # ADD CPP /MTd /Za /W4 /GX /Z7 /Od /I "..\..\..\include" /D "_DEBUG" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /GZ /c\r
 # SUBTRACT CPP /nologo /X /YX\r
@@ -102,8 +102,8 @@ BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
 LIB32=link.exe -lib\r
-# ADD BASE LIB32 /nologo /out:"lib\freetype249_D.lib"\r
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249MT_D.lib"\r
+# ADD BASE LIB32 /nologo /out:"lib\freetype255_D.lib"\r
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255MT_D.lib"\r
 \r
 !ELSEIF  "$(CFG)" == "freetype - Win32 Release Multithreaded"\r
 \r
@@ -117,7 +117,7 @@ LIB32=link.exe -lib
 # PROP Output_Dir "..\..\..\objs\release_mt"\r
 # PROP Intermediate_Dir "..\..\..\objs\release_mt"\r
 # PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /Za /W3 /GX /O2 /I "..\freetype\include\\" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /c\r
+# ADD BASE CPP /nologo /Za /W3 /GX /O2 /I "..\include\\" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /c\r
 # ADD CPP /MT /Za /W4 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /c\r
 # SUBTRACT CPP /nologo /Z<none> /YX\r
 # ADD BASE RSC /l 0x409 /d "NDEBUG"\r
@@ -126,8 +126,8 @@ BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
 LIB32=link.exe -lib\r
-# ADD BASE LIB32 /nologo /out:"lib\freetype249.lib"\r
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249MT.lib"\r
+# ADD BASE LIB32 /nologo /out:"lib\freetype255.lib"\r
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255MT.lib"\r
 \r
 !ELSEIF  "$(CFG)" == "freetype - Win32 Release Singlethreaded"\r
 \r
@@ -151,8 +151,8 @@ BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
 LIB32=link.exe -lib\r
-# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype249.lib"\r
-# ADD LIB32 /out:"..\..\..\objs\freetype249ST.lib"\r
+# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype255.lib"\r
+# ADD LIB32 /out:"..\..\..\objs\freetype255ST.lib"\r
 # SUBTRACT LIB32 /nologo\r
 \r
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug Singlethreaded"\r
@@ -177,10 +177,10 @@ BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
 LIB32=link.exe -lib\r
-# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype249_D.lib"\r
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249ST_D.lib"\r
+# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype255_D.lib"\r
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255ST_D.lib"\r
 \r
-!ENDIF \r
+!ENDIF\r
 \r
 # Begin Target\r
 \r
@@ -377,23 +377,23 @@ SOURCE=..\..\..\include\ft2build.h
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=..\..\..\include\freetype\config\ftconfig.h\r
+SOURCE=..\..\..\include\config\ftconfig.h\r
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=..\..\..\include\freetype\config\ftheader.h\r
+SOURCE=..\..\..\include\config\ftheader.h\r
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=..\..\..\include\freetype\config\ftmodule.h\r
+SOURCE=..\..\..\include\config\ftmodule.h\r
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=..\..\..\include\freetype\config\ftoption.h\r
+SOURCE=..\..\..\include\config\ftoption.h\r
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=..\..\..\include\freetype\config\ftstdlib.h\r
+SOURCE=..\..\..\include\config\ftstdlib.h\r
 # End Source File\r
 # End Group\r
 # End Target\r
similarity index 94%
rename from builds/win32/visualc/freetype.vcproj
rename to builds/windows/visualc/freetype.vcproj
index f0638da..a71a0e9 100644 (file)
@@ -69,7 +69,7 @@
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftconfig.h"\r
+                               RelativePath="..\..\..\include\config\ftconfig.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftheader.h"\r
+                               RelativePath="..\..\..\include\config\ftheader.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftmodule.h"\r
+                               RelativePath="..\..\..\include\config\ftmodule.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftoption.h"\r
+                               RelativePath="..\..\..\include\config\ftoption.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftstdlib.h"\r
+                               RelativePath="..\..\..\include\config\ftstdlib.h"\r
                                >\r
                        </File>\r
                </Filter>\r
similarity index 77%
rename from builds/win32/visualc/index.html
rename to builds/windows/visualc/index.html
index a32c95f..751d7ad 100644 (file)
 
 <p>This directory contains project files for Visual C++, named
 <tt>freetype.dsp</tt>, and Visual Studio, called <tt>freetype.sln</tt>.  It
-compiles the following libraries from the FreeType 2.4.9 sources:</p>
+compiles the following libraries from the FreeType 2.5.5 sources:</p>
 
 <ul>
   <pre>
-    freetype249.lib     - release build; single threaded
-    freetype249_D.lib   - debug build;   single threaded
-    freetype249MT.lib   - release build; multi-threaded
-    freetype249MT_D.lib - debug build;   multi-threaded</pre>
+    freetype255.lib     - release build; single threaded
+    freetype255_D.lib   - debug build;   single threaded
+    freetype255MT.lib   - release build; multi-threaded
+    freetype255MT_D.lib - debug build;   multi-threaded</pre>
 </ul>
 
 <p>Be sure to extract the files with the Windows (CR+LF) line endings.  ZIP
similarity index 86%
rename from builds/win32/visualce/freetype.dsp
rename to builds/windows/visualce/freetype.dsp
index 274a763..cf76f7c 100644 (file)
@@ -7,23 +7,23 @@
 CFG=freetype - Win32 Debug Singlethreaded\r
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
 !MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE NMAKE /f "freetype.mak".\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE You can specify a configuration when running NMAKE\r
 !MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE NMAKE /f "freetype.mak" CFG="freetype - Win32 Debug Singlethreaded"\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
+!MESSAGE\r
 !MESSAGE "freetype - Win32 Release" (based on "Win32 (x86) Static Library")\r
 !MESSAGE "freetype - Win32 Debug" (based on "Win32 (x86) Static Library")\r
 !MESSAGE "freetype - Win32 Debug Multithreaded" (based on "Win32 (x86) Static Library")\r
 !MESSAGE "freetype - Win32 Release Multithreaded" (based on "Win32 (x86) Static Library")\r
 !MESSAGE "freetype - Win32 Release Singlethreaded" (based on "Win32 (x86) Static Library")\r
 !MESSAGE "freetype - Win32 Debug Singlethreaded" (based on "Win32 (x86) Static Library")\r
-!MESSAGE \r
+!MESSAGE\r
 \r
 # Begin Project\r
 # PROP AllowPerConfigDependencies 0\r
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LIB32=link.exe -lib\r
 # ADD BASE LIB32 /nologo\r
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249.lib"\r
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255.lib"\r
 \r
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug"\r
 \r
@@ -78,7 +78,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LIB32=link.exe -lib\r
 # ADD BASE LIB32 /nologo\r
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249_D.lib"\r
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255_D.lib"\r
 \r
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug Multithreaded"\r
 \r
@@ -92,7 +92,7 @@ LIB32=link.exe -lib
 # PROP Output_Dir "..\..\..\objs\debug_mt"\r
 # PROP Intermediate_Dir "..\..\..\objs\debug_mt"\r
 # PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /Za /W3 /Gm /GX /ZI /Od /I "..\freetype\include\\" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /GZ /c\r
+# ADD BASE CPP /nologo /Za /W3 /Gm /GX /ZI /Od /I "..\include\\" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /GZ /c\r
 # SUBTRACT BASE CPP /X\r
 # ADD CPP /MTd /Za /W4 /GX /Z7 /Od /I "..\..\..\include" /D "_DEBUG" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /GZ /c\r
 # SUBTRACT CPP /nologo /X /YX\r
@@ -102,8 +102,8 @@ BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
 LIB32=link.exe -lib\r
-# ADD BASE LIB32 /nologo /out:"lib\freetype249_D.lib"\r
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249MT_D.lib"\r
+# ADD BASE LIB32 /nologo /out:"lib\freetype255_D.lib"\r
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255MT_D.lib"\r
 \r
 !ELSEIF  "$(CFG)" == "freetype - Win32 Release Multithreaded"\r
 \r
@@ -117,7 +117,7 @@ LIB32=link.exe -lib
 # PROP Output_Dir "..\..\..\objs\release_mt"\r
 # PROP Intermediate_Dir "..\..\..\objs\release_mt"\r
 # PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /Za /W3 /GX /O2 /I "..\freetype\include\\" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /c\r
+# ADD BASE CPP /nologo /Za /W3 /GX /O2 /I "..\include\\" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /c\r
 # ADD CPP /MT /Za /W4 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /c\r
 # SUBTRACT CPP /nologo /Z<none> /YX\r
 # ADD BASE RSC /l 0x409 /d "NDEBUG"\r
@@ -126,8 +126,8 @@ BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
 LIB32=link.exe -lib\r
-# ADD BASE LIB32 /nologo /out:"lib\freetype249.lib"\r
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249MT.lib"\r
+# ADD BASE LIB32 /nologo /out:"lib\freetype255.lib"\r
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255MT.lib"\r
 \r
 !ELSEIF  "$(CFG)" == "freetype - Win32 Release Singlethreaded"\r
 \r
@@ -151,8 +151,8 @@ BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
 LIB32=link.exe -lib\r
-# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype249.lib"\r
-# ADD LIB32 /out:"..\..\..\objs\freetype249ST.lib"\r
+# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype255.lib"\r
+# ADD LIB32 /out:"..\..\..\objs\freetype255ST.lib"\r
 # SUBTRACT LIB32 /nologo\r
 \r
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug Singlethreaded"\r
@@ -177,10 +177,10 @@ BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
 LIB32=link.exe -lib\r
-# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype249_D.lib"\r
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249ST_D.lib"\r
+# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype255_D.lib"\r
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255ST_D.lib"\r
 \r
-!ENDIF \r
+!ENDIF\r
 \r
 # Begin Target\r
 \r
@@ -377,23 +377,23 @@ SOURCE=..\..\..\include\ft2build.h
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=..\..\..\include\freetype\config\ftconfig.h\r
+SOURCE=..\..\..\include\config\ftconfig.h\r
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=..\..\..\include\freetype\config\ftheader.h\r
+SOURCE=..\..\..\include\config\ftheader.h\r
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=..\..\..\include\freetype\config\ftmodule.h\r
+SOURCE=..\..\..\include\config\ftmodule.h\r
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=..\..\..\include\freetype\config\ftoption.h\r
+SOURCE=..\..\..\include\config\ftoption.h\r
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=..\..\..\include\freetype\config\ftstdlib.h\r
+SOURCE=..\..\..\include\config\ftstdlib.h\r
 # End Source File\r
 # End Group\r
 # End Target\r
similarity index 95%
rename from builds/win32/visualce/freetype.vcproj
rename to builds/windows/visualce/freetype.vcproj
index 89a416a..e4cddfb 100644 (file)
@@ -87,7 +87,7 @@
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249.lib"\r
+                               OutputFile="..\..\..\objs\freetype255.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST.lib"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249ST_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255ST_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                        />\r
                        <Tool\r
                                Name="VCLibrarianTool"\r
-                               OutputFile="..\..\..\objs\freetype249MT_D.lib"\r
+                               OutputFile="..\..\..\objs\freetype255MT_D.lib"\r
                                SuppressStartupBanner="true"\r
                        />\r
                        <Tool\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftconfig.h"\r
+                               RelativePath="..\..\..\include\config\ftconfig.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftheader.h"\r
+                               RelativePath="..\..\..\include\config\ftheader.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftmodule.h"\r
+                               RelativePath="..\..\..\include\config\ftmodule.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftoption.h"\r
+                               RelativePath="..\..\..\include\config\ftoption.h"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\..\include\freetype\config\ftstdlib.h"\r
+                               RelativePath="..\..\..\include\config\ftstdlib.h"\r
                                >\r
                        </File>\r
                </Filter>\r
similarity index 80%
rename from builds/win32/visualce/index.html
rename to builds/windows/visualce/index.html
index eec6d61..68d15fd 100644 (file)
@@ -21,14 +21,14 @@ the following targets:
   <li>PPC/SP WM6 (Windows Mobile 6)</li>
 </ul>
 
-It compiles the following libraries from the FreeType 2.4.9 sources:</p>
+It compiles the following libraries from the FreeType 2.5.5 sources:</p>
 
 <ul>
   <pre>
-    freetype249.lib     - release build; single threaded
-    freetype249_D.lib   - debug build;   single threaded
-    freetype249MT.lib   - release build; multi-threaded
-    freetype249MT_D.lib - debug build;   multi-threaded</pre>
+    freetype255.lib     - release build; single threaded
+    freetype255_D.lib   - debug build;   single threaded
+    freetype255MT.lib   - release build; multi-threaded
+    freetype255MT_D.lib - debug build;   multi-threaded</pre>
 </ul>
 
 <p>Be sure to extract the files with the Windows (CR+LF) line endings.  ZIP
similarity index 88%
rename from builds/win32/w32-bcc.mk
rename to builds/windows/w32-bcc.mk
index a9f48fc..87d8ea3 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2005 by
+# Copyright 1996-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, modified,
@@ -18,7 +18,7 @@ EXPORTS_LIST      = $(OBJ_DIR)/freetype.def
 EXPORTS_OPTIONS   = /DEF:$(EXPORTS_LIST)
 APINAMES_OPTIONS := -dfreetype.dll -wB
 
-include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/windows/win32-def.mk
 include $(TOP_DIR)/builds/compiler/bcc.mk
 
 # include linking instructions
similarity index 86%
rename from builds/win32/w32-bccd.mk
rename to builds/windows/w32-bccd.mk
index 51b15d9..dd21edd 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2006 by
+# Copyright 1996-2000, 2003, 2006, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -15,7 +15,7 @@
 
 DEVEL_DIR := $(TOP_DIR)/devel
 
-include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/windows/win32-def.mk
 
 include $(TOP_DIR)/builds/compiler/bcc-dev.mk
 
similarity index 88%
rename from builds/win32/w32-dev.mk
rename to builds/windows/w32-dev.mk
index 00cacb0..3561229 100644 (file)
@@ -5,7 +5,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2006 by
+# Copyright 1996-2000, 2003, 2006, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -21,7 +21,7 @@
 
 DEVEL_DIR := $(TOP_DIR)/devel
 
-include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/windows/win32-def.mk
 
 include $(TOP_DIR)/builds/compiler/gcc-dev.mk
 
similarity index 89%
rename from builds/win32/w32-gcc.mk
rename to builds/windows/w32-gcc.mk
index 580afc5..3bbdd3c 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2005 by
+# Copyright 1996-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, modified,
@@ -19,7 +19,7 @@ EXPORTS_OPTIONS   = $(EXPORTS_LIST)
 APINAMES_OPTIONS := -dfreetype.dll -w
 
 # include Win32-specific definitions
-include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/windows/win32-def.mk
 
 # include gcc-specific definitions
 include $(TOP_DIR)/builds/compiler/gcc.mk
similarity index 89%
rename from builds/win32/w32-icc.mk
rename to builds/windows/w32-icc.mk
index 8819a1f..44d26bd 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2005 by
+# Copyright 1996-2000, 2005, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -18,7 +18,7 @@ EXPORTS_LIST      = $(OBJ_DIR)/freetype.def
 EXPORTS_OPTIONS   = /DEF:$(EXPORTS_LIST)
 APINAMES_OPTIONS := -dfreetype.dll -w
 
-include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/windows/win32-def.mk
 include $(TOP_DIR)/builds/compiler/visualage.mk
 
 # include linking instructions
similarity index 88%
rename from builds/win32/w32-intl.mk
rename to builds/windows/w32-intl.mk
index ae62e1b..0f3e22b 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2005 by
+# Copyright 1996-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, modified,
@@ -18,7 +18,7 @@ EXPORTS_LIST      = $(OBJ_DIR)/freetype.def
 EXPORTS_OPTIONS   = /DEF:$(EXPORTS_LIST)
 APINAMES_OPTIONS := -dfreetype.dll -w
 
-include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/windows/win32-def.mk
 include $(TOP_DIR)/builds/compiler/intelc.mk
 
 # include linking instructions
similarity index 87%
rename from builds/win32/w32-lcc.mk
rename to builds/windows/w32-lcc.mk
index a147c4c..8bd5b56 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000 by
+# Copyright 1996-2000, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -14,7 +14,7 @@
 
 
 SEP := /
-include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/windows/win32-def.mk
 include $(TOP_DIR)/builds/compiler/win-lcc.mk
 
 # include linking instructions
similarity index 89%
rename from builds/win32/w32-mingw32.mk
rename to builds/windows/w32-mingw32.mk
index 04e9e21..b35dbb0 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2005 by
+# Copyright 1996-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, modified,
@@ -19,7 +19,7 @@ EXPORTS_OPTIONS   = $(EXPORTS_LIST)
 APINAMES_OPTIONS := -dfreetype.dll -w
 
 # include Win32-specific definitions
-include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/windows/win32-def.mk
 
 LIBRARY := lib$(PROJECT)
 
similarity index 88%
rename from builds/win32/w32-vcc.mk
rename to builds/windows/w32-vcc.mk
index 7fb8794..95f7685 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2005 by
+# Copyright 1996-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, modified,
@@ -18,7 +18,7 @@ EXPORTS_LIST      = $(OBJ_DIR)/freetype.def
 EXPORTS_OPTIONS   = /DEF:$(EXPORTS_LIST)
 APINAMES_OPTIONS := -dfreetype.dll -w
 
-include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/windows/win32-def.mk
 include $(TOP_DIR)/builds/compiler/visualc.mk
 
 # include linking instructions
similarity index 88%
rename from builds/win32/w32-wat.mk
rename to builds/windows/w32-wat.mk
index 820b817..e1ddf66 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2005 by
+# Copyright 1996-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, modified,
@@ -18,7 +18,7 @@ EXPORTS_LIST      = $(OBJ_DIR)/watcom-ftexports.lbc
 EXPORTS_OPTIONS   = -\"export @$(EXPORTS_LIST)\"-
 APINAMES_OPTIONS := -wW
 
-include $(TOP_DIR)/builds/win32/win32-def.mk
+include $(TOP_DIR)/builds/windows/win32-def.mk
 include $(TOP_DIR)/builds/compiler/watcom.mk
 
 # include linking instructions
similarity index 89%
rename from builds/win32/win32-def.mk
rename to builds/windows/win32-def.mk
index e6ae31c..61af5df 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2003, 2005, 2006 by
+# Copyright 1996-2000, 2003, 2005, 2006, 2013, 2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -16,8 +16,8 @@
 DELETE    := del
 CAT       := type
 SEP       := $(strip \ )
-BUILD_DIR := $(TOP_DIR)/builds/win32
-PLATFORM  := win32
+BUILD_DIR := $(TOP_DIR)/builds/windows
+PLATFORM  := windows
 
 # The executable file extension (for tools). NOTE: WE INCLUDE THE DOT HERE !!
 #
index 55a24fd..4d8a945 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #!/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,
 
 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
-  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
 
-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
@@ -120,6 +130,6 @@ case $# in
      esac
    done ;;
 esac
-CFG=$CFG $GNUMAKE setup unix
+CFG=$CFG $MAKE setup unix
 
 # eof
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644 (file)
index 13476fd..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-freetype (2.4.9-slp2+1) unstable; urgency=low
-
-  * FT2 version upgrade from 2.4.3 to 2.4.9
-  * Git: 165.213.180.234:/slp/unmodified/freetype
-  * Tag: freetype_2.4.9-slp2+1
- -- Deokjin Kim <deokjin81.kim@samsung.com>  Wed, 30 May 2012 15:18:41 +0900
-
-freetype (2.4.3-6slp2+1) unstable; urgency=low
-
-  * Fix text display bug in m.etnews.com
-  * Git: 165.213.180.234:/slp/unmodified/freetype
-  * Tag: freetype_2.4.3-6slp2+1
-
- -- Deokjin Kim <deokjin81.kim@samsung.com>  Thu, 20 Oct 2011 16:17:50 +0900
-
-freetype (2.4.3-5slp4) unstable; urgency=low
-
-  * Packag Rollback
-  * Git: 165.213.180.234:/slp/unmodified/freetype
-  * Tag: freetype_2.4.3-5slp4
-
- -- WooHyun Jung <wh0705.jung@samsung.com>  Mon, 11 Apr 2011 12:16:22 +0900
-
-freetype (2.4.3-5slp3) unstable; urgency=low
-
-  * Rollback pkgs
-  * Git: 165.213.180.234:/slp/unmodified/freetype
-  * Tag: freetype_2.4.3-5slp3
-
- -- WooHyun Jung <wh0705.jung@samsung.com>  Mon, 11 Apr 2011 11:56:46 +0900
-
-freetype (2.4.3-5slp2) unstable; urgency=low
-
-  * Removed unused modules
-  * Git: 165.213.180.234:slp/unmodified/freetype
-  * Tag: freetype_2.4.3-5slp2
-
- -- Deokjin Kim <deokjin81.kim@samsung.com>  Tue, 05 Apr 2011 10:51:07 +0900
-
-freetype (2.4.3-4slp2) unstable; urgency=low
-
-  * Rollback removing API
-  * Git: 165.213.180.234:slp/unmodified/freetype
-  * Tag: freetype_2.4.3-4slp2
-
- -- Deokjin Kim <deokjin81.kim@samsung.com>  Wed, 02 Mar 2011 14:11:53 +0900
-
-freetype (2.4.3-3slp2) unstable; urgency=low
-
-  * Reduce amount of memory usage
-  * Git: 165.213.180.234:slp/unmodified/freetype
-  * Tag: freetype_2.4.3-3slp2
-
- -- Deokjin Kim <deokjin81.kim@samsung.com>  Fri, 18 Feb 2011 11:14:20 +0900
-
-freetype (2.4.3-2slp2) unstable; urgency=low
-
-  * Add debug package
-  * Git: 165.213.180.234:/git/slp/unmodified/freetype
-  * Tag: freetype_2.4.3-2slp2
-
- -- Deokjin Kim <deokjin81.kim@samsung.com>  Thu, 18 Nov 2010 14:58:43 +0900
-
-freetype (2.4.3-1slp2) unstable; urgency=low
-
-  * Freetype version upgrade (from 2.3.5 to 2.4.3)
-  * Git: 165.213.180.234:/git/slp/unmodified/freetype
-  * Tag: freetype_2.4.3-1slp2
-
- -- Deokjin Kim <deokjin81.kim@samsung.com>  Tue, 09 Nov 2010 16:54:10 +0900
-
-freetype (2.3.5-5slp2) unstable; urgency=low
-
-  * Change maintainer
-
- -- Jihoon Kim <jihoon48.kim@samsung.com>  Tue, 20 Apr 2010 11:06:10 +0900
-
-freetype (2.3.5-4slp2) unstable; urgency=low
-
-  * Change revision
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Thu, 25 Mar 2010 19:34:16 +0900
-
-freetype (2.3.5-3) unstable; urgency=low
-
-  [ Kyu Young Kim ]
-  * modify debian files
-
-  [ root ]
-  * -
-
- -- root <root@input-desktop>  Thu, 25 Mar 2010 19:34:13 +0900
-
-freetype (2.3.5-2) unstable; urgency=low
-
-  * install modify
-
- -- Kyu Young Kim <ky0928.kim@samsung.com>  Thu, 12 Nov 2009 15:45:39 +0900
-
-freetype (2.3.5) unstable; urgency=low
-
-  * Initial Release.
-
- -- Kyu Young Kim <ky0928.kim@samsung.com>  Thu, 12 Nov 2009 13:27:46 +0900
diff --git a/debian/compat b/debian/compat
deleted file mode 100644 (file)
index 7ed6ff8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/control b/debian/control
deleted file mode 100644 (file)
index f14499e..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-Source: freetype
-Section: libs
-Priority: optional
-Uploaders: Deokjin Kim <deokjin81.kim@samsung.com>
-Maintainer: Deokjin Kim <deokjin81.kim@samsung.com>, Inpyo Kang <mantiger@samsung.com> 
-Build-Depends: debhelper (>= 5), autotools-dev
-Standards-Version: 3.7.2
-
-Package: libfreetype6
-Architecture: any
-Section: libs
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Conflicts: freetype, xpdf-reader (<< 1.00-4)
-Description: FreeType 2 font engine, shared library files
- The FreeType project is a team of volunteers who develop free,
- portable and high-quality software solutions for digital typography.
- They specifically target embedded systems and focus on bringing small,
- efficient and ubiquitous products.
- .
- The FreeType 2 library is their new software font engine.  It has been
- designed to provide the following important features:
-  * A universal and simple API to manage font files
-  * Support for several font formats through loadable modules
-  * High-quality anti-aliasing
-  * High portability & performance
- .
- Supported font formats include:
-  * TrueType files (.ttf) and collections (.ttc)
-  * Type 1 font files both in ASCII (.pfa) or binary (.pfb) format
-  * Type 1 Multiple Master fonts.  The FreeType 2 API also provides
-    routines to manage design instances easily
-  * Type 1 CID-keyed fonts
-  * OpenType/CFF (.otf) fonts
-  * CFF/Type 2 fonts
-  * Adobe CEF fonts (.cef), used to embed fonts in SVG documents with
-    the Adobe SVG viewer plugin.
-  * Windows FNT/FON bitmap fonts
-
-Package: libfreetype6-dev
-Architecture: any
-Section: libdevel
-Depends: libfreetype6 (= ${binary:Version}), libc6-dev | libc-dev, zlib1g-dev | libz-dev
-Conflicts: freetype0-dev, freetype1 (<= 1.0.0.1998-03-22-1), freetype1-dev
-Replaces: freetype0-dev, freetype1-dev
-Description: FreeType 2 font engine, development files
- The FreeType project is a team of volunteers who develop free,
- portable and high-quality software solutions for digital typography.
- They specifically target embedded systems and focus on bringing small,
- efficient and ubiquitous products.
- .
- This package contains all supplementary files (static library, headers
- and documentation) you need to develop your own programs using the
- FreeType 2 library.
-
-Package: libfreetype6-dbg
-Section: debug
-Priority: extra
-Architecture: any
-Depends: ${misc:Depends},
-         libfreetype6 (= ${binary:Version})
-Conflicts: libfreetype6-dbg 
-Replaces: libfreetype6-dbg 
-Description: FreeType 2 font engine, debugging symbols
- The FreeType project is a team of volunteers who develop free,
- portable and high-quality software solutions for digital typography.
- They specifically target embedded systems and focus on bringing small,
- efficient and ubiquitous products.
- .
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644 (file)
index 761470d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-This is libfreetype6, written and maintained by Se Mun Lee <semun.lee@samsung.com>
-on Fri, 13 Nov 2009 14:08:22 +0900.
-
-The original source can always be found at:
-       ftp://slp.samsung.net/dists/unstable/main/source/
-
-Copyright Holder: Se Mun Lee
-
-License:
-       samsung
-
-/*
- * SLP2.0
- * Copyright (c) 2008 Samsung Electronics, Inc.
- * All rights reserved.
- *
- * This software is a confidential and proprietary information
- * of Samsung Electronics, Inc. ("Confidential Information").  You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Samsung Electronics. 
- */
diff --git a/debian/dirs b/debian/dirs
deleted file mode 100644 (file)
index ca882bb..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/bin
-usr/sbin
diff --git a/debian/docs b/debian/docs
deleted file mode 100644 (file)
index cb7384d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-README
-README.git
-ChangeLog.20
-ChangeLog.21
-ChangeLog.22
-ChangeLog.23
diff --git a/debian/libfreetype6-dev.install.in b/debian/libfreetype6-dev.install.in
deleted file mode 100644 (file)
index fa49e27..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-@PREFIX@/bin/freetype-config
-@PREFIX@/include/
-@PREFIX@/lib/*.so
-@PREFIX@/lib/*.la
-@PREFIX@/lib/*.a
-@PREFIX@/lib/pkgconfig/
-@PREFIX@/share/aclocal/
diff --git a/debian/libfreetype6.install.in b/debian/libfreetype6.install.in
deleted file mode 100644 (file)
index a7c24c5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-@PREFIX@/lib/*.so.*
diff --git a/debian/rules b/debian/rules
deleted file mode 100755 (executable)
index c88e6cc..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-
-# These are used for cross-compiling and for saving the configure script
-# from having to guess our platform (since we know it already)
-DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-
-CFLAGS ?= -Wall -g
-LDFLAGS ?= 
-PREFIX ?= /usr
-DATADIR ?= /opt
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0
-else
-       CFLAGS += -O2
-endif
-
-LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
-
-config.status: configure
-       dh_testdir
-       # Add here commands to configure the package.
-       CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --prefix=$(PREFIX) 
-
-build: build-stamp
-
-build-stamp:  config.status
-       dh_testdir
-
-       # Add here commands to compile the package.
-       $(MAKE)
-       #docbook-to-man debian/ncurses.sgml > ncurses.1
-
-       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
-               cat $$f > $${f%.in}; \
-               sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
-               sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
-       done
-
-       touch $@
-
-clean:
-       dh_testdir
-       dh_testroot
-       rm -f build-stamp 
-
-       # Add here commands to clean up after the build process.
-       -$(MAKE) distclean
-ifneq "$(wildcard /usr/share/misc/config.sub)" ""
-       cp -f /usr/share/misc/config.sub config.sub
-endif
-ifneq "$(wildcard /usr/share/misc/config.guess)" ""
-       cp -f /usr/share/misc/config.guess config.guess
-endif
-
-       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
-               rm -f $${f%.in}; \
-       done
-
-       dh_clean 
-
-install: build
-       dh_testdir
-       dh_testroot
-       dh_clean -k 
-       dh_installdirs
-
-       # Add here commands to install the package into debian/ncurses.
-       $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
-       dh_testdir
-       dh_testroot
-       dh_installchangelogs 
-       dh_installdocs
-       dh_installexamples
-       dh_install --sourcedir=debian/tmp
-#      dh_installmenu
-#      dh_installdebconf       
-#      dh_installlogrotate
-#      dh_installemacsen
-#      dh_installpam
-#      dh_installmime
-#      dh_python
-#      dh_installinit
-#      dh_installcron
-#      dh_installinfo
-       dh_installman
-       dh_link
-       dh_strip --dbg-package=libfreetype6-dbg
-       dh_compress
-       dh_fixperms
-#      dh_perl
-       dh_makeshlibs
-       dh_installdeb
-       dh_shlibdeps
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install 
index c1d38c3..6cc34b7 100644 (file)
@@ -2,10 +2,9 @@
 /*                                                                         */
 /*  ft2build.h                                                             */
 /*                                                                         */
-/*    FreeType 2 build and setup macros.                                   */
-/*    (Generic version)                                                    */
+/*    FreeType 2 build and setup macros (development version).             */
 /*                                                                         */
-/*  Copyright 1996-2001, 2003, 2006 by                                     */
+/*  Copyright 1996-2001, 2003, 2006, 2013 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 
  /*
-  *  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.
+  *  This is a development version of <ft2build.h> to build the library in
+  *  debug mode.  Its only difference to the default version is that it
+  *  includes a local `ftoption.h' header file with different settings for
+  *  many configuration macros.
+  *
+  *  To use it, simply ensure that the directory containing this file is
+  *  scanned by the compiler before the default FreeType header directory.
   *
-  *  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 __FT2_BUILD_DEVEL_H__
-#define __FT2_BUILD_DEVEL_H__
+#ifndef __FT2BUILD_H__
+#define __FT2BUILD_H__
 
-#define  FT_CONFIG_OPTIONS_H   <ftoption.h>
+#define FT_CONFIG_OPTIONS_H  <ftoption.h>
 
-#include <freetype/config/ftheader.h>
+#include <config/ftheader.h>
 
-#endif /* __FT2_BUILD_DEVEL_H__ */
+#endif /* __FT2BUILD_H__ */
 
 
 /* END */
index 4da0221..10027bb 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    User-selectable configuration macros (specification only).           */
 /*                                                                         */
-/*  Copyright 1996-2011 by                                                 */
+/*  Copyright 1996-2014 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -38,9 +38,9 @@ FT_BEGIN_HEADER
   /*    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.                                   */
+  /*    precisely in `$BUILD/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  */
@@ -51,7 +51,7 @@ FT_BEGIN_HEADER
   /*    locate this file during the build.  For example,                   */
   /*                                                                       */
   /*      #define FT_CONFIG_OPTIONS_H  <myftoptions.h>                     */
-  /*      #include <freetype/config/ftheader.h>                            */
+  /*      #include <config/ftheader.h>                                     */
   /*                                                                       */
   /*    will use `$BUILD/myftoptions.h' instead of this file for macro     */
   /*    definitions.                                                       */
@@ -59,9 +59,9 @@ FT_BEGIN_HEADER
   /*    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>.                */
+  /*    default, this file is <config/ftmodule.h>.                         */
   /*                                                                       */
-  /*  We highly recommend using the third method whenever possible.        */
+  /* We highly recommend using the third method whenever possible.         */
   /*                                                                       */
   /*************************************************************************/
 
@@ -205,6 +205,33 @@ FT_BEGIN_HEADER
 
   /*************************************************************************/
   /*                                                                       */
+  /* 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
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* HarfBuzz support.                                                     */
+  /*                                                                       */
+  /*   FreeType uses the HarfBuzz library to improve auto-hinting of       */
+  /*   OpenType fonts.  If available, many glyphs not directly addressable */
+  /*   by a font's character map will be hinted also.                      */
+  /*                                                                       */
+  /*   Define this macro if you want to enable this `feature'.             */
+  /*                                                                       */
+#define FT_CONFIG_OPTION_USE_HARFBUZZ
+
+
+  /*************************************************************************/
+  /*                                                                       */
   /* 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     */
@@ -514,7 +541,7 @@ FT_BEGIN_HEADER
   /* does not contain any glyph name though.                               */
   /*                                                                       */
   /* Accessing SFNT names is done through the functions declared in        */
-  /* `freetype/ftsnames.h'.                                                */
+  /* `ftsnames.h'.                                                         */
   /*                                                                       */
 #define TT_CONFIG_OPTION_SFNT_NAMES
 
@@ -560,6 +587,28 @@ FT_BEGIN_HEADER
 
   /*************************************************************************/
   /*                                                                       */
+  /* 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  */
   /* of the TrueType bytecode interpreter is used that doesn't implement   */
   /* any of the patented opcodes and algorithms.  The patents related to   */
@@ -669,7 +718,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.                                                             */
   /*                                                                       */
@@ -716,6 +765,49 @@ FT_BEGIN_HEADER
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
+  /****         C F F   D R I V E R    C O N F I G U R A T I O N        ****/
+  /****                                                                 ****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* Using CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4} it is      */
+  /* possible to set up the default values of the four control points that */
+  /* define the stem darkening behaviour of the (new) CFF engine.  For     */
+  /* more details please read the documentation of the                     */
+  /* `darkening-parameters' property of the cff driver module (file        */
+  /* `ftcffdrv.h'), which allows the control at run-time.                  */
+  /*                                                                       */
+  /* Do *not* undefine these macros!                                       */
+  /*                                                                       */
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1   500
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1   400
+
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2  1000
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2   275
+
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3  1667
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3   275
+
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4  2333
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4     0
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* 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
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /****                                                                 ****/
   /****    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     ****/
   /****                                                                 ****/
   /*************************************************************************/
@@ -752,37 +844,10 @@ FT_BEGIN_HEADER
 
 
   /*
-   * 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 */
 
 
   /*
@@ -796,6 +861,35 @@ FT_BEGIN_HEADER
 #define  TT_USE_BYTECODE_INTERPRETER
 #endif
 
+
+  /*
+   * Check CFF darkening parameters.  The checks are the same as in function
+   * `cff_property_set' in file `cffdrivr.c'.
+   */
+#if CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 < 0   || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 < 0   || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 < 0   || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 < 0   || \
+                                                      \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 < 0   || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 < 0   || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 < 0   || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 < 0   || \
+                                                      \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 >        \
+      CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2     || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 >        \
+      CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3     || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 >        \
+      CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4     || \
+                                                      \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 > 500 || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 > 500 || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 > 500 || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 > 500
+#error "Invalid CFF darkening parameters!"
+#endif
+
 FT_END_HEADER
 
 
index ae57932..bbc3110 100644 (file)
@@ -1,4 +1,534 @@
 
+CHANGES BETWEEN 2.5.4 and 2.5.5
+
+  I. IMPORTANT BUG FIXES
+
+    - Handling of  uncompressed PCF files works again (bug  introduced
+      in version 2.5.4).
+
+
+======================================================================
+
+CHANGES BETWEEN 2.5.3 and 2.5.4
+
+  I. IMPORTANT BUG FIXES
+
+    - A   variant  of   vulnerability  CVE-2014-2240   was  identified
+      (cf.  http://savannah.nongnu.org/bugs/?43661) and  fixed in  the
+      new CFF driver.  All users should upgrade.
+
+    - The new auto-hinter code using HarfBuzz crashed for some invalid
+      fonts.
+
+    - Many fixes to better protect against malformed input.
+
+
+  II. IMPORTANT CHANGES
+
+    - Full auto-hinter support of the Devanagari script.
+
+    - Experimental auto-hinter support of the Telugu script.
+
+    - CFF stem darkening behaviour can now be controlled at build time
+      using the eight macros
+
+        CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4}    .
+
+    - Some fields in the `FT_Bitmap'  structure have been changed from
+      signed to unsigned type, which better reflects the actual usage.
+      It  is also  an additional  means to  protect against  malformed
+      input.
+
+      This  change doesn't  break  the ABI;  however,  it might  cause
+      compiler warnings.
+
+
+  III. MISCELLANEOUS
+
+    - Improvements to  the auto-hinter's algorithm to  recognize stems
+      and local extrema.
+
+    - Function `FT_Get_SubGlyph_Info' always returned an error even in
+      case of success.
+
+    - Version  2.5.1 introduced  major bugs  in  the cjk  part of  the
+      auto-hinter, which are now fixed.
+
+    - The  `FT_Sfnt_Tag'  enumeration  values  have  been  changed  to
+      uppercase,  e.g.  `FT_SFNT_HEAD'.   The lowercase  variants  are
+      deprecated.    This  is   for  orthogonality   with  all   other
+      enumeration (and enumeration-like) values in FreeType.
+
+    - `cmake' now supports builds of FreeType as an OS X framework and
+      for iOS.
+
+    - Improved project files for vc2010, introducing a property file.
+
+    - The  documentation generator  for  the API  reference  has  been
+      updated to produce  better HTML code (with proper  CSS).  At the
+      same time, the documentation got a better structure.
+
+    - The FT_LOAD_BITMAP_CROP flag is obsolete;  it is not used by any
+      driver.
+
+    - The  TrueType  DELTAP[123]  bytecode instructions  now  work  in
+      subpixel hinting  mode as described in  the ClearType whitepaper
+      (i.e., for touched points in the non-subpixel direction).
+
+    - Many small improvements to the internal arithmetic routines.
+
+
+======================================================================
+
+CHANGES BETWEEN 2.5.2 and 2.5.3
+
+  I. IMPORTANT BUG FIXES
+
+    - A vulnerability (CVE-2014-2240) was  identified and fixed in the
+      new  CFF  driver  (cf.  http://savannah.nongnu.org/bugs/?41697).
+      All users should upgrade.
+
+    - More  bug  fixes related  to  correct  positioning of  composite
+      glyphs.
+
+    - Many fixes to better protect against malformed input.
+
+
+  II. IMPORTANT CHANGES
+
+    - FreeType can now use the HarfBuzz library to greatly improve the
+      auto-hinting of  fonts that  use OpenType features:  Many glyphs
+      that are part  of such features but don't have  cmap entries are
+      now handled  properly, for  example small caps  or superscripts.
+      Define the configuration  macro FT_CONFIG_OPTION_USE_HARFBUZZ to
+      activate HarfBuzz support.
+
+      You need HarfBuzz version 0.9.19 or newer.
+
+      Note that HarfBuzz depends on  FreeType; this currently causes a
+      chicken-and-egg problem  that can be  solved as follows  in case
+      HarfBuzz is not yet installed on your system.
+
+        1. Compile  and  install  FreeType without  the  configuration
+           macro FT_CONFIG_OPTION_USE_HARFBUZZ.
+
+        2. Compile and install HarfBuzz.
+
+        3. Define  macro  FT_CONFIG_OPTION_USE_HARFBUZZ, then  compile
+           and install FreeType again.
+
+      With FreeType's  `configure' script the procedure  boils down to
+      configure, build, and install Freetype, then configure, compile,
+      and  install  HarfBuzz,  then configure,  compile,  and  install
+      FreeType again (after executing `make distclean').
+
+    - All  libraries FreeType  depends on  are now  checked using  the
+      `pkg-config' configuration files  first, followed by alternative
+      methods.
+
+    - The  new  value  `auto'  for the  various  `--with-XXX'  library
+      options   (for   example   `--with-harfbuzz=auto')   makes   the
+      `configure' script automatically link to the libraries it finds.
+      This is now the default.
+
+    - In case FreeType's `configure' script  can't find a library, you
+      can  pass environment  variables to  circumvent pkg-config,  and
+      those variables  have been  harmonized as  a consequence  of the
+      changes mentioned above:
+
+        LIBZ           -> removed; use LIBZ_CFLAGS and LIBZ_LIBS
+        LIBBZ2         -> removed; use BZIP2_CFLAGS and BZIP2_LIBS
+        LIBPNG_LDFLAGS -> LIBPNG_LIBS
+
+      `./configure --help' shows all available environment variables.
+
+    - The `freetype-config'  script now understands  option `--static'
+      to emit static linking information.
+
+
+======================================================================
+
+CHANGES BETWEEN 2.5.1 and 2.5.2
+
+  I. IMPORTANT BUG FIXES
+
+    - Improving the display of some broken TrueType fonts introduced a
+      bug  that made  FreeType crash  on some  popular (but  not fully
+      conformant) fonts like `ahronbd.ttf'.
+
+    - Another round of improvements to correct positioning and hinting
+      of composite glyphs in TrueType fonts.
+
+
+  II. MISCELLANEOUS
+
+    - Version  2.5.1  introduced a  bug  in  handling embedded  bitmap
+      strikes of  TrueType fonts,  causing garbage display  under some
+      circumstances.
+
+    - The   `ftgrid'   demo   program    couldn't   be   compiled   in
+      non-development builds.
+
+
+======================================================================
+
+CHANGES BETWEEN 2.5 and 2.5.1
+
+  I. IMPORTANT BUG FIXES
+
+    - For  some WinFNT  files,  the last  glyph  wasn't displayed  but
+      incorrectly marked as invalid.
+
+    - The vertical size of glyphs was  incorrectly set after a call to
+      `FT_GlyphSlot_Embolden', resulting in clipped glyphs.
+
+    - Many fields of the `PCLT' table in SFNT based fonts (if accessed
+      with `FT_Get_Sfnt_Table') were computed incorrectly.
+
+    - In TrueType fonts,  hinting of composite glyphs  could sometimes
+      deliver  incorrect positions  of  components or  even  distorted
+      shapes.
+
+
+  II. IMPORTANT CHANGES
+
+    - WOFF font format support has been added.
+
+    - The auto-hinter now supports Hebrew.  Greek and Cyrillic support
+      has been improved.
+
+    - Support for the forthcoming `OS/2'  SFNT table version 5, as can
+      be found e.g. in the `Sitka' font family for Windows 8.1.
+
+    - The header  file layout  has been changed.   After installation,
+      all files are now located in `<prefix>/include/freetype2'.
+
+      Applications  that  use   (a)  `freetype-config'  or  FreeType's
+      `pkg-config' file to get the include directory for the compiler,
+      and (b) the documented way for header inclusion like
+
+        #include <ft2build.h>
+        #include FT_FREETYPE_H
+        ...
+
+      don't need any change to the source code.
+
+
+  III. MISCELLANEOUS
+
+    - The stem  darkening feature  of the  new CFF  engine can  now be
+      fine-tuned with the new `darkening-parameters' property.
+
+    - `ftgrid' has been updated to toggle various engines with the `H'
+      key, similar to `ftview' and `ftdiff'.
+
+    - The functionality of `ttdebug' has been greatly enhanced.
+
+      . It now displays twilight, storage, and control value data; key
+        `T' shows the twilight point  table, key `S' the storage data,
+        and key `C' the control value table.
+
+      . Some  keys  have  been  reassigned  from  lowercase  to  their
+        uppercase equivalents; for example `q'  to quit the program is
+        now `Q'.
+
+      . Key `f' finishes the current function.
+
+      . Key `R' restarts the debugger.
+
+      . Keys `b' and `p' set a breakpoint.
+
+      . Key `B' provides a function call backtrace.
+
+    - Better support of ARMv7 and x86_64 processors.
+
+    - Apple's `sbix' color bitmap format is now supported.
+
+    - Improved   auto-hinter  rendering   for  many   TrueType  fonts,
+      especially in the range 20-40ppem.
+
+    - A  new face  flag  `FT_FACE_FLAG_COLOR' has  been  added (to  be
+      accessed with the macro `FT_HAS_COLOR').
+
+    - `FT_Gzip_Uncompress'   (modeled    after   zlib's   `uncompress'
+      function)  has been  added; this  is a  by-product of  the newly
+      added WOFF support.
+
+    - Support for  a build with  `cmake' has been contributed  by John
+      Cary <cary@txcorp.com>.
+
+    - Support for x64  builds with Visual C++ has  been contributed by
+      Kenneth Miller <kennethadammiller@yahoo.com>
+
+    - Manual pages for most demo programs have been added.
+
+    - The GETINFO bytecode instruction for TrueType fonts was buggy if
+      used to retrieve subpixel hinting information.  It was necessary
+      to set  selector bit 6  to get  results for selector  bits 7-10,
+      which is wrong.
+
+    - Improved computation  of emulated vertical metrics  for TrueType
+      fonts.
+
+    - Fixed horizontal start-up position of vertical phantom points in
+      TrueType bytecode.
+
+
+======================================================================
+
+CHANGES BETWEEN 2.4.12 and 2.5
+
+  I. IMPORTANT BUG FIXES
+
+    - The cache manager function `FTC_Manager_Reset'  didn't flush the
+      cache.
+
+
+  II. IMPORTANT CHANGES
+
+    - Behdad Esfahbod  (on behalf  of Google) contributed  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.
+
+    - As  announced in  the  previous release,  the  old FreeType  CFF
+      engine  is now  disabled by  default.  It  can be  conditionally
+      compiled     by     defining     the     configuration     macro
+      CFF_CONFIG_OPTION_OLD_ENGINE.
+
+    - As announced in the previous release,  all code related to macro
+      FT_CONFIG_OPTION_OLD_INTERNALS  has been removed,  thus becoming
+      obsolete.
+
+
+  III. MISCELLANEOUS
+
+    - The  property API  (`FT_Property_Get' and  `FT_Property_Set') is
+      now declared as stable.
+
+      The  exception,   however,  are  the   experimental  auto-hinter
+      properties `glyph-to-script-map' and `fallback-script' which are
+      subject to change in a forthcoming release.
+
+    - `ftview' has been updated to  support color embedded bitmaps; it
+      can be toggled on and off  with key `c'.  The small cache toggle
+      is now key `K'.
+
+    - It  is now  possible  to  control the  version  of the  TrueType
+      hinting engine  using the new `interpreter-version'  property of
+      the  `truetype' module:  Versions 35  and 38  (the default)  are
+      supported,  which  roughly  corresponds to  disable  and  enable
+      subpixel hinting support, respectively.
+
+      In  both  `ftview'  and  `ftdiff',  switching  between  the  two
+      versions  can be  done  with  key `H'.   In  the `ftbench'  demo
+      program, command line option `-H'  has been extended to activate
+      the non-default interpreter version.
+
+    - The `ttdebug' program has been further improved.  In particular,
+      it accepts a new command line  option `-H' to select the hinting
+      engine.
+
+    - `ftdump's verbose option has been renamed to `-V'.  For all demo
+      programs, `-v' now shows version information.
+
+    - Another round of TrueType subpixel hinting fixes.
+
+    - The `apinames' tool can now create an import file for NetWare.
+
+    - 64bit compilation of the new CFF engine was buggy.
+
+    - Some fixes to improve robustness in memory-tight situations.
+
+
+======================================================================
+
+CHANGES BETWEEN 2.4.11 and 2.4.12
+
+    - We have another CFF parsing and hinting engine!  Written by Dave
+      Arnold <darnold@adobe.com>,  this work  has been  contributed by
+      Adobe in  collaboration with Google.   It is vastly  superior to
+      the old CFF engine, and it  will replace it in the next release.
+      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:
+
+        ...
+        #include FT_MODULE_H
+        #include FT_CFF_DRIVER_H
+
+        FT_Library  library;
+        int         engine = FT_CFF_HINTING_ADOBE;
+
+
+        ...
+        FT_Property_Set( library, "cff", "hinting-engine", &engine );
+
+      The code has  a (mature) beta status; we encourage  all users to
+      test it and report any problems.
+
+      In case you want to activate the new CFF engine unconditionally,
+      apply this patch:
+
+--- snip ---
+diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
+index ebcf189..3f2ce6b 100644
+--- a/src/cff/cffobjs.c
++++ b/src/cff/cffobjs.c
+@@ -1056,7 +1056,7 @@
+
+
+     /* set default property values */
+-    driver->hinting_engine    = FT_CFF_HINTING_FREETYPE;
++    driver->hinting_engine    = FT_CFF_HINTING_ADOBE;
+     driver->no_stem_darkening = FALSE;
+
+     return FT_Err_Ok;
+--- snip ---
+
+    - The  macro FT_CONFIG_OPTION_OLD_INTERNALS  is no  longer set  by
+      default.  In  the next  release, we  will completely  remove the
+      associated code.   Please update your  programs in case  you are
+      still using this macro.
+
+
+  II. MISCELLANEOUS
+
+    - The  (top-level)  `configure'  script   now  respects  the  MAKE
+      environment variable to specify a `make' binary.   For backwards
+      compatibility, GNUMAKE still overrides MAKE, though.
+
+    - The `ftview'  and `ftdiff'  demo programs have  been redesigned,
+      showing  more options  permanently  on the  screen, among  other
+      minor improvements.
+
+    - Using the `H'  key, it is now possible to  select the CFF engine
+      in both `ftview' and `ftdiff'.
+
+    - The new command line option `-H' for `ftbench' selects the Adobe
+      CFF engine.
+
+    - It is  now possible  to directly select  the LCD  rendering mode
+      with the keys `A'-`F' in  `ftview'.  The key mapping for cycling
+      through LCD modes  has been changed from `K' and  `L' to `k' and
+      `l', and  toggling custom LCD  filtering is no longer  mapped to
+      key `F' but to key `L'.
+
+    - In `ftdiff',  key `x' toggles  between layout modes:  Either use
+      the  advance width  (this is  new and  now the  default) or  the
+      bounding box information to determine line breaks.
+
+    - For all demo  tools, the new command line option  `-v' shows the
+      version.
+
+    - For the demo tools with a GUI, the new command line options `-w'
+      and `-h' select  the width and the height of  the output window,
+      respectively.
+
+    - The `ttdebug' program was broken and has been reactivated.  Note
+      that this program is not compiled by default.
+
+
+======================================================================
+
+CHANGES BETWEEN 2.4.10 and 2.4.11
+
+  I. IMPORTANT BUG FIXES
+
+    - Some vulnerabilities in the  BDF implementation have been fixed.
+      Users of this font format should upgrade.
+
+
+  II. IMPORTANT CHANGES
+
+    - Subpixel  hinting support  has been  contributed by  Infinality,
+      based on Greg Hitchcock's whitepaper at
+
+        http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
+
+      Originally, it was a separate patch available from
+
+        http://www.infinality.net/blog/
+
+      and which has been integrated.
+
+      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.
+
+      Activation of  subpixel hinting  support can be  controlled with
+      the `TT_CONFIG_OPTION_SUBPIXEL_HINTING' configuration option; it
+      is switched off by default.  This feature is still experimental;
+      we welcome test reports!
+
+    - Support for OpenType collections (OTC) has been added.
+
+    - Pure CFF fonts within an SFNT wrapper are now supported.
+
+
+  III. MISCELLANEOUS
+
+    - Minor rendering improvements to the auto-hinter.
+
+    - `FT_GlyphSlot_Oblique' now uses a shear angle of 12°.
+
+    - Experimental support  to handle `property modules',  for example
+      to control the  behaviour of the auto-hinter.   The API consists
+      of two new functions, `FT_Property_Set' and `FT_Property_Get'.
+
+      The code is  still subject to change and should  not be used for
+      production.
+
+    - The `ftdiff' demo program now supports UTF-8 encoded input files
+      for option `-f'.
+
+    - Using keys `r' and `R', you can now adjust the stroker radius in
+      the `ftview' demo program.
+
+    - Other, minor fixes and improvements.
+
+
+======================================================================
+
+CHANGES BETWEEN 2.4.9 and 2.4.10
+
+  I. IMPORTANT BUG FIXES
+
+    - Incremental glyph loading as needed by ghostscript was broken.
+
+
+  II. MISCELLANEOUS
+
+    - A new  function `FT_Outline_EmboldenXY',  contributed by  Alexei
+      Podtelezhnikov.
+
+    - In the `ftview' demo program, key `e' has been replaced with `x'
+      and `y' to  embolden in  the horizontal and  vertical direction,
+      respectively.
+
+    - The glyph  spacing computation  in `FT_GlyphSlot_Embolden'  (and
+      similar code in `ftview') has been improved.
+
+    - Minor  improvements to  the TrueType  bytecode  interpreter  and
+      glyph loader, the auto-hinter, and the B/W rasterizer.
+
+
+======================================================================
+
 CHANGES BETWEEN 2.4.8 and 2.4.9
 
   I. IMPORTANT BUG FIXES
@@ -22,7 +552,7 @@ CHANGES BETWEEN 2.4.8 and 2.4.9
     - The  demo  programs  no  longer  recognize  and  handle  default
       suffixes; you now have to always specify the complete font name.
 
-    - Better rendering and LCD mode cycling added to ftview.
+    - Better rendering and LCD mode cycling added to `ftview'.
 
 
 ======================================================================
@@ -209,7 +739,7 @@ CHANGES BETWEEN 2.4.1 and 2.4.2
       The  two  new   functions  increment  the  respective   counter.
       `FT_Done_Library' and `FT_Done_Face' then only destroy a library
       or face if the counter is 1, otherwise they simply decrement the
-      counter. 
+      counter.
 
 
 ======================================================================
@@ -2401,7 +2931,7 @@ CHANGES BETWEEN 2.0.3 and 2.0.2
       number.  see <freetype/fterrors.h> for details.
 
     - A   new  public   header   file  has   been  introduced,   named
-      FT_TRIGONOMETRY_H     (include/freetype/fttrig.h),     providing
+      FT_TRIGONOMETRY_H    (include/freetype/fttrigon.h),    providing
       trigonometric functions to  compute sines, cosines, arctangents,
       etc. with 16.16 fixed precision.  The implementation is based on
       the CORDIC  algorithm and is very fast  while being sufficiently
@@ -3629,7 +4159,7 @@ Extensions support:
 
 ------------------------------------------------------------------------
 
-Copyright 2000-2012 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,
diff --git a/docs/CMAKE b/docs/CMAKE
new file mode 100644 (file)
index 0000000..31237ae
--- /dev/null
@@ -0,0 +1,2 @@
+Support for a cmake build has been contributed.  See the remarks in the
+top-level `CMakeLists.txt' file for more.
index 7d7d474..dfadb46 100644 (file)
@@ -8,10 +8,9 @@ How to customize the compilation of the library
 
 I. Configuration macros
 
-  The  file found  in `include/freetype/config/ftoption.h'  contains a
-  list  of  commented configuration  macros  that  can  be toggled  by
-  developers  to  indicate  which  features  should  be  active  while
-  building the library.
+  The  file found  in `include/config/ftoption.h'  contains a  list of
+  commented configuration macros that can  be toggled by developers to
+  indicate which features should be active while building the library.
 
   These  options range  from debug  level to  availability  of certain
   features,   like  native   TrueType  hinting   through   a  bytecode
@@ -31,10 +30,14 @@ II. Modules list
   make  uses `modules.cfg'  to  generate `ftmodule.h'  (in the  object
   directory).
 
+  If you build FreeType in a directory separate from the source files,
+  put your  customized `modules.cfg' in  that directory; that  way you
+  can keep the source files `clean'.
+
   If  you don't  use  GNU make  you  have to  manually  edit the  file
-  `include/freetype/config/ftmodule.h'  (which is  *not* used  with if
-  compiled with GNU make) to  add or remove the drivers and components
-  you want  to compile into  the library.  See `INSTALL.ANY'  for more
+  `include/config/ftmodule.h' (which  is *not*  used with  if compiled
+  with GNU make) to add or  remove the drivers and components you want
+  to   compile  into   the  library.    See  `INSTALL.ANY'   for  more
   information.
 
 
@@ -77,11 +80,12 @@ IV. Overriding default configuration and module headers
 
     [This is actually a combination of method 2 and 3.]
 
-    Just put your custom  `ftoption.h' file into the objects directory
-    (normally  `<topdir>/objs'),  which  GNU  make  prefers  over  the
-    standard location.   No action is needed  for `ftmodule.h' because
-    it is generated automatically in the objects directory.
-
+    Just put your custom `ftoption.h'  file into the objects directory
+    (normally `<topdir>/objs' if you build  in the source tree, or the
+    directory where  you invoke configure  if you build in  a separate
+    directory), which GNU make prefers over the standard location.  No
+    action  is  needed  for   `ftmodule.h'  because  it  is  generated
+    automatically in the objects directory.
 
   2. Using the C include path
 
@@ -91,19 +95,16 @@ IV. Overriding default configuration and module headers
       #include FT_CONFIG_OPTIONS_H
       #include FT_CONFIG_MODULES_H
 
-    are      compiled.       Their      default      values      being
-    <freetype/config/ftoption.h> and <freetype/config/ftmodule.h>, you
-    can do something like:
+    are compiled.  Their default  values being <config/ftoption.h> and
+    <config/ftmodule.h>, you can do something like:
 
       custom/
-        freetype/
-          config/
-            ftoption.h    => custom options header
-            ftmodule.h    => custom modules list
+        config/
+          ftoption.h      => custom options header
+          ftmodule.h      => custom modules list
 
       include/            => normal FreeType 2 include
-        freetype/
-          ...
+        ...
 
     then change the C include path to always give the path to `custom'
     before the FreeType 2 `include'.
@@ -121,7 +122,7 @@ IV. Overriding default configuration and module headers
       #define FT_CONFIG_OPTIONS_H  <custom/my-ftoption.h>
       #define FT_CONFIG_MODULES_H  <custom/my-ftmodule.h>
 
-      #include <freetype/config/ftheader.h>
+      #include <config/ftheader.h>
 
       #endif /* __FT2_BUILD_MY_PLATFORM_H__ */
 
@@ -137,7 +138,7 @@ IV. Overriding default configuration and module headers
 
 ----------------------------------------------------------------------
 
-Copyright 2003, 2005, 2006 by
+Copyright 2003, 2005, 2006, 2012, 2013 by
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 This  file is  part of  the FreeType  project, and  may only  be used,
index 3d6acd3..d8c79d1 100644 (file)
@@ -4,63 +4,63 @@ Debugging within the FreeType sources
 I. Configuration macros
 -----------------------
 
-There  are several ways  to enable  debugging features  in a  FreeType 2
-builds.   This is controlled  through the  definition of  special macros
+There are  several ways to enable  debugging features in a  FreeType 2
+builds.  This is  controlled through the definition  of special macros
 located in the file `ftoptions.h'.  The macros are:
 
 
   FT_DEBUG_LEVEL_ERROR
 
-    #define this macro  if you want to compile  the FT_ERROR macro calls
-    to  print error messages  during program  execution.  This  will not
-    stop  the  program.   Very  useful  to  spot  invalid  fonts  during
+    #define this macro if you want to compile the FT_ERROR macro calls
+    to print error  messages during program execution.   This will not
+    stop  the  program.  Very  useful  to  spot invalid  fonts  during
     development and to code workarounds for them.
 
   FT_DEBUG_LEVEL_TRACE
 
-    #define this macro  if you want to compile  both macros FT_ERROR and
-    FT_TRACE.   This also  includes the  variants  FT_TRACE0, FT_TRACE1,
+    #define this macro if you want to compile both macros FT_ERROR and
+    FT_TRACE.  This  also includes the variants  FT_TRACE0, FT_TRACE1,
     FT_TRACE2, ..., FT_TRACE7.
 
-    The  trace  macros are  used  to  send  debugging messages  when  an
-    appropriate  `debug  level' is  configured  at  runtime through  the
+    The  trace macros  are used  to  send debugging  messages when  an
+    appropriate  `debug level'  is configured  at runtime  through the
     FT2_DEBUG environment variable (more on this later).
 
   FT_DEBUG_MEMORY
 
-    If  this macro is  #defined, the  FreeType engine  is linked  with a
-    small  but  effective  debugging  memory  manager  that  tracks  all
+    If this  macro is #defined, the  FreeType engine is linked  with a
+    small  but  effective debugging  memory  manager  that tracks  all
     allocations and frees that are performed within the font engine.
 
-    When  the  FT2_DEBUG_MEMORY   environment  variable  is  defined  at
-    runtime,  a call  to FT_Done_FreeType  will dump  memory statistics,
-    including the list of leaked memory blocks with the source locations
-    where these were allocated.  It is always a very good idea to define
-    this in development builds.  This works with _any_ program linked to
-    FreeType, but  requires a big  deal of memory (the  debugging memory
-    manager never frees the blocks to the heap in order to detect double
-    frees).
+    When  the  FT2_DEBUG_MEMORY  environment variable  is  defined  at
+    runtime, a  call to FT_Done_FreeType will  dump memory statistics,
+    including  the  list  of  leaked memory  blocks  with  the  source
+    locations where  these were allocated.   It is always a  very good
+    idea to define this in  development builds.  This works with _any_
+    program linked to FreeType, but requires a big deal of memory (the
+    debugging memory  manager never  frees the blocks  to the  heap in
+    order to detect double frees).
 
-    When FT2_DEBUG_MEMORY isn't defined at runtime, the debugging memory
-    manager is ignored, and performance is unaffected.
+    When  FT2_DEBUG_MEMORY isn't  defined  at  runtime, the  debugging
+    memory manager is ignored, and performance is unaffected.
 
 
 II. Debugging macros
 --------------------
 
-Several macros can be used within the FreeType sources to help debugging
-its code:
+Several  macros  can be  used  within  the  FreeType sources  to  help
+debugging its code:
 
 
   1. FT_ERROR(( ... ))
 
-    This macro is  used to send debug messages  that indicate relatively
-    serious  errors (like  broken font  files),  but will  not stop  the
-    execution of  the running program.   Its code is compiled  only when
-    either FT_DEBUG_LEVEL_ERROR  or FT_DEBUG_LEVEL_TRACE are  defined in
+    This macro is used to send debug messages that indicate relatively
+    serious errors  (like broken  font files), but  will not  stop the
+    execution of the running program.   Its code is compiled only when
+    either FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined in
     `ftoption.h'.
 
-    Note that you  have to use a printf-like  signature, but with double
+    Note that you have to use a printf-like signature, but with double
     parentheses, like in
 
       FT_ERROR(( "your %s is not %s\n", "foo", "bar" ));
@@ -68,128 +68,130 @@ its code:
 
   2. FT_ASSERT( condition )
 
-    This macro  is used to check  strong assertions at  runtime.  If its
-    condition isn't TRUE,  the program will abort with  a panic message.
-    Its   code   is  compiled   when   either  FT_DEBUG_LEVEL_ERROR   or
-    FT_DEBUG_LEVEL_TRACE are defined.  You don't need double parentheses
-    here.  For example
+    This macro is used to check  strong assertions at runtime.  If its
+    condition isn't TRUE, the program will abort with a panic message.
+    Its  code   is  compiled   when  either   FT_DEBUG_LEVEL_ERROR  or
+    FT_DEBUG_LEVEL_TRACE   are  defined.    You   don't  need   double
+    parentheses here.  For example
 
       FT_ASSERT( ptr != NULL );
 
 
   3. FT_TRACE( level, (message...) )
 
-    The  FT_TRACE  macro  is  used  to  send  general-purpose  debugging
-    messages during  program execution.   This macro uses  an *implicit*
-    macro named FT_COMPONENT used to name the current FreeType component
-    being run.
+    The  FT_TRACE  macro is  used  to  send general-purpose  debugging
+    messages during program execution.   This macro uses an *implicit*
+    macro  named  FT_COMPONENT  used  to  name  the  current  FreeType
+    component being run.
 
-    The developer should always  define FT_COMPONENT as appropriate, for
-    example as in
+    The developer  should always  define FT_COMPONENT  as appropriate,
+    for example as in
 
       #undef  FT_COMPONENT
       #define FT_COMPONENT  trace_io
 
-    The  value  of  the  FT_COMPONENT  macro  is  an  enumeration  named
-    trace_XXXX where XXXX  is one of the component  names defined in the
-    internal file `freetype/internal/fttrace.h'.  If you modify FreeType
-    source  and insert  new trace_XXXX macro,  you  must register  it in
-    fttrace.h. If you insert or remove many trace macros,  you can check
-    the undefined or the unused trace macro by src/tools/chktrcmp.py.
+    The  value  of the  FT_COMPONENT  macro  is an  enumeration  named
+    `trace_XXXX' where `XXXX' is one of the component names defined in
+    the internal  file `internal/fttrace.h'.   If you  modify FreeType
+    source and insert new `trace_XXXX'  macro, you must register it in
+    `fttrace.h'. If  you insert or  remove many trace macros,  you can
+    check   the    undefined   or   the   unused    trace   macro   by
+    `src/tools/chktrcmp.py'.
 
-    Each  such component  is assigned  a `debug  level', ranging  from 0
-    to  7,  through  the  use  of  the  FT2_DEBUG  environment  variable
+    Each such component is assigned a `debug level', ranging from 0 to
+    7,  through   the  use  of  the   FT2_DEBUG  environment  variable
     (described below) when a program linked with FreeType starts.
 
-    When FT_TRACE  is called, its  level is compared  to the one  of the
-    corresponding component.   Messages with trace  levels *higher* than
+    When FT_TRACE is  called, its level is compared to  the one of the
+    corresponding component.  Messages with trace levels *higher* than
     the corresponding component level are filtered and never printed.
 
-    This  means that  trace messages  with level  0 are  always printed,
-    those with level 2 are only  printed when the component level is *at
-    least* 2.
+    This means  that trace messages  with level 0 are  always printed,
+    those with  level 2 are only  printed when the component  level is
+    *at least* 2.
 
-    The  second  parameter  to  FT_TRACE must  contain  parentheses  and
+    The  second parameter  to  FT_TRACE must  contain parentheses  and
     correspond to a printf-like call, as in
 
       FT_TRACE( 2, ( "your %s is not %s\n", "foo", "bar" ) )
 
-    The shortcut macros  FT_TRACE0, FT_TRACE1, FT_TRACE2, ..., FT_TRACE7
-    can be  used with  constant level indices,  and are much  cleaner to
-    use, as in
+    The   shortcut  macros   FT_TRACE0,  FT_TRACE1,   FT_TRACE2,  ...,
+    FT_TRACE7 can  be used with  constant level indices, and  are much
+    cleaner to use, as in
 
-     FT_TRACE2(( "your %s is not %s\n", "foo", "bar" ));
+      FT_TRACE2(( "your %s is not %s\n", "foo", "bar" ));
 
 
 III. Environment variables
 --------------------------
 
-The  following  environment   variables  control  debugging  output  and
+The  following  environment  variables control  debugging  output  and
 behaviour of FreeType at runtime.
 
 
   FT2_DEBUG
 
-    This   variable  is   only  used   when  FreeType   is   built  with
-    FT_DEBUG_LEVEL_TRACE defined.  It contains a list of component level
-    definitions, following this format:
+    This  variable   is  only  used   when  FreeType  is   built  with
+    FT_DEBUG_LEVEL_TRACE  defined.  It  contains a  list of  component
+    level definitions, following this format:
 
-       component1:level1 component2:level2 component3:level3 ...
+      component1:level1 component2:level2 component3:level3 ...
 
-    where `componentX' is the name of a tracing component, as defined in
-    `fttrace.h',  but  without the  `trace_'  prefix.   `levelX' is  the
+    where `componentX' is the name  of a tracing component, as defined
+    in `fttrace.h', but without the  `trace_' prefix.  `levelX' is the
     corresponding level to use at runtime.
 
-    `any'  is a  special  component  name that  will  be interpreted  as
+    `any'  is a  special component  name that  will be  interpreted as
     `any/all components'.  For example, the following definitions
 
-       set FT2_DEBUG=any:2 memory:5 io:4        (on Windows)
-       export FT2_DEBUG="any:2 memory:5 io:4"   (on Linux with bash)
+      set FT2_DEBUG=any:2 memory:5 io:4        (on Windows)
+      export FT2_DEBUG="any:2 memory:5 io:4"   (on Linux with bash)
 
-    both stipulate that  all components should have level  2, except for
-    the memory and io components which will be set to trace levels 5 and
-    4, respectively.
+    both stipulate that all components should have level 2, except for
+    the memory and  io components which will be set  to trace levels 5
+    and 4, respectively.
 
 
   FT2_DEBUG_MEMORY
 
-    This  environment variable, when  defined, tells  FreeType to  use a
-    debugging memory  manager that will  track leaking memory  blocks as
-    well as other  common errors like double frees.   It is also capable
-    of  reporting  _where_  the  leaking blocks  were  allocated,  which
-    considerably saves time when debugging new additions to the library.
+    This environment variable,  when defined, tells FreeType  to use a
+    debugging memory manager that will  track leaking memory blocks as
+    well as other common errors like double frees.  It is also capable
+    of  reporting _where_  the  leaking blocks  were allocated,  which
+    considerably  saves  time  when  debugging new  additions  to  the
+    library.
 
-    This  code  is  only  compiled  when  FreeType  is  built  with  the
-    FT_DEBUG_MEMORY macro  #defined in  `ftoption.h' though, it  will be
+    This  code  is only  compiled  when  FreeType  is built  with  the
+    FT_DEBUG_MEMORY macro #defined in  `ftoption.h' though, it will be
     ignored in other builds.
 
 
   FT2_ALLOC_TOTAL_MAX
 
-    This  variable is ignored  if FT2_DEBUG_MEMORY  is not  defined.  It
-    allows you to specify a maximum heap size for all memory allocations
-    performed by FreeType.   This is very useful to  test the robustness
-    of  the  font  engine and  programs  that  use  it in  tight  memory
-    conditions.
+    This variable is  ignored if FT2_DEBUG_MEMORY is  not defined.  It
+    allows  you  to  specify  a  maximum  heap  size  for  all  memory
+    allocations performed  by FreeType.  This  is very useful  to test
+    the robustness  of the  font engine  and programs  that use  it in
+    tight memory conditions.
 
-    If it is  undefined, or if its value is  not strictly positive, then
+    If it is undefined, or if its value is not strictly positive, then
     no allocation bounds are checked at runtime.
 
 
   FT2_ALLOC_COUNT_MAX
 
-    This  variable is ignored  if FT2_DEBUG_MEMORY  is not  defined.  It
-    allows  you  to  specify  a  maximum number  of  memory  allocations
-    performed    by     FreeType    before    returning     the    error
-    FT_Err_Out_Of_Memory.  This is useful  for debugging and testing the
-    engine's robustness.
+    This variable is  ignored if FT2_DEBUG_MEMORY is  not defined.  It
+    allows  you to  specify  a maximum  number  of memory  allocations
+    performed    by    FreeType    before    returning    the    error
+    FT_Err_Out_Of_Memory.  This  is useful  for debugging  and testing
+    the engine's robustness.
 
-    If it is  undefined, or if its value is  not strictly positive, then
+    If it is undefined, or if its value is not strictly positive, then
     no allocation bounds are checked at runtime.
 
 ------------------------------------------------------------------------
 
-Copyright 2002, 2003, 2004, 2005, 2009 by
+Copyright 2002-2005, 2009, 2013 by
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 This  file is  part  of the  FreeType  project, and  may  only be  used,
index fc699a8..456b76d 100644 (file)
@@ -43,7 +43,12 @@ I. Normal installation and upgrades
     directory, where <system> stands for your OS or environment.
 
 
-  5. From you own IDE, or own Makefiles
+  5. Using cmake
+
+    See the top-level `CMakeLists.txt' file for more information.
+
+
+  6. From you own IDE, or own Makefiles
 
     If  you  want  to  create   your  own  project  file,  follow  the
     instructions   given  in  the   `INSTALL.ANY'  document   of  this
@@ -70,7 +75,7 @@ II. Custom builds of the library
 
 ----------------------------------------------------------------------
 
-Copyright   2000-2008, 2010-2011
+Copyright   2000-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,
index 80f161c..8aa394f 100644 (file)
@@ -33,25 +33,25 @@ I. Standard procedure
 
       src/base/ftbase.c
 
-      src/base/ftbbox.c       -- recommended, see <freetype/ftbbox.h>
-      src/base/ftglyph.c      -- recommended, see <freetype/ftglyph.h>
+      src/base/ftbbox.c       -- recommended, see <ftbbox.h>
+      src/base/ftglyph.c      -- recommended, see <ftglyph.h>
 
-      src/base/ftbdf.c        -- optional, see <freetype/ftbdf.h>
-      src/base/ftbitmap.c     -- optional, see <freetype/ftbitmap.h>
-      src/base/ftcid.c        -- optional, see <freetype/ftcid.h>
+      src/base/ftbdf.c        -- optional, see <ftbdf.h>
+      src/base/ftbitmap.c     -- optional, see <ftbitmap.h>
+      src/base/ftcid.c        -- optional, see <ftcid.h>
       src/base/ftfstype.c     -- optional
-      src/base/ftgasp.c       -- optional, see <freetype/ftgasp.h>
-      src/base/ftgxval.c      -- optional, see <freetype/ftgxval.h>
-      src/base/ftlcdfil.c     -- optional, see <freetype/ftlcdfil.h>
-      src/base/ftmm.c         -- optional, see <freetype/ftmm.h>
-      src/base/ftotval.c      -- optional, see <freetype/ftotval.h>
+      src/base/ftgasp.c       -- optional, see <ftgasp.h>
+      src/base/ftgxval.c      -- optional, see <ftgxval.h>
+      src/base/ftlcdfil.c     -- optional, see <ftlcdfil.h>
+      src/base/ftmm.c         -- optional, see <ftmm.h>
+      src/base/ftotval.c      -- optional, see <ftotval.h>
       src/base/ftpatent.c     -- optional
-      src/base/ftpfr.c        -- optional, see <freetype/ftpfr.h>
-      src/base/ftstroke.c     -- optional, see <freetype/ftstroke.h>
-      src/base/ftsynth.c      -- optional, see <freetype/ftsynth.h>
-      src/base/fttype1.c      -- optional, see <freetype/t1tables.h>
-      src/base/ftwinfnt.c     -- optional, see <freetype/ftwinfnt.h>
-      src/base/ftxf86.c       -- optional, see <freetype/ftxf86.h>
+      src/base/ftpfr.c        -- optional, see <ftpfr.h>
+      src/base/ftstroke.c     -- optional, see <ftstroke.h>
+      src/base/ftsynth.c      -- optional, see <ftsynth.h>
+      src/base/fttype1.c      -- optional, see <t1tables.h>
+      src/base/ftwinfnt.c     -- optional, see <ftwinfnt.h>
+      src/base/ftxf86.c       -- optional, see <ftxf86.h>
 
       src/base/ftmac.c        -- only on the Macintosh
 
@@ -143,7 +143,7 @@ II. Support for flat-directory compilation
 
 ----------------------------------------------------------------------
 
-Copyright 2003, 2005, 2006, 2009, 2010 by
+Copyright 2003, 2005, 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,
index 3def12c..d372adc 100644 (file)
@@ -1,26 +1,27 @@
 This document contains instructions on how to cross-build the FreeType
 library on Unix systems, for example, building binaries for Linux/MIPS
-on  FreeBSD/i386.   Before   reading  this  document,  please  consult
-INSTALL.UNIX for required tools and the basic self-building procedure.
+on  FreeBSD/i386.  Before  reading this  document, please  consult the
+file  `INSTALL.UNIX' for  required tools  and the  basic self-building
+procedure.
 
 
   1. Required Tools
   -----------------
 
     For self-building the FreeType library  on a Unix system, GNU Make
-    3.80 or  newer is required.   INSTALL.UNIX  contains  hints how to
+    3.80 or newer  is required.  `INSTALL.UNIX' contains  hints how to
     check the installed `make'.
 
     The GNU C  compiler to cross-build the target  system is required.
-    At present, using non-GNU cross compiler is not tested.  The cross
+    Currently, using a non-GNU cross  compiler is untested.  The cross
     compiler is  expected to be  installed with a system  prefix.  For
     example, if  your building system  is FreeBSD/i386 and  the target
-    system is Linux/MIPS, the  cross compiler should be installed with
+    system is Linux/MIPS, the cross  compiler should be installed with
     the name `mips-ip22-linuxelf-gcc'.
 
     A C  compiler for a self-build  is required also, to  build a tool
-    that  is executed  during  the building  procedure.  Non-GNU  self
-    compilers are acceptable, but such a setup is not tested yet.
+    (`apinames') that is executed during the build procedure.  Non-GNU
+    self compilers are acceptable, but such a setup is untested.
 
 
   2. Configuration
@@ -28,10 +29,10 @@ INSTALL.UNIX for required tools and the basic self-building procedure.
 
     2.1. Building and target system
 
-      To configure for  cross-build, the options `--host=<system>' and
-      `--build=<system>' must be passed to configure.  For example, if
-      your building  system is FreeBSD/i386  and the target  system is
-      Linux/MIPS, say
+      To configure  a cross-build,  the options  `--host=<system>' and
+      `--build=<system>'  must be  passed to  the `configure'  script.
+      For example, if your build system is FreeBSD/i386 and the target
+      system is Linux/MIPS, say
 
         ./configure \
           --build=i386-unknown-freebsd \
@@ -44,11 +45,11 @@ INSTALL.UNIX for required tools and the basic self-building procedure.
       the option  pair `--host=' and `--target='.  This  is broken and
       doesn't work.  Similarly, an explicit CC specification like
 
-        env CC=mips-ip22-linux-gcc ./configure
+        env CC=mips-ip22-linux-gcc ./configure                 # BAD
 
       or
 
-        env CC=/usr/local/mips-ip22-linux/bin/gcc ./configure
+        env CC=/usr/local/mips-ip22-linux/bin/gcc ./configure  # BAD
 
       doesn't   work  either;  such   a  configuration   confuses  the
       `configure' script while  trying to find the cross  and native C
@@ -58,22 +59,63 @@ INSTALL.UNIX for required tools and the basic self-building procedure.
     2.2. The prefix to install FreeType2
 
       Setting `--prefix=<prefix>'  properly is important.   The prefix
-      to install FreeType2 is  written into the freetype-config script
-      and freetype2.pc configuration file.
+      to  install  FreeType2  is written  into  the  `freetype-config'
+      script and `freetype2.pc' configuration file.
 
       If  the built  FreeType  2 library  is  used as  a  part of  the
       cross-building system,  the prefix  is expected to  be different
-      from the self-building  system.  For example, configuration with
-      `--prefix=/usr/local'  installs binaries  into  the system  wide
-      `/usr/local'  directory  which  then  can't be  executed.   This
-      causes confusion in configuration  of all applications which use
-      FreeType2.   Instead,  use a  prefix to install  the cross-build
-      into     a     separate     system    tree,     for     example,
-      `--prefix=/usr/local/mips-ip22-linux/'.
-
-      On the other  hand, if the built FreeType2 is used  as a part of
-      the target system, the prefix to install should reflect the file
-      system structure of the target system.
+      from  the self-building  system.  For  example, a  configuration
+      with   `--prefix=/usr/local'   installs    binaries   into   the
+      system-wide `/usr/local' directory, which then can't be executed
+      due  to the  incorrect architecture.   This causes  confusion in
+      configuration of all applications  that use FreeType2.  Instead,
+      use a prefix  to install the cross-build into  a separate system
+      tree, for example, `--prefix=/usr/local/mips-ip22-linux/'.
+
+      On the other hand, if the built  FreeType 2 library is used as a
+      part of the target system,  the prefix to install should reflect
+      the file system structure of the target system.
+
+
+    2.3. Library dependencies
+
+      FreeType normally depends on external libraries like `libpng' or
+      `libharfbuzz'.   The  easiest case  is  to  deactivate all  such
+      dependencies  using the  `--without-XXX' configuration  options.
+      However, if you  want to use those libraries,  you should ensure
+      that  they  are available  both  on  the  target system  and  as
+      (cross-compiled) libraries on the build system.
+
+      FreeType uses  `pkg-config' to find  most of the  libraries; the
+      other libraries it links to  are expected in the standard system
+      directories.   Since the  default pkg-config's  meta-information
+      files (like `harfbuzz.pc') of the build platform don't work, use
+      one of the two possible solutions below.
+
+        o Use pkg-config's meta-information files that are adjusted to
+          cross-compile  and  cross-link  with the  target  platform's
+          libraries.  Make sure those files are found before the build
+          system's default files.  Example:
+
+            ./configure \
+              --build=i386-unknown-freebsd \
+              --host=mips-ip22-linuxelf \
+              PKG_CONFIG_LIBDIR="/usr/local/mips-ip22-linux/lib/pkgconfig" \
+              [other options]
+
+          See the manpage of `pkg-config' for more details.
+
+        o Set variables like LIBPNG_LIBS  as additional options to the
+          `configure' script, overriding the values `pkg-config' would
+          provide.  `configure --help' shows the available environment
+          variables.  Example:
+
+            ./configure \
+              --build=i386-unknown-freebsd \
+              --host=mips-ip22-linuxelf \
+              LIBPNG_CFLAGS="-I/usr/local/mips-ip22-linux/include" \
+              LIBPNG_LIBS="-L/usr/local/mips-ip22-linux/lib -lpng12" \
+              [other options]
 
 
   3. Building command
@@ -121,7 +163,7 @@ INSTALL.UNIX for required tools and the basic self-building procedure.
 
 ----------------------------------------------------------------------
 
-Copyright 2006, 2008 by suzuki toshiya
+Copyright 2006, 2008, 2012, 2014 by suzuki toshiya
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 
index 72df50a..3b9e0a2 100644 (file)
@@ -1,7 +1,7 @@
-This document contains instructions  how to build the FreeType library
-on non-Unix systems  with the help of GNU Make.  Note  that if you are
-running Cygwin or MSys in  Windows, you should follow the instructions
-in the file INSTALL.UNIX instead.
+This document contains instructions how  to build the FreeType library
+on non-Unix systems with  the help of GNU Make.  Note  that if you are
+running  Cygwin  or  MinGW/MSYS  in Windows,  you  should  follow  the
+instructions in the file `INSTALL.UNIX' instead.
 
 
   FreeType 2 includes a powerful and flexible build system that allows
@@ -52,10 +52,10 @@ in the file INSTALL.UNIX instead.
 
       The following settings are used:
 
-        platform                     win32
+        platform                     windows
         compiler                     gcc
-        configuration directory      .\builds\win32
-        configuration rules          .\builds\win32\w32-gcc.mk
+        configuration directory      .\builds\windows
+        configuration rules          .\builds\windows\w32-gcc.mk
 
       If this does not correspond to your system or settings please
       remove the file 'config.mk' from this directory then read the
@@ -138,15 +138,17 @@ in the file INSTALL.UNIX instead.
 
   Final note
 
-    The build  system builds a  statically linked library of  the font
-    engine in the  `objs' directory.  It does _not_  support the build
-    of  DLLs on  Windows and  OS/2.  If  you need  these, you  have to
-    either   use  an   IDE-specific  project   file,  or   follow  the
+    The above instructions build a  _statically_ linked library of the
+    font engine in the `objs' directory.   On Windows, you can build a
+    DLL  either  with  MinGW  (within an  MSYS  shell,  following  the
+    instructions in `INSTALL.UNIX'), or you  use one of the Visual C++
+    project files; see  the  subdirectories  of `builds/windows'.  For
+    everything else,  you are on  your own,  and you might  follow the
     instructions in `INSTALL.ANY' to create your own Makefiles.
 
 ----------------------------------------------------------------------
 
-Copyright 2003, 2004, 2005, 2006, 2008 by
+Copyright 2003-2006, 2008, 2013, 2014 by
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 This  file is  part of  the FreeType  project, and  may only  be used,
index 5dc0764..251c749 100644 (file)
@@ -23,7 +23,7 @@ or MSys on Win32:
     fail.
 
     It is also fine to have GNU Make under another name (e.g. 'gmake')
-    if you use the GNUMAKE variable as described below.
+    if you use the MAKE variable as described below.
 
     As  a  special exception,  'makepp'  can  also  be used  to  build
     FreeType 2.  See the file docs/MAKEPP for details.
@@ -61,11 +61,11 @@ or MSys on Win32:
 
       ./configure --prefix=/usr
 
-    When using a different command to invoke GNU Make, use the GNUMAKE
+    When using  a different command  to invoke GNU Make,  use the MAKE
     variable.  For example,  if `gmake' is the command  to use on your
     system, do something like:
 
-       GNUMAKE=gmake ./configure [options]
+       MAKE=gmake ./configure [options]
        gmake
        gmake install            (as root)
 
@@ -81,9 +81,28 @@ or MSys on Win32:
       make
       make install
 
+
+  3.1 Interdependency with HarfBuzz
+  .................................
+
+    Note that there  is a chicken-and-egg problem  currently since the
+    HarfBuzz library  (used by the  auto-hinter to improve  support of
+    OpenType  fonts)  depends on  FreeType,  which  can be  solved  as
+    follows in case HarfBuzz is not yet installed on your system.
+
+    1. Call    FreeType's     `configure'    script     with    option
+       `--without-harfbuzz', then compile and install FreeType.
+
+    2. Compile and install HarfBuzz.
+
+    3. Call    FreeType's    `configure'   script    without    option
+       `--without-harfbuzz' (after  executing `make  distclean'), then
+       compile and install FreeType again.
+
+
 ----------------------------------------------------------------------
 
-Copyright 2003, 2004, 2005, 2006, 2007 by
+Copyright 2003-2007, 2013, 2014 by
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 This  file is  part of  the FreeType  project, and  may only  be used,
index 62945c8..99dc342 100644 (file)
@@ -30,5 +30,8 @@ file src/bdf/README and src/pcf/README).
 The gzip module uses the zlib license (see src/gzip/zlib.h) which too is
 compatible to the above two licenses.
 
+The MD5 checksum support (only used for debugging in development builds)
+is in the public domain.
+
 
 --- end of LICENSE.TXT ---
index 1dfc8c1..dd49261 100644 (file)
@@ -1,5 +1,5 @@
 Due  to our  use of  `libtool' to  generate and  install the  FreeType 2
-libraries on  Unix systems,  as well as  other historical events,  it is
+libraries on  Unix systems, as  well as  other historical events,  it is
 generally very  difficult to  know precisely which  release of  the font
 engine is installed on a given system.
 
@@ -10,16 +10,16 @@ FreeType on Unix.
 1. Version and Release numbers
 ------------------------------
 
-For each new  public release of FreeType 2,  there are generally *three*
+For each new  public release of FreeType 2, there  are generally *three*
 distinct `version' numbers to consider:
 
-  * The official FreeType 2 release number, like 2.0.9 or 2.1.3.
+  * The official FreeType 2 release number, like 2.3.1 or 2.4.10.
 
-  * The libtool (and Unix) specific version number, like 9.2.3.  This is
-    what `freetype-config --version' returns.
+  * The libtool (and  Unix) specific version number,  like 13.0.7.  This
+    is what `freetype-config --version' returns.
 
   * The platform-specific  shared object  number, used for  example when
-    the library is installed as `/usr/lib/libfreetype.so.6.3.2'.
+    the library is installed as `/usr/lib/libfreetype.so.6.7.1'.
 
 The platform-specific  number is, unsurprisingly,  platform-specific and
 varies  with the  operating system  you are  using (several  variants of
@@ -38,21 +38,29 @@ macros defined in FT_FREETYPE_H:
 
 See below for a small autoconf fragment.
 
-The  release   number  is  also  available  at   *runtime*  through  the
-`FT_Library_Version' API.   Unfortunately, this one  wasn't available or
-working correctly before the 2.1.3 official release.
+The  release  number   is  also  available  at   *runtime*  through  the
+`FT_Library_Version' API.
 
 
 2. History
 ----------
 
-The following table gives,  for each official release, the corresponding
-libtool  number, as well  as the  shared object  number found  on _most_
-systems, but not all of them:
+The  following   table  gives,  for   all  releases  since   2.3.0,  the
+corresponding libtool number, as well  as the shared object number found
+on _most_ systems, but not all of them:
 
 
-    release    libtool      so
+    release     libtool     so
   -------------------------------
+     2.5.5      17.4.11   6.11.4
+     2.5.4      17.3.11   6.11.3
+     2.5.3      17.2.11   6.11.2
+     2.5.2      17.1.11   6.11.1
+     2.5.1      17.0.11   6.11.0
+     2.5.0      16.2.10   6.10.2
+     2.4.12     16.1.10   6.10.1
+     2.4.11     16.0.10   6.10.0
+     2.4.10     15.0.9    6.9.0
      2.4.9      14.1.8    6.8.1
      2.4.8      14.0.8    6.8.0
      2.4.7      13.2.7    6.7.2
@@ -76,34 +84,6 @@ systems, but not all of them:
      2.3.2      9.13.3    6.3.13
      2.3.1      9.12.3    6.3.12
      2.3.0      9.11.3    6.3.11
-     2.2.1      9.10.3    6.3.10
-     2.2.0      9.9.3     6.3.9
-     2.1.10     9.8.3     6.3.8
-     2.1.9      9.7.3     6.3.7
-     2.1.8      9.6.3     6.3.6
-     2.1.7      9.5.3     6.3.5
-     2.1.6      9.5.3     6.3.5
-     2.1.5      9.4.3     6.3.4
-     2.1.4      9.3.3     6.3.3
-     2.1.3      9.2.3     6.3.2
-     2.1.2      9.1.3     6.3.1
-     2.1.1      9.0.3         ?
-     2.1.0      8.0.2         ?
-     2.0.9      9.0.3         ?
-     2.0.8      8.0.2         ?
-     2.0.4      7.0.1         ?
-     2.0.1      6.1.0         ?
-
-The libtool numbers are a bit inconsistent due to the library's history:
-
-  - 2.1.0 was created as a development branch from 2.0.8 (hence the same
-    libtool numbers).
-
-  - 2.0.9  was  a  bug-fix  release  of  the  `stable'  branch,  and  we
-    incorrectly increased its libtool number.
-
-  - 2.1.4 was a development version, however it was stable  enough to be
-    the basis of the 2.2.0 release.
 
 
 3. Autoconf Code Fragment
@@ -135,7 +115,7 @@ other release numbers.
 
 ------------------------------------------------------------------------
 
-Copyright 2002-2012 by
+Copyright 2002-2014 by
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 This  file is  part  of the  FreeType  project, and  may  only be  used,
index 827c894..aed885c 100644 (file)
@@ -153,7 +153,7 @@ MAC  ---     PS     TYPE_1  ---        type1    T1_SPEC.pdf
 
     for a specification  given in Appendix D on pgs. 436-450.   However,
     this information  might be out of  date; unfortunately,  there is no
-    PCF  specification available  online, and this book is out of print. 
+    PCF  specification available  online, and this book is out of print.
     George  Williams deduced  the font  format from the X11  sources and
     documented it for his FontForge font editor:
 
diff --git a/docs/freetype-config.1 b/docs/freetype-config.1
new file mode 100644 (file)
index 0000000..7b4a118
--- /dev/null
@@ -0,0 +1,108 @@
+.TH FREETYPE-CONFIG 1 "December 2014" "FreeType 2.5.5"
+.
+.
+.SH NAME
+.
+freetype-config \- Get information about a libfreetype installation
+.
+.
+.SH SYNOPSIS
+.
+.B freetype-config
+.RI [ options ]
+.
+.
+.SH DESCRIPTION
+.
+.B freetype-config
+returns information needed for compiling and linking programs with the
+FreeType library, such as linker flags and compilation parameters.
+.
+Alternatively, it can be used to query information about the
+FreeType library version installed on the system, such as the
+installation (directory path) prefix or the FreeType version number.
+.
+.PP
+This program is part of the FreeType package.
+.
+.
+.SH OPTIONS
+.
+There are two types of options: output/display selection options, and
+path override options.
+.
+.
+.SS Output selection options
+.
+Only one of the output selection options should be given at each program
+invocation.
+.
+.TP
+.B \-\-prefix
+Return the prefix value of the installed FreeType library (the default
+prefix will be `/usr' in most cases for distribution-installed
+packages).
+.
+.TP
+.B \-\-exec-prefix
+Return the executable prefix value of the installed FreeType library
+(will often be the same as the prefix value).
+.
+.TP
+.B \-\-ftversion
+Return the FreeType version number.
+.
+.TP
+.B \-\-version
+Return the `libtool version' of the FreeType library.
+.
+.TP
+.B \-\-libtool
+Return the library name for linking with libtool.
+.
+.TP
+.B \-\-libs
+Return compiler flags for linking with the installed FreeType library.
+.
+.TP
+.B \-\-cflags
+Return compiler flags for compiling against the installed FreeType library.
+.
+.TP
+.B \-\-static
+Make command line options display flags for static linking.
+.
+.
+.SS Path override options
+.
+These affect any selected output option, except the libtool version
+returned by `--version'.
+.
+.TP
+.BI \-\-prefix= PREFIX
+Override `--prefix' value with
+.IR PREFIX .
+.
+.TP
+.BI \-\-exec-prefix= EPREFIX
+Override `--exec-prefix' value with
+.IR EPREFIX .
+.
+.
+.SH BUGS
+In case the libraries FreeType links to are located in non-standard
+directories, the output from option
+.B \-\-libs
+might be incomplete.
+It is thus recommended to use the
+.BR pkg-config (1)
+interface instead, which is able to correctly resolve all dependencies.
+.
+.
+.SH AUTHOR
+.
+This manual page was contributed by Nis Martensen <nis.martensen@web.de>,
+with further refinements from the FreeType team.
+.
+.
+.\" eof
diff --git a/docs/reference/ft2-base_interface.html b/docs/reference/ft2-base_interface.html
deleted file mode 100644 (file)
index 8c918ea..0000000
+++ /dev/null
@@ -1,3608 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Base Interface
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Library">FT_Library</a></td><td></td><td><a href="#FT_IS_TRICKY">FT_IS_TRICKY</a></td><td></td><td><a href="#FT_Load_Char">FT_Load_Char</a></td></tr>
-<tr><td></td><td><a href="#FT_Face">FT_Face</a></td><td></td><td><a href="#FT_STYLE_FLAG_XXX">FT_STYLE_FLAG_XXX</a></td><td></td><td><a href="#FT_LOAD_XXX">FT_LOAD_XXX</a></td></tr>
-<tr><td></td><td><a href="#FT_Size">FT_Size</a></td><td></td><td><a href="#FT_Size_Internal">FT_Size_Internal</a></td><td></td><td><a href="#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_XXX</a></td></tr>
-<tr><td></td><td><a href="#FT_GlyphSlot">FT_GlyphSlot</a></td><td></td><td><a href="#FT_Size_Metrics">FT_Size_Metrics</a></td><td></td><td><a href="#FT_LOAD_TARGET_MODE">FT_LOAD_TARGET_MODE</a></td></tr>
-<tr><td></td><td><a href="#FT_CharMap">FT_CharMap</a></td><td></td><td><a href="#FT_SizeRec">FT_SizeRec</a></td><td></td><td><a href="#FT_Set_Transform">FT_Set_Transform</a></td></tr>
-<tr><td></td><td><a href="#FT_Encoding">FT_Encoding</a></td><td></td><td><a href="#FT_SubGlyph">FT_SubGlyph</a></td><td></td><td><a href="#FT_Render_Mode">FT_Render_Mode</a></td></tr>
-<tr><td></td><td><a href="#FT_Glyph_Metrics">FT_Glyph_Metrics</a></td><td></td><td><a href="#FT_Slot_Internal">FT_Slot_Internal</a></td><td></td><td><a href="#ft_render_mode_xxx">ft_render_mode_xxx</a></td></tr>
-<tr><td></td><td><a href="#FT_Bitmap_Size">FT_Bitmap_Size</a></td><td></td><td><a href="#FT_GlyphSlotRec">FT_GlyphSlotRec</a></td><td></td><td><a href="#FT_Render_Glyph">FT_Render_Glyph</a></td></tr>
-<tr><td></td><td><a href="#FT_Module">FT_Module</a></td><td></td><td><a href="#FT_Init_FreeType">FT_Init_FreeType</a></td><td></td><td><a href="#FT_Kerning_Mode">FT_Kerning_Mode</a></td></tr>
-<tr><td></td><td><a href="#FT_Driver">FT_Driver</a></td><td></td><td><a href="#FT_Done_FreeType">FT_Done_FreeType</a></td><td></td><td><a href="#ft_kerning_default">ft_kerning_default</a></td></tr>
-<tr><td></td><td><a href="#FT_Renderer">FT_Renderer</a></td><td></td><td><a href="#FT_OPEN_XXX">FT_OPEN_XXX</a></td><td></td><td><a href="#ft_kerning_unfitted">ft_kerning_unfitted</a></td></tr>
-<tr><td></td><td><a href="#FT_ENC_TAG">FT_ENC_TAG</a></td><td></td><td><a href="#FT_Parameter">FT_Parameter</a></td><td></td><td><a href="#ft_kerning_unscaled">ft_kerning_unscaled</a></td></tr>
-<tr><td></td><td><a href="#ft_encoding_xxx">ft_encoding_xxx</a></td><td></td><td><a href="#FT_Open_Args">FT_Open_Args</a></td><td></td><td><a href="#FT_Get_Kerning">FT_Get_Kerning</a></td></tr>
-<tr><td></td><td><a href="#FT_CharMapRec">FT_CharMapRec</a></td><td></td><td><a href="#FT_New_Face">FT_New_Face</a></td><td></td><td><a href="#FT_Get_Track_Kerning">FT_Get_Track_Kerning</a></td></tr>
-<tr><td></td><td><a href="#FT_Face_Internal">FT_Face_Internal</a></td><td></td><td><a href="#FT_New_Memory_Face">FT_New_Memory_Face</a></td><td></td><td><a href="#FT_Get_Glyph_Name">FT_Get_Glyph_Name</a></td></tr>
-<tr><td></td><td><a href="#FT_FaceRec">FT_FaceRec</a></td><td></td><td><a href="#FT_Open_Face">FT_Open_Face</a></td><td></td><td><a href="#FT_Get_Postscript_Name">FT_Get_Postscript_Name</a></td></tr>
-<tr><td></td><td><a href="#FT_FACE_FLAG_XXX">FT_FACE_FLAG_XXX</a></td><td></td><td><a href="#FT_Attach_File">FT_Attach_File</a></td><td></td><td><a href="#FT_Select_Charmap">FT_Select_Charmap</a></td></tr>
-<tr><td></td><td><a href="#FT_HAS_HORIZONTAL">FT_HAS_HORIZONTAL</a></td><td></td><td><a href="#FT_Attach_Stream">FT_Attach_Stream</a></td><td></td><td><a href="#FT_Set_Charmap">FT_Set_Charmap</a></td></tr>
-<tr><td></td><td><a href="#FT_HAS_VERTICAL">FT_HAS_VERTICAL</a></td><td></td><td><a href="#FT_Reference_Face">FT_Reference_Face</a></td><td></td><td><a href="#FT_Get_Charmap_Index">FT_Get_Charmap_Index</a></td></tr>
-<tr><td></td><td><a href="#FT_HAS_KERNING">FT_HAS_KERNING</a></td><td></td><td><a href="#FT_Done_Face">FT_Done_Face</a></td><td></td><td><a href="#FT_Get_Char_Index">FT_Get_Char_Index</a></td></tr>
-<tr><td></td><td><a href="#FT_IS_SCALABLE">FT_IS_SCALABLE</a></td><td></td><td><a href="#FT_Select_Size">FT_Select_Size</a></td><td></td><td><a href="#FT_Get_First_Char">FT_Get_First_Char</a></td></tr>
-<tr><td></td><td><a href="#FT_IS_SFNT">FT_IS_SFNT</a></td><td></td><td><a href="#FT_Size_Request_Type">FT_Size_Request_Type</a></td><td></td><td><a href="#FT_Get_Next_Char">FT_Get_Next_Char</a></td></tr>
-<tr><td></td><td><a href="#FT_IS_FIXED_WIDTH">FT_IS_FIXED_WIDTH</a></td><td></td><td><a href="#FT_Size_RequestRec">FT_Size_RequestRec</a></td><td></td><td><a href="#FT_Get_Name_Index">FT_Get_Name_Index</a></td></tr>
-<tr><td></td><td><a href="#FT_HAS_FIXED_SIZES">FT_HAS_FIXED_SIZES</a></td><td></td><td><a href="#FT_Size_Request">FT_Size_Request</a></td><td></td><td><a href="#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_XXX</a></td></tr>
-<tr><td></td><td><a href="#FT_HAS_FAST_GLYPHS">FT_HAS_FAST_GLYPHS</a></td><td></td><td><a href="#FT_Request_Size">FT_Request_Size</a></td><td></td><td><a href="#FT_Get_SubGlyph_Info">FT_Get_SubGlyph_Info</a></td></tr>
-<tr><td></td><td><a href="#FT_HAS_GLYPH_NAMES">FT_HAS_GLYPH_NAMES</a></td><td></td><td><a href="#FT_Set_Char_Size">FT_Set_Char_Size</a></td><td></td><td><a href="#FT_FSTYPE_XXX">FT_FSTYPE_XXX</a></td></tr>
-<tr><td></td><td><a href="#FT_HAS_MULTIPLE_MASTERS">FT_HAS_MULTIPLE_MASTERS</a></td><td></td><td><a href="#FT_Set_Pixel_Sizes">FT_Set_Pixel_Sizes</a></td><td></td><td><a href="#FT_Get_FSType_Flags">FT_Get_FSType_Flags</a></td></tr>
-<tr><td></td><td><a href="#FT_IS_CID_KEYED">FT_IS_CID_KEYED</a></td><td></td><td><a href="#FT_Load_Glyph">FT_Load_Glyph</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section describes the public high-level API of FreeType&nbsp;2.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Library">FT_Library</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_LibraryRec_  *<b>FT_Library</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a FreeType library instance. Each &lsquo;library&rsquo; is completely independent from the others; it is the &lsquo;root&rsquo; of a set of objects like fonts, faces, sizes, etc.</p>
-<p>It also embeds a memory manager (see <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a>), as well as a scan-line converter object (see <a href="ft2-raster.html#FT_Raster">FT_Raster</a>).</p>
-<p>For multi-threading applications each thread should have its own FT_Library object.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Library objects are normally created by <a href="ft2-base_interface.html#FT_Init_FreeType">FT_Init_FreeType</a>, and destroyed with <a href="ft2-base_interface.html#FT_Done_FreeType">FT_Done_FreeType</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Face">FT_Face</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_FaceRec_*  <b>FT_Face</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a given typographic face object. A face object models a given typeface, in a given style.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Each face object also owns a single <a href="ft2-base_interface.html#FT_GlyphSlot">FT_GlyphSlot</a> object, as well as one or more <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects.</p>
-<p>Use <a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a> or <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a> to create a new face object from a given filepathname or a custom input stream.</p>
-<p>Use <a href="ft2-base_interface.html#FT_Done_Face">FT_Done_Face</a> to destroy it (along with its slot and sizes).</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>also</b></em></td></tr><tr><td>
-<p>See <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a> for the publicly accessible fields of a given face object.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Size">FT_Size</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_SizeRec_*  <b>FT_Size</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to an object used to model a face scaled to a given character size.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Each <a href="ft2-base_interface.html#FT_Face">FT_Face</a> has an <i>active</i> <a href="ft2-base_interface.html#FT_Size">FT_Size</a> object that is used by functions like <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a> to determine the scaling transformation which is used to load and hint glyphs and metrics.</p>
-<p>You can use <a href="ft2-base_interface.html#FT_Set_Char_Size">FT_Set_Char_Size</a>, <a href="ft2-base_interface.html#FT_Set_Pixel_Sizes">FT_Set_Pixel_Sizes</a>, <a href="ft2-base_interface.html#FT_Request_Size">FT_Request_Size</a> or even <a href="ft2-base_interface.html#FT_Select_Size">FT_Select_Size</a> to change the content (i.e., the scaling values) of the active <a href="ft2-base_interface.html#FT_Size">FT_Size</a>.</p>
-<p>You can use <a href="ft2-sizes_management.html#FT_New_Size">FT_New_Size</a> to create additional size objects for a given <a href="ft2-base_interface.html#FT_Face">FT_Face</a>, but they won't be used by other functions until you activate it through <a href="ft2-sizes_management.html#FT_Activate_Size">FT_Activate_Size</a>. Only one size can be activated at any given time per face.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>also</b></em></td></tr><tr><td>
-<p>See <a href="ft2-base_interface.html#FT_SizeRec">FT_SizeRec</a> for the publicly accessible fields of a given size object.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_GlyphSlot">FT_GlyphSlot</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_GlyphSlotRec_*  <b>FT_GlyphSlot</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a given &lsquo;glyph slot&rsquo;. A slot is a container where it is possible to load any of the glyphs contained in its parent face.</p>
-<p>In other words, each time you call <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a> or <a href="ft2-base_interface.html#FT_Load_Char">FT_Load_Char</a>, the slot's content is erased by the new glyph data, i.e., the glyph's metrics, its image (bitmap or outline), and other control information.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>also</b></em></td></tr><tr><td>
-<p>See <a href="ft2-base_interface.html#FT_GlyphSlotRec">FT_GlyphSlotRec</a> for the publicly accessible glyph fields.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_CharMap">FT_CharMap</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_CharMapRec_*  <b>FT_CharMap</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a given character map. A charmap is used to translate character codes in a given encoding into glyph indexes for its parent's face. Some font formats may provide several charmaps per font.</p>
-<p>Each face object owns zero or more charmaps, but only one of them can be &lsquo;active&rsquo; and used by <a href="ft2-base_interface.html#FT_Get_Char_Index">FT_Get_Char_Index</a> or <a href="ft2-base_interface.html#FT_Load_Char">FT_Load_Char</a>.</p>
-<p>The list of available charmaps in a face is available through the &lsquo;face-&gt;num_charmaps&rsquo; and &lsquo;face-&gt;charmaps&rsquo; fields of <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a>.</p>
-<p>The currently active charmap is available as &lsquo;face-&gt;charmap&rsquo;. You should call <a href="ft2-base_interface.html#FT_Set_Charmap">FT_Set_Charmap</a> to change it.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>When a new face is created (either through <a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a> or <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a>), the library looks for a Unicode charmap within the list and automatically activates it.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>also</b></em></td></tr><tr><td>
-<p>See <a href="ft2-base_interface.html#FT_CharMapRec">FT_CharMapRec</a> for the publicly accessible fields of a given character map.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Encoding">FT_Encoding</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_Encoding_
-  {
-    <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_NONE</a>, 0, 0, 0, 0 ),
-
-    <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_SYMBOL</a>, 's', 'y', 'm', 'b' ),
-    <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_UNICODE</a>,   'u', 'n', 'i', 'c' ),
-
-    <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_SJIS</a>,    's', 'j', 'i', 's' ),
-    <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_GB2312</a>,  'g', 'b', ' ', ' ' ),
-    <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_BIG5</a>,    'b', 'i', 'g', '5' ),
-    <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_WANSUNG</a>, 'w', 'a', 'n', 's' ),
-    <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_JOHAB</a>,   'j', 'o', 'h', 'a' ),
-
-    /* for backwards compatibility */
-    <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_SJIS</a>    = <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_SJIS</a>,
-    <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_GB2312</a>  = <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_GB2312</a>,
-    <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_BIG5</a>    = <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_BIG5</a>,
-    <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_WANSUNG</a> = <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_WANSUNG</a>,
-    <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_JOHAB</a>   = <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_JOHAB</a>,
-
-    <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_STANDARD</a>, 'A', 'D', 'O', 'B' ),
-    <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_EXPERT</a>,   'A', 'D', 'B', 'E' ),
-    <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_CUSTOM</a>,   'A', 'D', 'B', 'C' ),
-    <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_LATIN_1</a>,  'l', 'a', 't', '1' ),
-
-    <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_OLD_LATIN_2</a>, 'l', 'a', 't', '2' ),
-
-    <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_APPLE_ROMAN</a>, 'a', 'r', 'm', 'n' )
-
-  } <b>FT_Encoding</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An enumeration used to specify character sets supported by charmaps. Used in the <a href="ft2-base_interface.html#FT_Select_Charmap">FT_Select_Charmap</a> API function.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Despite the name, this enumeration lists specific character repertories (i.e., charsets), and not text encoding methods (e.g., UTF-8, UTF-16, etc.).</p>
-<p>Other encodings might be defined in the future.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_ENCODING_NONE</b></td><td>
-<p>The encoding value&nbsp;0 is reserved.</p>
-</td></tr>
-<tr valign=top><td><b>FT_ENCODING_UNICODE</b></td><td>
-<p>Corresponds to the Unicode character set. This value covers all versions of the Unicode repertoire, including ASCII and Latin-1. Most fonts include a Unicode charmap, but not all of them.</p>
-<p>For example, if you want to access Unicode value U+1F028 (and the font contains it), use value 0x1F028 as the input value for <a href="ft2-base_interface.html#FT_Get_Char_Index">FT_Get_Char_Index</a>.</p>
-</td></tr>
-<tr valign=top><td><b>FT_ENCODING_MS_SYMBOL</b></td><td>
-<p>Corresponds to the Microsoft Symbol encoding, used to encode mathematical symbols in the 32..255 character code range. For more information, see &lsquo;http://www.ceviz.net/symbol.htm&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>FT_ENCODING_SJIS</b></td><td>
-<p>Corresponds to Japanese SJIS encoding. More info at at &lsquo;http://langsupport.japanreference.com/encoding.shtml&rsquo;. See note on multi-byte encodings below.</p>
-</td></tr>
-<tr valign=top><td><b>FT_ENCODING_GB2312</b></td><td>
-<p>Corresponds to an encoding system for Simplified Chinese as used used in mainland China.</p>
-</td></tr>
-<tr valign=top><td><b>FT_ENCODING_BIG5</b></td><td>
-<p>Corresponds to an encoding system for Traditional Chinese as used in Taiwan and Hong Kong.</p>
-</td></tr>
-<tr valign=top><td><b>FT_ENCODING_WANSUNG</b></td><td>
-<p>Corresponds to the Korean encoding system known as Wansung. For more information see &lsquo;http://www.microsoft.com/typography/unicode/949.txt&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>FT_ENCODING_JOHAB</b></td><td>
-<p>The Korean standard character set (KS&nbsp;C 5601-1992), which corresponds to MS Windows code page 1361. This character set includes all possible Hangeul character combinations.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_ENCODING_ADOBE_LATIN_1</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Corresponds to a Latin-1 encoding as defined in a Type&nbsp;1 PostScript font. It is limited to 256 character codes.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_ENCODING_ADOBE_STANDARD</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Corresponds to the Adobe Standard encoding, as found in Type&nbsp;1, CFF, and OpenType/CFF fonts. It is limited to 256 character codes.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_ENCODING_ADOBE_EXPERT</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Corresponds to the Adobe Expert encoding, as found in Type&nbsp;1, CFF, and OpenType/CFF fonts. It is limited to 256 character codes.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_ENCODING_ADOBE_CUSTOM</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Corresponds to a custom encoding, as found in Type&nbsp;1, CFF, and OpenType/CFF fonts. It is limited to 256 character codes.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_ENCODING_APPLE_ROMAN</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Corresponds to the 8-bit Apple roman encoding. Many TrueType and OpenType fonts contain a charmap for this encoding, since older versions of Mac OS are able to use it.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_ENCODING_OLD_LATIN_2</b></td></tr>
-<tr valign=top><td></td><td>
-<p>This value is deprecated and was never used nor reported by FreeType. Don't use or test for it.</p>
-</td></tr>
-<tr valign=top><td><b>FT_ENCODING_MS_SJIS</b></td><td>
-<p>Same as FT_ENCODING_SJIS. Deprecated.</p>
-</td></tr>
-<tr valign=top><td><b>FT_ENCODING_MS_GB2312</b></td><td>
-<p>Same as FT_ENCODING_GB2312. Deprecated.</p>
-</td></tr>
-<tr valign=top><td><b>FT_ENCODING_MS_BIG5</b></td><td>
-<p>Same as FT_ENCODING_BIG5. Deprecated.</p>
-</td></tr>
-<tr valign=top><td><b>FT_ENCODING_MS_WANSUNG</b></td><td>
-<p>Same as FT_ENCODING_WANSUNG. Deprecated.</p>
-</td></tr>
-<tr valign=top><td><b>FT_ENCODING_MS_JOHAB</b></td><td>
-<p>Same as FT_ENCODING_JOHAB. Deprecated.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>By default, FreeType automatically synthesizes a Unicode charmap for PostScript fonts, using their glyph names dictionaries. However, it also reports the encodings defined explicitly in the font file, for the cases when they are needed, with the Adobe values as well.</p>
-<p>FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap is neither Unicode nor ISO-8859-1 (otherwise it is set to FT_ENCODING_UNICODE). Use <a href="ft2-bdf_fonts.html#FT_Get_BDF_Charset_ID">FT_Get_BDF_Charset_ID</a> to find out which encoding is really present. If, for example, the &lsquo;cs_registry&rsquo; field is &lsquo;KOI8&rsquo; and the &lsquo;cs_encoding&rsquo; field is &lsquo;R&rsquo;, the font is encoded in KOI8-R.</p>
-<p>FT_ENCODING_NONE is always set (with a single exception) by the winfonts driver. Use <a href="ft2-winfnt_fonts.html#FT_Get_WinFNT_Header">FT_Get_WinFNT_Header</a> and examine the &lsquo;charset&rsquo; field of the <a href="ft2-winfnt_fonts.html#FT_WinFNT_HeaderRec">FT_WinFNT_HeaderRec</a> structure to find out which encoding is really present. For example, <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1251</a> (204) means Windows code page 1251 (for Russian).</p>
-<p>FT_ENCODING_NONE is set if &lsquo;platform_id&rsquo; is <a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_MACINTOSH</a> and &lsquo;encoding_id&rsquo; is not <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_ROMAN</a> (otherwise it is set to FT_ENCODING_APPLE_ROMAN).</p>
-<p>If &lsquo;platform_id&rsquo; is <a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_MACINTOSH</a>, use the function <a href="ft2-truetype_tables.html#FT_Get_CMap_Language_ID">FT_Get_CMap_Language_ID</a> to query the Mac language ID which may be needed to be able to distinguish Apple encoding variants. See</p>
-<p>http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT</p>
-<p>to get an idea how to do that. Basically, if the language ID is&nbsp;0, don't use it, otherwise subtract 1 from the language ID. Then examine &lsquo;encoding_id&rsquo;. If, for example, &lsquo;encoding_id&rsquo; is <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_ROMAN</a> and the language ID (minus&nbsp;1) is &lsquo;TT_MAC_LANGID_GREEK&rsquo;, it is the Greek encoding, not Roman. <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_ARABIC</a> with &lsquo;TT_MAC_LANGID_FARSI&rsquo; means the Farsi variant the Arabic encoding.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Glyph_Metrics">FT_Glyph_Metrics</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Glyph_Metrics_
-  {
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>  width;
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>  height;
-
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>  horiBearingX;
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>  horiBearingY;
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>  horiAdvance;
-
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>  vertBearingX;
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>  vertBearingY;
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>  vertAdvance;
-
-  } <b>FT_Glyph_Metrics</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model the metrics of a single glyph. The values are expressed in 26.6 fractional pixel format; if the flag <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a> has been used while loading the glyph, values are expressed in font units instead.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>width</b></td><td>
-<p>The glyph's width.</p>
-</td></tr>
-<tr valign=top><td><b>height</b></td><td>
-<p>The glyph's height.</p>
-</td></tr>
-<tr valign=top><td><b>horiBearingX</b></td><td>
-<p>Left side bearing for horizontal layout.</p>
-</td></tr>
-<tr valign=top><td><b>horiBearingY</b></td><td>
-<p>Top side bearing for horizontal layout.</p>
-</td></tr>
-<tr valign=top><td><b>horiAdvance</b></td><td>
-<p>Advance width for horizontal layout.</p>
-</td></tr>
-<tr valign=top><td><b>vertBearingX</b></td><td>
-<p>Left side bearing for vertical layout.</p>
-</td></tr>
-<tr valign=top><td><b>vertBearingY</b></td><td>
-<p>Top side bearing for vertical layout. Larger positive values mean further below the vertical glyph origin.</p>
-</td></tr>
-<tr valign=top><td><b>vertAdvance</b></td><td>
-<p>Advance height for vertical layout. Positive values mean the glyph has a positive advance downward.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>If not disabled with <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_HINTING</a>, the values represent dimensions of the hinted glyph (in case hinting is applicable).</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Bitmap_Size">FT_Bitmap_Size</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Bitmap_Size_
-  {
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>  height;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>  width;
-
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>    size;
-
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>    x_ppem;
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>    y_ppem;
-
-  } <b>FT_Bitmap_Size</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This structure models the metrics of a bitmap strike (i.e., a set of glyphs for a given point size and resolution) in a bitmap font. It is used for the &lsquo;available_sizes&rsquo; field of <a href="ft2-base_interface.html#FT_Face">FT_Face</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>height</b></td><td>
-<p>The vertical distance, in pixels, between two consecutive baselines. It is always positive.</p>
-</td></tr>
-<tr valign=top><td><b>width</b></td><td>
-<p>The average width, in pixels, of all glyphs in the strike.</p>
-</td></tr>
-<tr valign=top><td><b>size</b></td><td>
-<p>The nominal size of the strike in 26.6 fractional points. This field is not very useful.</p>
-</td></tr>
-<tr valign=top><td><b>x_ppem</b></td><td>
-<p>The horizontal ppem (nominal width) in 26.6 fractional pixels.</p>
-</td></tr>
-<tr valign=top><td><b>y_ppem</b></td><td>
-<p>The vertical ppem (nominal height) in 26.6 fractional pixels.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Windows FNT: The nominal size given in a FNT font is not reliable. Thus when the driver finds it incorrect, it sets &lsquo;size&rsquo; to some calculated values and sets &lsquo;x_ppem&rsquo; and &lsquo;y_ppem&rsquo; to the pixel width and height given in the font, respectively.</p>
-<p>TrueType embedded bitmaps: &lsquo;size&rsquo;, &lsquo;width&rsquo;, and &lsquo;height&rsquo; values are not contained in the bitmap strike itself. They are computed from the global font parameters.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Module">FT_Module</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_ModuleRec_*  <b>FT_Module</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a given FreeType module object. Each module can be a font driver, a renderer, or anything else that provides services to the formers.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Driver">FT_Driver</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_DriverRec_*  <b>FT_Driver</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a given FreeType font driver object. Each font driver is a special module capable of creating faces from font files.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Renderer">FT_Renderer</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_RendererRec_*  <b>FT_Renderer</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a given FreeType renderer. A renderer is a special module in charge of converting a glyph image to a bitmap, when necessary. Each renderer supports a given glyph image format, and one or more target surface depths.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_ENC_TAG">FT_ENC_TAG</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#ifndef <b>FT_ENC_TAG</b>
-#define <b>FT_ENC_TAG</b>( value, a, b, c, d )         \
-          value = ( ( (<a href="ft2-basic_types.html#FT_UInt32">FT_UInt32</a>)(a) &lt;&lt; 24 ) |  \
-                    ( (<a href="ft2-basic_types.html#FT_UInt32">FT_UInt32</a>)(b) &lt;&lt; 16 ) |  \
-                    ( (<a href="ft2-basic_types.html#FT_UInt32">FT_UInt32</a>)(c) &lt;&lt;  8 ) |  \
-                      (<a href="ft2-basic_types.html#FT_UInt32">FT_UInt32</a>)(d)         )
-
-#endif /* <b>FT_ENC_TAG</b> */
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This macro converts four-letter tags into an unsigned long. It is used to define &lsquo;encoding&rsquo; identifiers (see <a href="ft2-base_interface.html#FT_Encoding">FT_Encoding</a>).</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Since many 16-bit compilers don't like 32-bit enumerations, you should redefine this macro in case of problems to something like this:</p>
-<pre class="colored">
-  #define FT_ENC_TAG( value, a, b, c, d )  value                   
-</pre>
-<p>to get a simple enumeration without assigning special numbers.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="ft_encoding_xxx">ft_encoding_xxx</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define ft_encoding_none            <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_NONE</a>
-#define ft_encoding_unicode         <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_UNICODE</a>
-#define ft_encoding_symbol          <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_SYMBOL</a>
-#define ft_encoding_latin_1         <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_LATIN_1</a>
-#define ft_encoding_latin_2         <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_OLD_LATIN_2</a>
-#define ft_encoding_sjis            <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_SJIS</a>
-#define ft_encoding_gb2312          <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_GB2312</a>
-#define ft_encoding_big5            <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_BIG5</a>
-#define ft_encoding_wansung         <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_WANSUNG</a>
-#define ft_encoding_johab           <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_JOHAB</a>
-
-#define ft_encoding_adobe_standard  <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_STANDARD</a>
-#define ft_encoding_adobe_expert    <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_EXPERT</a>
-#define ft_encoding_adobe_custom    <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_CUSTOM</a>
-#define ft_encoding_apple_roman     <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_APPLE_ROMAN</a>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>These constants are deprecated; use the corresponding <a href="ft2-base_interface.html#FT_Encoding">FT_Encoding</a> values instead.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_CharMapRec">FT_CharMapRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_CharMapRec_
-  {
-    <a href="ft2-base_interface.html#FT_Face">FT_Face</a>      face;
-    <a href="ft2-base_interface.html#FT_Encoding">FT_Encoding</a>  encoding;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>    platform_id;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>    encoding_id;
-
-  } <b>FT_CharMapRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>The base charmap structure.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the parent face object.</p>
-</td></tr>
-<tr valign=top><td><b>encoding</b></td><td>
-<p>An <a href="ft2-base_interface.html#FT_Encoding">FT_Encoding</a> tag identifying the charmap. Use this with <a href="ft2-base_interface.html#FT_Select_Charmap">FT_Select_Charmap</a>.</p>
-</td></tr>
-<tr valign=top><td><b>platform_id</b></td><td>
-<p>An ID number describing the platform for the following encoding ID. This comes directly from the TrueType specification and should be emulated for other formats.</p>
-</td></tr>
-<tr valign=top><td><b>encoding_id</b></td><td>
-<p>A platform specific encoding number. This also comes from the TrueType specification and should be emulated similarly.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Face_Internal">FT_Face_Internal</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Face_InternalRec_*  <b>FT_Face_Internal</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An opaque handle to an &lsquo;FT_Face_InternalRec&rsquo; structure, used to model private data of a given <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object.</p>
-<p>This structure might change between releases of FreeType&nbsp;2 and is not generally available to client applications.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_FaceRec">FT_FaceRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_FaceRec_
-  {
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>           num_faces;
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>           face_index;
-
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>           face_flags;
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>           style_flags;
-
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>           num_glyphs;
-
-    <a href="ft2-basic_types.html#FT_String">FT_String</a>*        family_name;
-    <a href="ft2-basic_types.html#FT_String">FT_String</a>*        style_name;
-
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>            num_fixed_sizes;
-    <a href="ft2-base_interface.html#FT_Bitmap_Size">FT_Bitmap_Size</a>*   available_sizes;
-
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>            num_charmaps;
-    <a href="ft2-base_interface.html#FT_CharMap">FT_CharMap</a>*       charmaps;
-
-    <a href="ft2-basic_types.html#FT_Generic">FT_Generic</a>        generic;
-
-    /*# The following member variables (down to `underline_thickness') */
-    /*# are only relevant to scalable outlines; cf. @<a href="ft2-base_interface.html#FT_Bitmap_Size">FT_Bitmap_Size</a>    */
-    /*# for bitmap fonts.                                              */
-    <a href="ft2-basic_types.html#FT_BBox">FT_BBox</a>           bbox;
-
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>         units_per_EM;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>          ascender;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>          descender;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>          height;
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>          max_advance_width;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>          max_advance_height;
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>          underline_position;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>          underline_thickness;
-
-    <a href="ft2-base_interface.html#FT_GlyphSlot">FT_GlyphSlot</a>      glyph;
-    <a href="ft2-base_interface.html#FT_Size">FT_Size</a>           size;
-    <a href="ft2-base_interface.html#FT_CharMap">FT_CharMap</a>        charmap;
-
-    /*@private begin */
-
-    <a href="ft2-base_interface.html#FT_Driver">FT_Driver</a>         driver;
-    <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a>         memory;
-    <a href="ft2-system_interface.html#FT_Stream">FT_Stream</a>         stream;
-
-    <a href="ft2-list_processing.html#FT_ListRec">FT_ListRec</a>        sizes_list;
-
-    <a href="ft2-basic_types.html#FT_Generic">FT_Generic</a>        autohint;   /* face-specific auto-hinter data */
-    <span class="keyword">void</span>*             extensions; /* unused                         */
-
-    <a href="ft2-base_interface.html#FT_Face_Internal">FT_Face_Internal</a>  internal;
-
-    /*@private end */
-
-  } <b>FT_FaceRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>FreeType root face class structure. A face object models a typeface in a font file.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>num_faces</b></td><td>
-<p>The number of faces in the font file. Some font formats can have multiple faces in a font file.</p>
-</td></tr>
-<tr valign=top><td><b>face_index</b></td><td>
-<p>The index of the face in the font file. It is set to&nbsp;0 if there is only one face in the font file.</p>
-</td></tr>
-<tr valign=top><td><b>face_flags</b></td><td>
-<p>A set of bit flags that give important information about the face; see <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_XXX</a> for the details.</p>
-</td></tr>
-<tr valign=top><td><b>style_flags</b></td><td>
-<p>A set of bit flags indicating the style of the face; see <a href="ft2-base_interface.html#FT_STYLE_FLAG_XXX">FT_STYLE_FLAG_XXX</a> for the details.</p>
-</td></tr>
-<tr valign=top><td><b>num_glyphs</b></td><td>
-<p>The number of glyphs in the face. If the face is scalable and has sbits (see &lsquo;num_fixed_sizes&rsquo;), it is set to the number of outline glyphs.</p>
-<p>For CID-keyed fonts, this value gives the highest CID used in the font.</p>
-</td></tr>
-<tr valign=top><td><b>family_name</b></td><td>
-<p>The face's family name. This is an ASCII string, usually in English, which describes the typeface's family (like &lsquo;Times New Roman&rsquo;, &lsquo;Bodoni&rsquo;, &lsquo;Garamond&rsquo;, etc). This is a least common denominator used to list fonts. Some formats (TrueType &amp; OpenType) provide localized and Unicode versions of this string. Applications should use the format specific interface to access them. Can be NULL (e.g., in fonts embedded in a PDF file).</p>
-</td></tr>
-<tr valign=top><td><b>style_name</b></td><td>
-<p>The face's style name. This is an ASCII string, usually in English, which describes the typeface's style (like &lsquo;Italic&rsquo;, &lsquo;Bold&rsquo;, &lsquo;Condensed&rsquo;, etc). Not all font formats provide a style name, so this field is optional, and can be set to NULL. As for &lsquo;family_name&rsquo;, some formats provide localized and Unicode versions of this string. Applications should use the format specific interface to access them.</p>
-</td></tr>
-<tr valign=top><td><b>num_fixed_sizes</b></td><td>
-<p>The number of bitmap strikes in the face. Even if the face is scalable, there might still be bitmap strikes, which are called &lsquo;sbits&rsquo; in that case.</p>
-</td></tr>
-<tr valign=top><td><b>available_sizes</b></td><td>
-<p>An array of <a href="ft2-base_interface.html#FT_Bitmap_Size">FT_Bitmap_Size</a> for all bitmap strikes in the face. It is set to NULL if there is no bitmap strike.</p>
-</td></tr>
-<tr valign=top><td><b>num_charmaps</b></td><td>
-<p>The number of charmaps in the face.</p>
-</td></tr>
-<tr valign=top><td><b>charmaps</b></td><td>
-<p>An array of the charmaps of the face.</p>
-</td></tr>
-<tr valign=top><td><b>generic</b></td><td>
-<p>A field reserved for client uses. See the <a href="ft2-basic_types.html#FT_Generic">FT_Generic</a> type description.</p>
-</td></tr>
-<tr valign=top><td><b>bbox</b></td><td>
-<p>The font bounding box. Coordinates are expressed in font units (see &lsquo;units_per_EM&rsquo;). The box is large enough to contain any glyph from the font. Thus, &lsquo;bbox.yMax&rsquo; can be seen as the &lsquo;maximal ascender&rsquo;, and &lsquo;bbox.yMin&rsquo; as the &lsquo;minimal descender&rsquo;. Only relevant for scalable formats.</p>
-<p>Note that the bounding box might be off by (at least) one pixel for hinted fonts. See <a href="ft2-base_interface.html#FT_Size_Metrics">FT_Size_Metrics</a> for further discussion.</p>
-</td></tr>
-<tr valign=top><td><b>units_per_EM</b></td><td>
-<p>The number of font units per EM square for this face. This is typically 2048 for TrueType fonts, and 1000 for Type&nbsp;1 fonts. Only relevant for scalable formats.</p>
-</td></tr>
-<tr valign=top><td><b>ascender</b></td><td>
-<p>The typographic ascender of the face, expressed in font units. For font formats not having this information, it is set to &lsquo;bbox.yMax&rsquo;. Only relevant for scalable formats.</p>
-</td></tr>
-<tr valign=top><td><b>descender</b></td><td>
-<p>The typographic descender of the face, expressed in font units. For font formats not having this information, it is set to &lsquo;bbox.yMin&rsquo;. Note that this field is usually negative. Only relevant for scalable formats.</p>
-</td></tr>
-<tr valign=top><td><b>height</b></td><td>
-<p>The height is the vertical distance between two consecutive baselines, expressed in font units. It is always positive. Only relevant for scalable formats.</p>
-</td></tr>
-<tr valign=top><td><b>max_advance_width</b></td><td>
-<p>The maximal 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.</p>
-</td></tr>
-<tr valign=top><td><b>max_advance_height</b></td><td>
-<p>The maximal advance height, in font units, for all glyphs in this face. This is only relevant for vertical layouts, and is set to &lsquo;height&rsquo; for fonts that do not provide vertical metrics. Only relevant for scalable formats.</p>
-</td></tr>
-<tr valign=top><td><b>underline_position</b></td><td>
-<p>The position, in font units, of the underline line for this face. It is the center of the underlining stem. Only relevant for scalable formats.</p>
-</td></tr>
-<tr valign=top><td><b>underline_thickness</b></td><td>
-<p>The thickness, in font units, of the underline for this face. Only relevant for scalable formats.</p>
-</td></tr>
-<tr valign=top><td><b>glyph</b></td><td>
-<p>The face's associated glyph slot(s).</p>
-</td></tr>
-<tr valign=top><td><b>size</b></td><td>
-<p>The current active size for this face.</p>
-</td></tr>
-<tr valign=top><td><b>charmap</b></td><td>
-<p>The current active charmap for this face.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Fields may be changed after a call to <a href="ft2-base_interface.html#FT_Attach_File">FT_Attach_File</a> or <a href="ft2-base_interface.html#FT_Attach_Stream">FT_Attach_Stream</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_FACE_FLAG_XXX">FT_FACE_FLAG_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_SCALABLE</a>          ( 1L &lt;&lt;  0 )
-#define <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_FIXED_SIZES</a>       ( 1L &lt;&lt;  1 )
-#define <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_FIXED_WIDTH</a>       ( 1L &lt;&lt;  2 )
-#define <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_SFNT</a>              ( 1L &lt;&lt;  3 )
-#define <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_HORIZONTAL</a>        ( 1L &lt;&lt;  4 )
-#define <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_VERTICAL</a>          ( 1L &lt;&lt;  5 )
-#define <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_KERNING</a>           ( 1L &lt;&lt;  6 )
-#define <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_FAST_GLYPHS</a>       ( 1L &lt;&lt;  7 )
-#define <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_MULTIPLE_MASTERS</a>  ( 1L &lt;&lt;  8 )
-#define <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_GLYPH_NAMES</a>       ( 1L &lt;&lt;  9 )
-#define <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_EXTERNAL_STREAM</a>   ( 1L &lt;&lt; 10 )
-#define <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_HINTER</a>            ( 1L &lt;&lt; 11 )
-#define <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_CID_KEYED</a>         ( 1L &lt;&lt; 12 )
-#define <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_TRICKY</a>            ( 1L &lt;&lt; 13 )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of bit flags used in the &lsquo;face_flags&rsquo; field of the <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a> structure. They inform client applications of properties of the corresponding face.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_FACE_FLAG_SCALABLE</b></td><td>
-<p>Indicates that the face contains outline glyphs. This doesn't prevent bitmap strikes, i.e., a face can have both this and and <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_FIXED_SIZES</a> set.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_FACE_FLAG_FIXED_SIZES</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Indicates that the face contains bitmap strikes. See also the &lsquo;num_fixed_sizes&rsquo; and &lsquo;available_sizes&rsquo; fields of <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a>.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_FACE_FLAG_FIXED_WIDTH</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Indicates that the face contains fixed-width characters (like Courier, Lucido, MonoType, etc.).</p>
-</td></tr>
-<tr valign=top><td><b>FT_FACE_FLAG_SFNT</b></td><td>
-<p>Indicates that the face uses the &lsquo;sfnt&rsquo; storage scheme. For now, this means TrueType and OpenType.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_FACE_FLAG_HORIZONTAL</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Indicates that the face contains horizontal glyph metrics. This should be set for all common formats.</p>
-</td></tr>
-<tr valign=top><td><b>FT_FACE_FLAG_VERTICAL</b></td><td>
-<p>Indicates that the face contains vertical glyph metrics. This is only available in some formats, not all of them.</p>
-</td></tr>
-<tr valign=top><td><b>FT_FACE_FLAG_KERNING</b></td><td>
-<p>Indicates that the face contains kerning information. If set, the kerning distance can be retrieved through the function <a href="ft2-base_interface.html#FT_Get_Kerning">FT_Get_Kerning</a>. Otherwise the function always return the vector (0,0). Note that FreeType doesn't handle kerning data from the &lsquo;GPOS&rsquo; table (as present in some OpenType fonts).</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_FACE_FLAG_FAST_GLYPHS</b></td></tr>
-<tr valign=top><td></td><td>
-<p>THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_FACE_FLAG_MULTIPLE_MASTERS</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Indicates that the font contains multiple masters and is capable of interpolating between them. See the multiple-masters specific API for details.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_FACE_FLAG_GLYPH_NAMES</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Indicates that the font contains glyph names that can be retrieved through <a href="ft2-base_interface.html#FT_Get_Glyph_Name">FT_Get_Glyph_Name</a>. Note that some TrueType fonts contain broken glyph name tables. Use the function <a href="ft2-type1_tables.html#FT_Has_PS_Glyph_Names">FT_Has_PS_Glyph_Names</a> when needed.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_FACE_FLAG_EXTERNAL_STREAM</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Used internally by FreeType to indicate that a face's stream was provided by the client application and should not be destroyed when <a href="ft2-base_interface.html#FT_Done_Face">FT_Done_Face</a> is called. Don't read or test this flag.</p>
-</td></tr>
-<tr valign=top><td><b>FT_FACE_FLAG_HINTER</b></td><td>
-<p>Set if the font driver has a hinting machine of its own. For example, with TrueType fonts, it makes sense to use data from the SFNT &lsquo;gasp&rsquo; table only if the native TrueType hinting engine (with the bytecode interpreter) is available and active.</p>
-</td></tr>
-<tr valign=top><td><b>FT_FACE_FLAG_CID_KEYED</b></td><td>
-<p>Set if the font is CID-keyed. In that case, the font is not accessed by glyph indices but by CID values. For subsetted CID-keyed fonts this has the consequence that not all index values are a valid argument to FT_Load_Glyph. Only the CID values for which corresponding glyphs in the subsetted font exist make FT_Load_Glyph return successfully; in all other cases you get an &lsquo;FT_Err_Invalid_Argument&rsquo; error.</p>
-<p>Note that CID-keyed fonts which are in an SFNT wrapper don't have this flag set since the glyphs are accessed in the normal way (using contiguous indices); the &lsquo;CID-ness&rsquo; isn't visible to the application.</p>
-</td></tr>
-<tr valign=top><td><b>FT_FACE_FLAG_TRICKY</b></td><td>
-<p>Set if the font is &lsquo;tricky&rsquo;, this is, it always needs the font format's native hinting engine to get a reasonable result. A typical example is the Chinese font &lsquo;mingli.ttf&rsquo; which uses TrueType bytecode instructions to move and scale all of its subglyphs.</p>
-<p>It is not possible to autohint such fonts using <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_FORCE_AUTOHINT</a>; it will also ignore <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_HINTING</a>. You have to set both <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_HINTING</a> and <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_AUTOHINT</a> to really disable hinting; however, you probably never want this except for demonstration purposes.</p>
-<p>Currently, there are about a dozen TrueType fonts in the list of tricky fonts; they are hard-coded in file &lsquo;ttobjs.c&rsquo;.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_HAS_HORIZONTAL">FT_HAS_HORIZONTAL</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_HAS_HORIZONTAL</b>( face ) \
-          ( face-&gt;face_flags &amp; <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_HORIZONTAL</a> )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro that returns true whenever a face object contains horizontal metrics (this is true for all font formats though).</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>also</b></em></td></tr><tr><td>
-<p><a href="ft2-base_interface.html#FT_HAS_VERTICAL">FT_HAS_VERTICAL</a> can be used to check for vertical metrics.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_HAS_VERTICAL">FT_HAS_VERTICAL</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_HAS_VERTICAL</b>( face ) \
-          ( face-&gt;face_flags &amp; <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_VERTICAL</a> )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro that returns true whenever a face object contains vertical metrics.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_HAS_KERNING">FT_HAS_KERNING</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_HAS_KERNING</b>( face ) \
-          ( face-&gt;face_flags &amp; <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_KERNING</a> )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro that returns true whenever a face object contains kerning data that can be accessed with <a href="ft2-base_interface.html#FT_Get_Kerning">FT_Get_Kerning</a>.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_IS_SCALABLE">FT_IS_SCALABLE</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_IS_SCALABLE</b>( face ) \
-          ( face-&gt;face_flags &amp; <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_SCALABLE</a> )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro that returns true whenever a face object contains a scalable font face (true for TrueType, Type&nbsp;1, Type&nbsp;42, CID, OpenType/CFF, and PFR font formats.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_IS_SFNT">FT_IS_SFNT</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_IS_SFNT</b>( face ) \
-          ( face-&gt;face_flags &amp; <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_SFNT</a> )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro that returns true whenever a face object contains a font whose format is based on the SFNT storage scheme. This usually means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded bitmap fonts.</p>
-<p>If this macro is true, all functions defined in <a href="ft2-header_file_macros.html#FT_SFNT_NAMES_H">FT_SFNT_NAMES_H</a> and <a href="ft2-header_file_macros.html#FT_TRUETYPE_TABLES_H">FT_TRUETYPE_TABLES_H</a> are available.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_IS_FIXED_WIDTH">FT_IS_FIXED_WIDTH</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_IS_FIXED_WIDTH</b>( face ) \
-          ( face-&gt;face_flags &amp; <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_FIXED_WIDTH</a> )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro that returns true whenever a face object contains a font face that contains fixed-width (or &lsquo;monospace&rsquo;, &lsquo;fixed-pitch&rsquo;, etc.) glyphs.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_HAS_FIXED_SIZES">FT_HAS_FIXED_SIZES</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_HAS_FIXED_SIZES</b>( face ) \
-          ( face-&gt;face_flags &amp; <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_FIXED_SIZES</a> )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro that returns true whenever a face object contains some embedded bitmaps. See the &lsquo;available_sizes&rsquo; field of the <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a> structure.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_HAS_FAST_GLYPHS">FT_HAS_FAST_GLYPHS</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_HAS_FAST_GLYPHS</b>( face )  0
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Deprecated.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_HAS_GLYPH_NAMES">FT_HAS_GLYPH_NAMES</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_HAS_GLYPH_NAMES</b>( face ) \
-          ( face-&gt;face_flags &amp; <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_GLYPH_NAMES</a> )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro that returns true whenever a face object contains some glyph names that can be accessed through <a href="ft2-base_interface.html#FT_Get_Glyph_Name">FT_Get_Glyph_Name</a>.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_HAS_MULTIPLE_MASTERS">FT_HAS_MULTIPLE_MASTERS</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_HAS_MULTIPLE_MASTERS</b>( face ) \
-          ( face-&gt;face_flags &amp; <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_MULTIPLE_MASTERS</a> )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro that returns true whenever a face object contains some multiple masters. The functions provided by <a href="ft2-header_file_macros.html#FT_MULTIPLE_MASTERS_H">FT_MULTIPLE_MASTERS_H</a> are then available to choose the exact design you want.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_IS_CID_KEYED">FT_IS_CID_KEYED</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_IS_CID_KEYED</b>( face ) \
-          ( face-&gt;face_flags &amp; <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_CID_KEYED</a> )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro that returns true whenever a face object contains a CID-keyed font. See the discussion of <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_CID_KEYED</a> for more details.</p>
-<p>If this macro is true, all functions defined in <a href="ft2-header_file_macros.html#FT_CID_H">FT_CID_H</a> are available.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_IS_TRICKY">FT_IS_TRICKY</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_IS_TRICKY</b>( face ) \
-          ( face-&gt;face_flags &amp; <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_TRICKY</a> )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro that returns true whenever a face represents a &lsquo;tricky&rsquo; font. See the discussion of <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_TRICKY</a> for more details.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_STYLE_FLAG_XXX">FT_STYLE_FLAG_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-base_interface.html#FT_STYLE_FLAG_XXX">FT_STYLE_FLAG_ITALIC</a>  ( 1 &lt;&lt; 0 )
-#define <a href="ft2-base_interface.html#FT_STYLE_FLAG_XXX">FT_STYLE_FLAG_BOLD</a>    ( 1 &lt;&lt; 1 )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of bit-flags used to indicate the style of a given face. These are used in the &lsquo;style_flags&rsquo; field of <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_STYLE_FLAG_ITALIC</b></td><td>
-<p>Indicates that a given face style is italic or oblique.</p>
-</td></tr>
-<tr valign=top><td><b>FT_STYLE_FLAG_BOLD</b></td><td>
-<p>Indicates that a given face is bold.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The style information as provided by FreeType is very basic. More details are beyond the scope and should be done on a higher level (for example, by analyzing various fields of the &lsquo;OS/2&rsquo; table in SFNT based fonts).</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Size_Internal">FT_Size_Internal</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Size_InternalRec_*  <b>FT_Size_Internal</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An opaque handle to an &lsquo;FT_Size_InternalRec&rsquo; structure, used to model private data of a given <a href="ft2-base_interface.html#FT_Size">FT_Size</a> object.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Size_Metrics">FT_Size_Metrics</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Size_Metrics_
-  {
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  x_ppem;      /* horizontal pixels per EM               */
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  y_ppem;      /* vertical pixels per EM                 */
-
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>   x_scale;     /* scaling values used to convert font    */
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>   y_scale;     /* units to 26.6 fractional pixels        */
-
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>     ascender;    /* ascender in 26.6 frac. pixels          */
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>     descender;   /* descender in 26.6 frac. pixels         */
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>     height;      /* text height in 26.6 frac. pixels       */
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>     max_advance; /* max horizontal advance, in 26.6 pixels */
-
-  } <b>FT_Size_Metrics</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>The size metrics structure gives the metrics of a size object.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>x_ppem</b></td><td>
-<p>The width of the scaled EM square in pixels, hence the term &lsquo;ppem&rsquo; (pixels per EM). It is also referred to as &lsquo;nominal width&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>y_ppem</b></td><td>
-<p>The height of the scaled EM square in pixels, hence the term &lsquo;ppem&rsquo; (pixels per EM). It is also referred to as &lsquo;nominal height&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>x_scale</b></td><td>
-<p>A 16.16 fractional scaling value used to convert horizontal metrics from font units to 26.6 fractional pixels. Only relevant for scalable font formats.</p>
-</td></tr>
-<tr valign=top><td><b>y_scale</b></td><td>
-<p>A 16.16 fractional scaling value used to convert vertical metrics from font units to 26.6 fractional pixels. Only relevant for scalable font formats.</p>
-</td></tr>
-<tr valign=top><td><b>ascender</b></td><td>
-<p>The ascender in 26.6 fractional pixels. See <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a> for the details.</p>
-</td></tr>
-<tr valign=top><td><b>descender</b></td><td>
-<p>The descender in 26.6 fractional pixels. See <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a> for the details.</p>
-</td></tr>
-<tr valign=top><td><b>height</b></td><td>
-<p>The height in 26.6 fractional pixels. See <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a> for the details.</p>
-</td></tr>
-<tr valign=top><td><b>max_advance</b></td><td>
-<p>The maximal advance width in 26.6 fractional pixels. See <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a> for the details.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The scaling values, if relevant, are determined first during a size changing operation. The remaining fields are then set by the driver. For scalable formats, they are usually set to scaled values of the corresponding fields in <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a>.</p>
-<p>Note that due to glyph hinting, these values might not be exact for certain fonts. Thus they must be treated as unreliable with an error margin of at least one pixel!</p>
-<p>Indeed, the only way to get the exact metrics is to render <i>all</i> glyphs. As this would be a definite performance hit, it is up to client applications to perform such computations.</p>
-<p>The FT_Size_Metrics structure is valid for bitmap fonts also.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_SizeRec">FT_SizeRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_SizeRec_
-  {
-    <a href="ft2-base_interface.html#FT_Face">FT_Face</a>           face;      /* parent face object              */
-    <a href="ft2-basic_types.html#FT_Generic">FT_Generic</a>        generic;   /* generic pointer for client uses */
-    <a href="ft2-base_interface.html#FT_Size_Metrics">FT_Size_Metrics</a>   metrics;   /* size metrics                    */
-    <a href="ft2-base_interface.html#FT_Size_Internal">FT_Size_Internal</a>  internal;
-
-  } <b>FT_SizeRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>FreeType root size class structure. A size object models a face object at a given size.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>Handle to the parent face object.</p>
-</td></tr>
-<tr valign=top><td><b>generic</b></td><td>
-<p>A typeless pointer, which is unused by the FreeType library or any of its drivers. It can be used by client applications to link their own data to each size object.</p>
-</td></tr>
-<tr valign=top><td><b>metrics</b></td><td>
-<p>Metrics for this size object. This field is read-only.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_SubGlyph">FT_SubGlyph</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_SubGlyphRec_*  <b>FT_SubGlyph</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>The subglyph structure is an internal object used to describe subglyphs (for example, in the case of composites).</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The subglyph implementation is not part of the high-level API, hence the forward structure declaration.</p>
-<p>You can however retrieve subglyph information with <a href="ft2-base_interface.html#FT_Get_SubGlyph_Info">FT_Get_SubGlyph_Info</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Slot_Internal">FT_Slot_Internal</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Slot_InternalRec_*  <b>FT_Slot_Internal</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An opaque handle to an &lsquo;FT_Slot_InternalRec&rsquo; structure, used to model private data of a given <a href="ft2-base_interface.html#FT_GlyphSlot">FT_GlyphSlot</a> object.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_GlyphSlotRec">FT_GlyphSlotRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_GlyphSlotRec_
-  {
-    <a href="ft2-base_interface.html#FT_Library">FT_Library</a>        library;
-    <a href="ft2-base_interface.html#FT_Face">FT_Face</a>           face;
-    <a href="ft2-base_interface.html#FT_GlyphSlot">FT_GlyphSlot</a>      next;
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>           reserved;       /* retained for binary compatibility */
-    <a href="ft2-basic_types.html#FT_Generic">FT_Generic</a>        generic;
-
-    <a href="ft2-base_interface.html#FT_Glyph_Metrics">FT_Glyph_Metrics</a>  metrics;
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>          linearHoriAdvance;
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>          linearVertAdvance;
-    <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>         advance;
-
-    <a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a>   format;
-
-    <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>         bitmap;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>            bitmap_left;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>            bitmap_top;
-
-    <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>        outline;
-
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>           num_subglyphs;
-    <a href="ft2-base_interface.html#FT_SubGlyph">FT_SubGlyph</a>       subglyphs;
-
-    <span class="keyword">void</span>*             control_data;
-    <span class="keyword">long</span>              control_len;
-
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>            lsb_delta;
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>            rsb_delta;
-
-    <span class="keyword">void</span>*             other;
-
-    <a href="ft2-base_interface.html#FT_Slot_Internal">FT_Slot_Internal</a>  internal;
-
-  } <b>FT_GlyphSlotRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>FreeType root glyph slot class structure. A glyph slot is a container where individual glyphs can be loaded, be they in outline or bitmap format.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the FreeType library instance this slot belongs to.</p>
-</td></tr>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the parent face object.</p>
-</td></tr>
-<tr valign=top><td><b>next</b></td><td>
-<p>In some cases (like some font tools), several glyph slots per face object can be a good thing. As this is rare, the glyph slots are listed through a direct, single-linked list using its &lsquo;next&rsquo; field.</p>
-</td></tr>
-<tr valign=top><td><b>generic</b></td><td>
-<p>A typeless pointer which is unused by the FreeType library or any of its drivers. It can be used by client applications to link their own data to each glyph slot object.</p>
-</td></tr>
-<tr valign=top><td><b>metrics</b></td><td>
-<p>The metrics of the last loaded glyph in the slot. The returned values depend on the last load flags (see the <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a> API function) and can be expressed either in 26.6 fractional pixels or font units.</p>
-<p>Note that even when the glyph image is transformed, the metrics are not.</p>
-</td></tr>
-<tr valign=top><td><b>linearHoriAdvance</b></td><td>
-<p>The advance width of the unhinted glyph. Its value is expressed in 16.16 fractional pixels, unless <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_LINEAR_DESIGN</a> is set when loading the glyph. This field can be important to perform correct WYSIWYG layout. Only relevant for outline glyphs.</p>
-</td></tr>
-<tr valign=top><td><b>linearVertAdvance</b></td><td>
-<p>The advance height of the unhinted glyph. Its value is expressed in 16.16 fractional pixels, unless <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_LINEAR_DESIGN</a> is set when loading the glyph. This field can be important to perform correct WYSIWYG layout. Only relevant for outline glyphs.</p>
-</td></tr>
-<tr valign=top><td><b>advance</b></td><td>
-<p>This shorthand is, depending on <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_IGNORE_TRANSFORM</a>, the transformed advance width for the glyph (in 26.6 fractional pixel format). As specified with <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_VERTICAL_LAYOUT</a>, it uses either the &lsquo;horiAdvance&rsquo; or the &lsquo;vertAdvance&rsquo; value of &lsquo;metrics&rsquo; field.</p>
-</td></tr>
-<tr valign=top><td><b>format</b></td><td>
-<p>This field indicates the format of the image contained in the glyph slot. Typically <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_BITMAP</a>, <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_OUTLINE</a>, or <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_COMPOSITE</a>, but others are possible.</p>
-</td></tr>
-<tr valign=top><td><b>bitmap</b></td><td>
-<p>This field is used as a bitmap descriptor when the slot format is <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_BITMAP</a>. Note that the address and content of the bitmap buffer can change between calls of <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a> and a few other functions.</p>
-</td></tr>
-<tr valign=top><td><b>bitmap_left</b></td><td>
-<p>This is the bitmap's left bearing expressed in integer pixels. Of course, this is only valid if the format is <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_BITMAP</a>.</p>
-</td></tr>
-<tr valign=top><td><b>bitmap_top</b></td><td>
-<p>This is the bitmap's top bearing expressed in integer pixels. Remember that this is the distance from the baseline to the top-most glyph scanline, upwards y&nbsp;coordinates being <b>positive</b>.</p>
-</td></tr>
-<tr valign=top><td><b>outline</b></td><td>
-<p>The outline descriptor for the current glyph image if its format is <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_OUTLINE</a>. Once a glyph is loaded, &lsquo;outline&rsquo; can be transformed, distorted, embolded, etc. However, it must not be freed.</p>
-</td></tr>
-<tr valign=top><td><b>num_subglyphs</b></td><td>
-<p>The number of subglyphs in a composite glyph. This field is only valid for the composite glyph format that should normally only be loaded with the <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_RECURSE</a> flag. For now this is internal to FreeType.</p>
-</td></tr>
-<tr valign=top><td><b>subglyphs</b></td><td>
-<p>An array of subglyph descriptors for composite glyphs. There are &lsquo;num_subglyphs&rsquo; elements in there. Currently internal to FreeType.</p>
-</td></tr>
-<tr valign=top><td><b>control_data</b></td><td>
-<p>Certain font drivers can also return the control data for a given glyph image (e.g. TrueType bytecode, Type&nbsp;1 charstrings, etc.). This field is a pointer to such data.</p>
-</td></tr>
-<tr valign=top><td><b>control_len</b></td><td>
-<p>This is the length in bytes of the control data.</p>
-</td></tr>
-<tr valign=top><td><b>other</b></td><td>
-<p>Really wicked formats can use this pointer to present their own glyph image to client applications. Note that the application needs to know about the image format.</p>
-</td></tr>
-<tr valign=top><td><b>lsb_delta</b></td><td>
-<p>The difference between hinted and unhinted left side bearing while autohinting is active. Zero otherwise.</p>
-</td></tr>
-<tr valign=top><td><b>rsb_delta</b></td><td>
-<p>The difference between hinted and unhinted right side bearing while autohinting is active. Zero otherwise.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>If <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a> is called with default flags (see <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_DEFAULT</a>) the glyph image is loaded in the glyph slot in its native format (e.g., an outline glyph for TrueType and Type&nbsp;1 formats).</p>
-<p>This image can later be converted into a bitmap by calling <a href="ft2-base_interface.html#FT_Render_Glyph">FT_Render_Glyph</a>. This function finds the current renderer for the native image's format, then invokes it.</p>
-<p>The renderer is in charge of transforming the native image through the slot's face transformation fields, then converting it into a bitmap that is returned in &lsquo;slot-&gt;bitmap&rsquo;.</p>
-<p>Note that &lsquo;slot-&gt;bitmap_left&rsquo; and &lsquo;slot-&gt;bitmap_top&rsquo; are also used to specify the position of the bitmap relative to the current pen position (e.g., coordinates (0,0) on the baseline). Of course, &lsquo;slot-&gt;format&rsquo; is also changed to <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_BITMAP</a>.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Here a small pseudo code fragment which shows how to use &lsquo;lsb_delta&rsquo; and &lsquo;rsb_delta&rsquo;:</p>
-<pre class="colored">
-  FT_Pos  origin_x       = 0;                                      
-  FT_Pos  prev_rsb_delta = 0;                                      
-                                                                   
-                                                                   
-  for all glyphs do                                                
-    &lt;compute kern between current and previous glyph and add it to 
-     `origin_x'&gt;                                                   
-                                                                   
-    &lt;load glyph with `FT_Load_Glyph'&gt;                              
-                                                                   
-    if ( prev_rsb_delta - face-&gt;glyph-&gt;lsb_delta &gt;= 32 )           
-      origin_x -= 64;                                              
-    else if ( prev_rsb_delta - face-&gt;glyph-&gt;lsb_delta &lt; -32 )      
-      origin_x += 64;                                              
-                                                                   
-    prev_rsb_delta = face-&gt;glyph-&gt;rsb_delta;                       
-                                                                   
-    &lt;save glyph image, or render glyph, or ...&gt;                    
-                                                                   
-    origin_x += face-&gt;glyph-&gt;advance.x;                            
-  endfor                                                           
-</pre>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Init_FreeType">FT_Init_FreeType</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Init_FreeType</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  *alibrary );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Initialize a new FreeType library object. The set of modules that are registered by this function is determined at build time.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>alibrary</b></td><td>
-<p>A handle to a new library object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>In case you want to provide your own memory allocating routines, use <a href="ft2-module_management.html#FT_New_Library">FT_New_Library</a> instead, followed by a call to <a href="ft2-module_management.html#FT_Add_Default_Modules">FT_Add_Default_Modules</a> (or a series of calls to <a href="ft2-module_management.html#FT_Add_Module">FT_Add_Module</a>).</p>
-<p>For multi-threading applications each thread should have its own FT_Library object.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Done_FreeType">FT_Done_FreeType</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Done_FreeType</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Destroy a given FreeType library object and all of its children, including resources, drivers, faces, sizes, etc.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the target library object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_OPEN_XXX">FT_OPEN_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_MEMORY</a>    0x1
-#define <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_STREAM</a>    0x2
-#define <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_PATHNAME</a>  0x4
-#define <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_DRIVER</a>    0x8
-#define <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_PARAMS</a>    0x10
-
-#define <a href="ft2-base_interface.html#FT_OPEN_XXX">ft_open_memory</a>    <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_MEMORY</a>     /* deprecated */
-#define <a href="ft2-base_interface.html#FT_OPEN_XXX">ft_open_stream</a>    <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_STREAM</a>     /* deprecated */
-#define <a href="ft2-base_interface.html#FT_OPEN_XXX">ft_open_pathname</a>  <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_PATHNAME</a>   /* deprecated */
-#define <a href="ft2-base_interface.html#FT_OPEN_XXX">ft_open_driver</a>    <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_DRIVER</a>     /* deprecated */
-#define <a href="ft2-base_interface.html#FT_OPEN_XXX">ft_open_params</a>    <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_PARAMS</a>     /* deprecated */
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of bit-field constants used within the &lsquo;flags&rsquo; field of the <a href="ft2-base_interface.html#FT_Open_Args">FT_Open_Args</a> structure.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_OPEN_MEMORY</b></td><td>
-<p>This is a memory-based stream.</p>
-</td></tr>
-<tr valign=top><td><b>FT_OPEN_STREAM</b></td><td>
-<p>Copy the stream from the &lsquo;stream&rsquo; field.</p>
-</td></tr>
-<tr valign=top><td><b>FT_OPEN_PATHNAME</b></td><td>
-<p>Create a new input stream from a C&nbsp;path name.</p>
-</td></tr>
-<tr valign=top><td><b>FT_OPEN_DRIVER</b></td><td>
-<p>Use the &lsquo;driver&rsquo; field.</p>
-</td></tr>
-<tr valign=top><td><b>FT_OPEN_PARAMS</b></td><td>
-<p>Use the &lsquo;num_params&rsquo; and &lsquo;params&rsquo; fields.</p>
-</td></tr>
-<tr valign=top><td><b>ft_open_memory</b></td><td>
-<p>Deprecated; use <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_MEMORY</a> instead.</p>
-</td></tr>
-<tr valign=top><td><b>ft_open_stream</b></td><td>
-<p>Deprecated; use <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_STREAM</a> instead.</p>
-</td></tr>
-<tr valign=top><td><b>ft_open_pathname</b></td><td>
-<p>Deprecated; use <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_PATHNAME</a> instead.</p>
-</td></tr>
-<tr valign=top><td><b>ft_open_driver</b></td><td>
-<p>Deprecated; use <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_DRIVER</a> instead.</p>
-</td></tr>
-<tr valign=top><td><b>ft_open_params</b></td><td>
-<p>Deprecated; use <a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_PARAMS</a> instead.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The &lsquo;FT_OPEN_MEMORY&rsquo;, &lsquo;FT_OPEN_STREAM&rsquo;, and &lsquo;FT_OPEN_PATHNAME&rsquo; flags are mutually exclusive.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Parameter">FT_Parameter</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Parameter_
-  {
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>    tag;
-    <a href="ft2-basic_types.html#FT_Pointer">FT_Pointer</a>  data;
-
-  } <b>FT_Parameter</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A simple structure used to pass more or less generic parameters to <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>tag</b></td><td>
-<p>A four-byte identification tag.</p>
-</td></tr>
-<tr valign=top><td><b>data</b></td><td>
-<p>A pointer to the parameter data.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The ID and function of parameters are driver-specific. See the various FT_PARAM_TAG_XXX flags for more information.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Open_Args">FT_Open_Args</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Open_Args_
-  {
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>         flags;
-    <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>*  memory_base;
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>         memory_size;
-    <a href="ft2-basic_types.html#FT_String">FT_String</a>*      pathname;
-    <a href="ft2-system_interface.html#FT_Stream">FT_Stream</a>       stream;
-    <a href="ft2-base_interface.html#FT_Module">FT_Module</a>       driver;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>          num_params;
-    <a href="ft2-base_interface.html#FT_Parameter">FT_Parameter</a>*   params;
-
-  } <b>FT_Open_Args</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to indicate how to open a new font file or stream. A pointer to such a structure can be used as a parameter for the functions <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a> and <a href="ft2-base_interface.html#FT_Attach_Stream">FT_Attach_Stream</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>flags</b></td><td>
-<p>A set of bit flags indicating how to use the structure.</p>
-</td></tr>
-<tr valign=top><td><b>memory_base</b></td><td>
-<p>The first byte of the file in memory.</p>
-</td></tr>
-<tr valign=top><td><b>memory_size</b></td><td>
-<p>The size in bytes of the file in memory.</p>
-</td></tr>
-<tr valign=top><td><b>pathname</b></td><td>
-<p>A pointer to an 8-bit file pathname.</p>
-</td></tr>
-<tr valign=top><td><b>stream</b></td><td>
-<p>A handle to a source stream object.</p>
-</td></tr>
-<tr valign=top><td><b>driver</b></td><td>
-<p>This field is exclusively used by <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a>; it simply specifies the font driver to use to open the face. If set to&nbsp;0, FreeType tries to load the face with each one of the drivers in its list.</p>
-</td></tr>
-<tr valign=top><td><b>num_params</b></td><td>
-<p>The number of extra parameters.</p>
-</td></tr>
-<tr valign=top><td><b>params</b></td><td>
-<p>Extra parameters passed to the font driver when opening a new face.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The stream type is determined by the contents of &lsquo;flags&rsquo; which are tested in the following order by <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a>:</p>
-<p>If the &lsquo;FT_OPEN_MEMORY&rsquo; bit is set, assume that this is a memory file of &lsquo;memory_size&rsquo; bytes, located at &lsquo;memory_address&rsquo;. The data are are not copied, and the client is responsible for releasing and destroying them <i>after</i> the corresponding call to <a href="ft2-base_interface.html#FT_Done_Face">FT_Done_Face</a>.</p>
-<p>Otherwise, if the &lsquo;FT_OPEN_STREAM&rsquo; bit is set, assume that a custom input stream &lsquo;stream&rsquo; is used.</p>
-<p>Otherwise, if the &lsquo;FT_OPEN_PATHNAME&rsquo; bit is set, assume that this is a normal file and use &lsquo;pathname&rsquo; to open it.</p>
-<p>If the &lsquo;FT_OPEN_DRIVER&rsquo; bit is set, <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a> only tries to open the file with the driver whose handler is in &lsquo;driver&rsquo;.</p>
-<p>If the &lsquo;FT_OPEN_PARAMS&rsquo; bit is set, the parameters given by &lsquo;num_params&rsquo; and &lsquo;params&rsquo; is used. They are ignored otherwise.</p>
-<p>Ideally, both the &lsquo;pathname&rsquo; and &lsquo;params&rsquo; fields should be tagged as &lsquo;const&rsquo;; this is missing for API backwards compatibility. In other words, applications should treat them as read-only.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_New_Face">FT_New_Face</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_New_Face</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>   library,
-               <span class="keyword">const</span> <span class="keyword">char</span>*  filepathname,
-               <a href="ft2-basic_types.html#FT_Long">FT_Long</a>      face_index,
-               <a href="ft2-base_interface.html#FT_Face">FT_Face</a>     *aface );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This function calls <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a> to open a font by its pathname.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the library resource.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>pathname</b></td><td>
-<p>A path to the font file.</p>
-</td></tr>
-<tr valign=top><td><b>face_index</b></td><td>
-<p>The index of the face within the font. The first face has index&nbsp;0.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aface</b></td><td>
-<p>A handle to a new face object. If &lsquo;face_index&rsquo; is greater than or equal to zero, it must be non-NULL. See <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a> for more details.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_New_Memory_Face">FT_New_Memory_Face</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_New_Memory_Face</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>      library,
-                      <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>*  file_base,
-                      <a href="ft2-basic_types.html#FT_Long">FT_Long</a>         file_size,
-                      <a href="ft2-basic_types.html#FT_Long">FT_Long</a>         face_index,
-                      <a href="ft2-base_interface.html#FT_Face">FT_Face</a>        *aface );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This function calls <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a> to open a font which has been loaded into memory.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the library resource.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>file_base</b></td><td>
-<p>A pointer to the beginning of the font data.</p>
-</td></tr>
-<tr valign=top><td><b>file_size</b></td><td>
-<p>The size of the memory chunk used by the font data.</p>
-</td></tr>
-<tr valign=top><td><b>face_index</b></td><td>
-<p>The index of the face within the font. The first face has index&nbsp;0.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aface</b></td><td>
-<p>A handle to a new face object. If &lsquo;face_index&rsquo; is greater than or equal to zero, it must be non-NULL. See <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a> for more details.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>You must not deallocate the memory before calling <a href="ft2-base_interface.html#FT_Done_Face">FT_Done_Face</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Open_Face">FT_Open_Face</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Open_Face</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>           library,
-                <span class="keyword">const</span> <a href="ft2-base_interface.html#FT_Open_Args">FT_Open_Args</a>*  args,
-                <a href="ft2-basic_types.html#FT_Long">FT_Long</a>              face_index,
-                <a href="ft2-base_interface.html#FT_Face">FT_Face</a>             *aface );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Create a face object from a given resource described by <a href="ft2-base_interface.html#FT_Open_Args">FT_Open_Args</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the library resource.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>args</b></td><td>
-<p>A pointer to an &lsquo;FT_Open_Args&rsquo; structure which must be filled by the caller.</p>
-</td></tr>
-<tr valign=top><td><b>face_index</b></td><td>
-<p>The index of the face within the font. The first face has index&nbsp;0.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aface</b></td><td>
-<p>A handle to a new face object. If &lsquo;face_index&rsquo; is greater than or equal to zero, it must be non-NULL. See note below.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Unlike FreeType 1.x, this function automatically creates a glyph slot for the face object which can be accessed directly through &lsquo;face-&gt;glyph&rsquo;.</p>
-<p>FT_Open_Face can be used to quickly check whether the font format of a given font resource is supported by FreeType. If the &lsquo;face_index&rsquo; field is negative, the function's return value is&nbsp;0 if the font format is recognized, or non-zero otherwise; the function returns a more or less empty face handle in &lsquo;*aface&rsquo; (if &lsquo;aface&rsquo; isn't NULL). The only useful field in this special case is &lsquo;face-&gt;num_faces&rsquo; which gives the number of faces within the font file. After examination, the returned <a href="ft2-base_interface.html#FT_Face">FT_Face</a> structure should be deallocated with a call to <a href="ft2-base_interface.html#FT_Done_Face">FT_Done_Face</a>.</p>
-<p>Each new face object created with this function also owns a default <a href="ft2-base_interface.html#FT_Size">FT_Size</a> object, accessible as &lsquo;face-&gt;size&rsquo;.</p>
-<p>One <a href="ft2-base_interface.html#FT_Library">FT_Library</a> instance can have multiple face objects, this is, <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a> and its siblings can be called multiple times using the same &lsquo;library&rsquo; argument.</p>
-<p>See the discussion of reference counters in the description of <a href="ft2-base_interface.html#FT_Reference_Face">FT_Reference_Face</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Attach_File">FT_Attach_File</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Attach_File</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>      face,
-                  <span class="keyword">const</span> <span class="keyword">char</span>*  filepathname );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This function calls <a href="ft2-base_interface.html#FT_Attach_Stream">FT_Attach_Stream</a> to attach a file.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>The target face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>filepathname</b></td><td>
-<p>The pathname.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Attach_Stream">FT_Attach_Stream</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Attach_Stream</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>        face,
-                    <a href="ft2-base_interface.html#FT_Open_Args">FT_Open_Args</a>*  parameters );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>&lsquo;Attach&rsquo; data to a face object. Normally, this is used to read additional information for the face object. For example, you can attach an AFM file that comes with a Type&nbsp;1 font to get the kerning values and other metrics.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>The target face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>parameters</b></td><td>
-<p>A pointer to <a href="ft2-base_interface.html#FT_Open_Args">FT_Open_Args</a> which must be filled by the caller.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The meaning of the &lsquo;attach&rsquo; (i.e., what really happens when the new file is read) is not fixed by FreeType itself. It really depends on the font format (and thus the font driver).</p>
-<p>Client applications are expected to know what they are doing when invoking this function. Most drivers simply do not implement file attachments.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Reference_Face">FT_Reference_Face</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Reference_Face</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>  face );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A counter gets initialized to&nbsp;1 at the time an <a href="ft2-base_interface.html#FT_Face">FT_Face</a> structure is created. This function increments the counter. <a href="ft2-base_interface.html#FT_Done_Face">FT_Done_Face</a> then only destroys a face if the counter is&nbsp;1, otherwise it simply decrements the counter.</p>
-<p>This function helps in managing life-cycles of structures which reference <a href="ft2-base_interface.html#FT_Face">FT_Face</a> objects.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to a target face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.4.2</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Done_Face">FT_Done_Face</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Done_Face</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>  face );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Discard a given face object, as well as all of its child slots and sizes.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to a target face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>See the discussion of reference counters in the description of <a href="ft2-base_interface.html#FT_Reference_Face">FT_Reference_Face</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Select_Size">FT_Select_Size</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Select_Size</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>  face,
-                  <a href="ft2-basic_types.html#FT_Int">FT_Int</a>   strike_index );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Select a bitmap strike.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to a target face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>strike_index</b></td><td>
-<p>The index of the bitmap strike in the &lsquo;available_sizes&rsquo; field of <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a> structure.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Size_Request_Type">FT_Size_Request_Type</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_Size_Request_Type_
-  {
-    <a href="ft2-base_interface.html#FT_Size_Request_Type">FT_SIZE_REQUEST_TYPE_NOMINAL</a>,
-    <a href="ft2-base_interface.html#FT_Size_Request_Type">FT_SIZE_REQUEST_TYPE_REAL_DIM</a>,
-    <a href="ft2-base_interface.html#FT_Size_Request_Type">FT_SIZE_REQUEST_TYPE_BBOX</a>,
-    <a href="ft2-base_interface.html#FT_Size_Request_Type">FT_SIZE_REQUEST_TYPE_CELL</a>,
-    <a href="ft2-base_interface.html#FT_Size_Request_Type">FT_SIZE_REQUEST_TYPE_SCALES</a>,
-
-    FT_SIZE_REQUEST_TYPE_MAX
-
-  } <b>FT_Size_Request_Type</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An enumeration type that lists the supported size request types.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td colspan=0><b>FT_SIZE_REQUEST_TYPE_NOMINAL</b></td></tr>
-<tr valign=top><td></td><td>
-<p>The nominal size. The &lsquo;units_per_EM&rsquo; field of <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a> is used to determine both scaling values.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_SIZE_REQUEST_TYPE_REAL_DIM</b></td></tr>
-<tr valign=top><td></td><td>
-<p>The real dimension. The sum of the the &lsquo;ascender&rsquo; and (minus of) the &lsquo;descender&rsquo; fields of <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a> are used to determine both scaling values.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_SIZE_REQUEST_TYPE_BBOX</b></td></tr>
-<tr valign=top><td></td><td>
-<p>The font bounding box. The width and height of the &lsquo;bbox&rsquo; field of <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a> are used to determine the horizontal and vertical scaling value, respectively.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_SIZE_REQUEST_TYPE_CELL</b></td></tr>
-<tr valign=top><td></td><td>
-<p>The &lsquo;max_advance_width&rsquo; field of <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a> is used to determine the horizontal scaling value; the vertical scaling value is determined the same way as <a href="ft2-base_interface.html#FT_Size_Request_Type">FT_SIZE_REQUEST_TYPE_REAL_DIM</a> does. Finally, both scaling values are set to the smaller one. This type is useful if you want to specify the font size for, say, a window of a given dimension and 80x24 cells.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_SIZE_REQUEST_TYPE_SCALES</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Specify the scaling values directly.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The above descriptions only apply to scalable formats. For bitmap formats, the behaviour is up to the driver.</p>
-<p>See the note section of <a href="ft2-base_interface.html#FT_Size_Metrics">FT_Size_Metrics</a> if you wonder how size requesting relates to scaling values.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Size_RequestRec">FT_Size_RequestRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Size_RequestRec_
-  {
-    <a href="ft2-base_interface.html#FT_Size_Request_Type">FT_Size_Request_Type</a>  type;
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>               width;
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>               height;
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>               horiResolution;
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>               vertResolution;
-
-  } <b>FT_Size_RequestRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model a size request.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>type</b></td><td>
-<p>See <a href="ft2-base_interface.html#FT_Size_Request_Type">FT_Size_Request_Type</a>.</p>
-</td></tr>
-<tr valign=top><td><b>width</b></td><td>
-<p>The desired width.</p>
-</td></tr>
-<tr valign=top><td><b>height</b></td><td>
-<p>The desired height.</p>
-</td></tr>
-<tr valign=top><td><b>horiResolution</b></td><td>
-<p>The horizontal resolution. If set to zero, &lsquo;width&rsquo; is treated as a 26.6 fractional pixel value.</p>
-</td></tr>
-<tr valign=top><td><b>vertResolution</b></td><td>
-<p>The vertical resolution. If set to zero, &lsquo;height&rsquo; is treated as a 26.6 fractional pixel value.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>If &lsquo;width&rsquo; is zero, then the horizontal scaling value is set equal to the vertical scaling value, and vice versa.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Size_Request">FT_Size_Request</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Size_RequestRec_  *<b>FT_Size_Request</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a size request structure.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Request_Size">FT_Request_Size</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Request_Size</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>          face,
-                   <a href="ft2-base_interface.html#FT_Size_Request">FT_Size_Request</a>  req );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Resize the scale of the active <a href="ft2-base_interface.html#FT_Size">FT_Size</a> object in a face.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to a target face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>req</b></td><td>
-<p>A pointer to a <a href="ft2-base_interface.html#FT_Size_RequestRec">FT_Size_RequestRec</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Although drivers may select the bitmap strike matching the request, you should not rely on this if you intend to select a particular bitmap strike. Use <a href="ft2-base_interface.html#FT_Select_Size">FT_Select_Size</a> instead in that case.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Set_Char_Size">FT_Set_Char_Size</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Set_Char_Size</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>     face,
-                    <a href="ft2-basic_types.html#FT_F26Dot6">FT_F26Dot6</a>  char_width,
-                    <a href="ft2-basic_types.html#FT_F26Dot6">FT_F26Dot6</a>  char_height,
-                    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     horz_resolution,
-                    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     vert_resolution );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This function calls <a href="ft2-base_interface.html#FT_Request_Size">FT_Request_Size</a> to request the nominal size (in points).</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to a target face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>char_width</b></td><td>
-<p>The nominal width, in 26.6 fractional points.</p>
-</td></tr>
-<tr valign=top><td><b>char_height</b></td><td>
-<p>The nominal height, in 26.6 fractional points.</p>
-</td></tr>
-<tr valign=top><td><b>horz_resolution</b></td><td>
-<p>The horizontal resolution in dpi.</p>
-</td></tr>
-<tr valign=top><td><b>vert_resolution</b></td><td>
-<p>The vertical resolution in dpi.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>If either the character width or height is zero, it is set equal to the other value.</p>
-<p>If either the horizontal or vertical resolution is zero, it is set equal to the other value.</p>
-<p>A character width or height smaller than 1pt is set to 1pt; if both resolution values are zero, they are set to 72dpi.</p>
-<p>Don't use this function if you are using the FreeType cache API.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Set_Pixel_Sizes">FT_Set_Pixel_Sizes</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Set_Pixel_Sizes</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>  face,
-                      <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>  pixel_width,
-                      <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>  pixel_height );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This function calls <a href="ft2-base_interface.html#FT_Request_Size">FT_Request_Size</a> to request the nominal size (in pixels).</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the target face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>pixel_width</b></td><td>
-<p>The nominal width, in pixels.</p>
-</td></tr>
-<tr valign=top><td><b>pixel_height</b></td><td>
-<p>The nominal height, in pixels.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Load_Glyph">FT_Load_Glyph</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Load_Glyph</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                 <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>   glyph_index,
-                 <a href="ft2-basic_types.html#FT_Int32">FT_Int32</a>  load_flags );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to load a single glyph into the glyph slot of a face object.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the target face object where the glyph is loaded.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>glyph_index</b></td><td>
-<p>The index of the glyph in the font file. For CID-keyed fonts (either in PS or in CFF format) this argument specifies the CID value.</p>
-</td></tr>
-<tr valign=top><td><b>load_flags</b></td><td>
-<p>A flag indicating what to load for this glyph. The <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_XXX</a> 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).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The loaded glyph may be transformed. See <a href="ft2-base_interface.html#FT_Set_Transform">FT_Set_Transform</a> for the details.</p>
-<p>For subsetted CID-keyed fonts, &lsquo;FT_Err_Invalid_Argument&rsquo; is returned for invalid CID values (this is, for CID values which don't have a corresponding glyph in the font). See the discussion of the <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_CID_KEYED</a> flag for more details.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Load_Char">FT_Load_Char</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Load_Char</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  char_code,
-                <a href="ft2-basic_types.html#FT_Int32">FT_Int32</a>  load_flags );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to load a single glyph into the glyph slot of a face object, according to its character code.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to a target face object where the glyph is loaded.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>char_code</b></td><td>
-<p>The glyph's character code, according to the current charmap used in the face.</p>
-</td></tr>
-<tr valign=top><td><b>load_flags</b></td><td>
-<p>A flag indicating what to load for this glyph. The <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_XXX</a> 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).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function simply calls <a href="ft2-base_interface.html#FT_Get_Char_Index">FT_Get_Char_Index</a> and <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_LOAD_XXX">FT_LOAD_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_DEFAULT</a>                      0x0
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a>                     ( 1L &lt;&lt; 0 )
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_HINTING</a>                   ( 1L &lt;&lt; 1 )
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_RENDER</a>                       ( 1L &lt;&lt; 2 )
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_BITMAP</a>                    ( 1L &lt;&lt; 3 )
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_VERTICAL_LAYOUT</a>              ( 1L &lt;&lt; 4 )
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_FORCE_AUTOHINT</a>               ( 1L &lt;&lt; 5 )
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_CROP_BITMAP</a>                  ( 1L &lt;&lt; 6 )
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_PEDANTIC</a>                     ( 1L &lt;&lt; 7 )
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH</a>  ( 1L &lt;&lt; 9 )
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_RECURSE</a>                   ( 1L &lt;&lt; 10 )
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_IGNORE_TRANSFORM</a>             ( 1L &lt;&lt; 11 )
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_MONOCHROME</a>                   ( 1L &lt;&lt; 12 )
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_LINEAR_DESIGN</a>                ( 1L &lt;&lt; 13 )
-#define <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_AUTOHINT</a>                  ( 1L &lt;&lt; 15 )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of bit-field constants used with <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a> to indicate what kind of operations to perform during glyph loading.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_LOAD_DEFAULT</b></td><td>
-<p>Corresponding to&nbsp;0, this value is used as the default glyph load operation. In this case, the following happens:</p>
-<p>1. FreeType looks for a bitmap for the glyph corresponding to the face's current size. If one is found, the function returns. The bitmap data can be accessed from the glyph slot (see note below).</p>
-<p>2. If no embedded bitmap is searched or found, FreeType looks for a scalable outline. If one is found, it is loaded from the font file, scaled to device pixels, then &lsquo;hinted&rsquo; to the pixel grid in order to optimize it. The outline data can be accessed from the glyph slot (see note below).</p>
-<p>Note that by default, the glyph loader doesn't render outlines into bitmaps. The following flags are used to modify this default behaviour to more specific and useful cases.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_NO_SCALE</b></td><td>
-<p>Don't scale the outline glyph loaded, but keep it in font units.</p>
-<p>This flag implies <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_HINTING</a> and <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_BITMAP</a>, and unsets <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_RENDER</a>.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_NO_HINTING</b></td><td>
-<p>Disable hinting. This generally generates &lsquo;blurrier&rsquo; bitmap glyph when the glyph is rendered in any of the anti-aliased modes. See also the note below.</p>
-<p>This flag is implied by <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a>.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_RENDER</b></td><td>
-<p>Call <a href="ft2-base_interface.html#FT_Render_Glyph">FT_Render_Glyph</a> after the glyph is loaded. By default, the glyph is rendered in <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_NORMAL</a> mode. This can be overridden by <a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_XXX</a> or <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_MONOCHROME</a>.</p>
-<p>This flag is unset by <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a>.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_NO_BITMAP</b></td><td>
-<p>Ignore bitmap strikes when loading. Bitmap-only fonts ignore this flag.</p>
-<p><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a> always sets this flag.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_LOAD_VERTICAL_LAYOUT</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Load the glyph for vertical text layout. <i>Don't</i> use it as it is problematic currently.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_FORCE_AUTOHINT</b></td><td>
-<p>Indicates that the auto-hinter is preferred over the font's native hinter. See also the note below.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_CROP_BITMAP</b></td><td>
-<p>Indicates that the font driver should crop the loaded bitmap glyph (i.e., remove all space around its black bits). Not all drivers implement this.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_PEDANTIC</b></td><td>
-<p>Indicates that the font driver should perform pedantic verifications during glyph loading. This is mostly used to detect broken glyphs in fonts. By default, FreeType tries to handle broken fonts also.</p>
-<p>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.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Ignored. Deprecated.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_NO_RECURSE</b></td><td>
-<p>This flag is only used internally. It merely indicates that the font driver should not load composite glyphs recursively. Instead, it should set the &lsquo;num_subglyph&rsquo; and &lsquo;subglyphs&rsquo; values of the glyph slot accordingly, and set &lsquo;glyph-&gt;format&rsquo; to <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_COMPOSITE</a>.</p>
-<p>The description of sub-glyphs is not available to client applications for now.</p>
-<p>This flag implies <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a> and <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_IGNORE_TRANSFORM</a>.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_LOAD_IGNORE_TRANSFORM</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Indicates that the transform matrix set by <a href="ft2-base_interface.html#FT_Set_Transform">FT_Set_Transform</a> should be ignored.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_MONOCHROME</b></td><td>
-<p>This flag is used with <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_RENDER</a> to indicate that you want to render an outline glyph to a 1-bit monochrome bitmap glyph, with 8&nbsp;pixels packed into each byte of the bitmap data.</p>
-<p>Note that this has no effect on the hinting algorithm used. You should rather use <a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_MONO</a> so that the monochrome-optimized hinting algorithm is used.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_LINEAR_DESIGN</b></td><td>
-<p>Indicates that the &lsquo;linearHoriAdvance&rsquo; and &lsquo;linearVertAdvance&rsquo; fields of <a href="ft2-base_interface.html#FT_GlyphSlotRec">FT_GlyphSlotRec</a> should be kept in font units. See <a href="ft2-base_interface.html#FT_GlyphSlotRec">FT_GlyphSlotRec</a> for details.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_NO_AUTOHINT</b></td><td>
-<p>Disable auto-hinter. See also the note below.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>By default, hinting is enabled and the font's native hinter (see <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_HINTER</a>) is preferred over the auto-hinter. You can disable hinting by setting <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_HINTING</a> or change the precedence by setting <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_FORCE_AUTOHINT</a>. You can also set <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_AUTOHINT</a> in case you don't want the auto-hinter to be used at all.</p>
-<p>See the description of <a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_TRICKY</a> for a special exception (affecting only a handful of Asian fonts).</p>
-<p>Besides deciding which hinter to use, you can also decide which hinting algorithm to use. See <a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_XXX</a> for details.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define FT_LOAD_TARGET_( x )   ( (<a href="ft2-basic_types.html#FT_Int32">FT_Int32</a>)( (x) &amp; 15 ) &lt;&lt; 16 )
-
-#define <a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_NORMAL</a>  FT_LOAD_TARGET_( <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_NORMAL</a> )
-#define <a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_LIGHT</a>   FT_LOAD_TARGET_( <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LIGHT</a>  )
-#define <a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_MONO</a>    FT_LOAD_TARGET_( <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_MONO</a>   )
-#define <a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_LCD</a>     FT_LOAD_TARGET_( <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LCD</a>    )
-#define <a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_LCD_V</a>   FT_LOAD_TARGET_( <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LCD_V</a>  )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of values that are used to select a specific hinting algorithm to use by the hinter. You should OR one of these values to your &lsquo;load_flags&rsquo; when calling <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a>.</p>
-<p>Note that font's native hinters may ignore the hinting algorithm you have specified (e.g., the TrueType bytecode interpreter). You can set <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_FORCE_AUTOHINT</a> to ensure that the auto-hinter is used.</p>
-<p>Also note that <a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_LIGHT</a> is an exception, in that it always implies <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_FORCE_AUTOHINT</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_LOAD_TARGET_NORMAL</b></td><td>
-<p>This corresponds to the default hinting algorithm, optimized for standard gray-level rendering. For monochrome output, use <a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_MONO</a> instead.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_TARGET_LIGHT</b></td><td>
-<p>A lighter hinting algorithm for non-monochrome modes. Many generated glyphs are more fuzzy but better resemble its original shape. A bit like rendering on Mac OS&nbsp;X.</p>
-<p>As a special exception, this target implies <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_FORCE_AUTOHINT</a>.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_TARGET_MONO</b></td><td>
-<p>Strong hinting algorithm that should only be used for monochrome output. The result is probably unpleasant if the glyph is rendered in non-monochrome modes.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_TARGET_LCD</b></td><td>
-<p>A variant of <a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_NORMAL</a> optimized for horizontally decimated LCD displays.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LOAD_TARGET_LCD_V</b></td><td>
-<p>A variant of <a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_NORMAL</a> optimized for vertically decimated LCD displays.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>You should use only <i>one</i> of the FT_LOAD_TARGET_XXX values in your &lsquo;load_flags&rsquo;. They can't be ORed.</p>
-<p>If <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_RENDER</a> is also set, the glyph is rendered in the corresponding mode (i.e., the mode which matches the used algorithm best) unless <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_MONOCHROME</a> is set.</p>
-<p>You can use a hinting algorithm that doesn't correspond to the same rendering mode. As an example, it is possible to use the &lsquo;light&rsquo; hinting algorithm and have the results rendered in horizontal LCD pixel mode, with code like</p>
-<pre class="colored">
-  FT_Load_Glyph( face, glyph_index,
-                 load_flags | FT_LOAD_TARGET_LIGHT );
-
-  FT_Render_Glyph( face-&gt;glyph, FT_RENDER_MODE_LCD );
-</pre>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_LOAD_TARGET_MODE">FT_LOAD_TARGET_MODE</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_LOAD_TARGET_MODE</b>( x )  ( (<a href="ft2-base_interface.html#FT_Render_Mode">FT_Render_Mode</a>)( ( (x) &gt;&gt; 16 ) &amp; 15 ) )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the <a href="ft2-base_interface.html#FT_Render_Mode">FT_Render_Mode</a> corresponding to a given <a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_XXX</a> value.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Set_Transform">FT_Set_Transform</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Set_Transform</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>     face,
-                    <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>*  matrix,
-                    <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  delta );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to set the transformation that is applied to glyph images when they are loaded into a glyph slot through <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>matrix</b></td><td>
-<p>A pointer to the transformation's 2x2 matrix. Use&nbsp;0 for the identity matrix.</p>
-</td></tr>
-<tr valign=top><td><b>delta</b></td><td>
-<p>A pointer to the translation vector. Use&nbsp;0 for the null vector.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The transformation is only applied to scalable image formats after the glyph has been loaded. It means that hinting is unaltered by the transformation and is performed on the character size given in the last call to <a href="ft2-base_interface.html#FT_Set_Char_Size">FT_Set_Char_Size</a> or <a href="ft2-base_interface.html#FT_Set_Pixel_Sizes">FT_Set_Pixel_Sizes</a>.</p>
-<p>Note that this also transforms the &lsquo;face.glyph.advance&rsquo; field, but <b>not</b> the values in &lsquo;face.glyph.metrics&rsquo;.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Render_Mode">FT_Render_Mode</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_Render_Mode_
-  {
-    <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_NORMAL</a> = 0,
-    <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LIGHT</a>,
-    <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_MONO</a>,
-    <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LCD</a>,
-    <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LCD_V</a>,
-
-    FT_RENDER_MODE_MAX
-
-  } <b>FT_Render_Mode</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An enumeration type that lists the render modes supported by FreeType&nbsp;2. Each mode corresponds to a specific type of scanline conversion performed on the outline.</p>
-<p>For bitmap fonts and embedded bitmaps the &lsquo;bitmap-&gt;pixel_mode&rsquo; field in the <a href="ft2-base_interface.html#FT_GlyphSlotRec">FT_GlyphSlotRec</a> structure gives the format of the returned bitmap.</p>
-<p>All modes except <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_MONO</a> use 256 levels of opacity.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_RENDER_MODE_NORMAL</b></td><td>
-<p>This is the default render mode; it corresponds to 8-bit anti-aliased bitmaps.</p>
-</td></tr>
-<tr valign=top><td><b>FT_RENDER_MODE_LIGHT</b></td><td>
-<p>This is equivalent to <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_NORMAL</a>. It is only defined as a separate value because render modes are also used indirectly to define hinting algorithm selectors. See <a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_XXX</a> for details.</p>
-</td></tr>
-<tr valign=top><td><b>FT_RENDER_MODE_MONO</b></td><td>
-<p>This mode corresponds to 1-bit bitmaps (with 2&nbsp;levels of opacity).</p>
-</td></tr>
-<tr valign=top><td><b>FT_RENDER_MODE_LCD</b></td><td>
-<p>This mode corresponds to horizontal RGB and BGR sub-pixel displays like LCD screens. It produces 8-bit bitmaps that are 3&nbsp;times the width of the original glyph outline in pixels, and which use the <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_LCD</a> mode.</p>
-</td></tr>
-<tr valign=top><td><b>FT_RENDER_MODE_LCD_V</b></td><td>
-<p>This mode corresponds to vertical RGB and BGR sub-pixel displays (like PDA screens, rotated LCD displays, etc.). It produces 8-bit bitmaps that are 3&nbsp;times the height of the original glyph outline in pixels and use the <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_LCD_V</a> mode.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be filtered to reduce color-fringes by using <a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a> (not active in the default builds). It is up to the caller to either call <a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a> (if available) or do the filtering itself.</p>
-<p>The selected render mode only affects vector glyphs of a font. Embedded bitmaps often have a different pixel mode like <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_MONO</a>. You can use <a href="ft2-bitmap_handling.html#FT_Bitmap_Convert">FT_Bitmap_Convert</a> to transform them into 8-bit pixmaps.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="ft_render_mode_xxx">ft_render_mode_xxx</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-base_interface.html#ft_render_mode_xxx">ft_render_mode_normal</a>  <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_NORMAL</a>
-#define <a href="ft2-base_interface.html#ft_render_mode_xxx">ft_render_mode_mono</a>    <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_MONO</a>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>These constants are deprecated. Use the corresponding <a href="ft2-base_interface.html#FT_Render_Mode">FT_Render_Mode</a> values instead.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>ft_render_mode_normal</b></td><td>
-<p>see <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_NORMAL</a></p>
-</td></tr>
-<tr valign=top><td><b>ft_render_mode_mono</b></td><td>
-<p>see <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_MONO</a></p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Render_Glyph">FT_Render_Glyph</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Render_Glyph</b>( <a href="ft2-base_interface.html#FT_GlyphSlot">FT_GlyphSlot</a>    slot,
-                   <a href="ft2-base_interface.html#FT_Render_Mode">FT_Render_Mode</a>  render_mode );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Convert a given glyph image to a bitmap. It does so by inspecting the glyph image format, finding the relevant renderer, and invoking it.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>slot</b></td><td>
-<p>A handle to the glyph slot containing the image to convert.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>render_mode</b></td><td>
-<p>This is the render mode used to render the glyph image into a bitmap. See <a href="ft2-base_interface.html#FT_Render_Mode">FT_Render_Mode</a> for a list of possible values.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Kerning_Mode">FT_Kerning_Mode</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_Kerning_Mode_
-  {
-    <a href="ft2-base_interface.html#FT_Kerning_Mode">FT_KERNING_DEFAULT</a>  = 0,
-    <a href="ft2-base_interface.html#FT_Kerning_Mode">FT_KERNING_UNFITTED</a>,
-    <a href="ft2-base_interface.html#FT_Kerning_Mode">FT_KERNING_UNSCALED</a>
-
-  } <b>FT_Kerning_Mode</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An enumeration used to specify which kerning values to return in <a href="ft2-base_interface.html#FT_Get_Kerning">FT_Get_Kerning</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_KERNING_DEFAULT</b></td><td>
-<p>Return scaled and grid-fitted kerning distances (value is&nbsp;0).</p>
-</td></tr>
-<tr valign=top><td><b>FT_KERNING_UNFITTED</b></td><td>
-<p>Return scaled but un-grid-fitted kerning distances.</p>
-</td></tr>
-<tr valign=top><td><b>FT_KERNING_UNSCALED</b></td><td>
-<p>Return the kerning vector in original font units.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="ft_kerning_default">ft_kerning_default</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>ft_kerning_default</b>   <a href="ft2-base_interface.html#FT_Kerning_Mode">FT_KERNING_DEFAULT</a>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This constant is deprecated. Please use <a href="ft2-base_interface.html#FT_Kerning_Mode">FT_KERNING_DEFAULT</a> instead.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="ft_kerning_unfitted">ft_kerning_unfitted</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>ft_kerning_unfitted</b>  <a href="ft2-base_interface.html#FT_Kerning_Mode">FT_KERNING_UNFITTED</a>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This constant is deprecated. Please use <a href="ft2-base_interface.html#FT_Kerning_Mode">FT_KERNING_UNFITTED</a> instead.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="ft_kerning_unscaled">ft_kerning_unscaled</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>ft_kerning_unscaled</b>  <a href="ft2-base_interface.html#FT_Kerning_Mode">FT_KERNING_UNSCALED</a>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This constant is deprecated. Please use <a href="ft2-base_interface.html#FT_Kerning_Mode">FT_KERNING_UNSCALED</a> instead.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Kerning">FT_Get_Kerning</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_Kerning</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>     face,
-                  <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     left_glyph,
-                  <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     right_glyph,
-                  <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     kern_mode,
-                  <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>  *akerning );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the kerning vector between two glyphs of a same face.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to a source face object.</p>
-</td></tr>
-<tr valign=top><td><b>left_glyph</b></td><td>
-<p>The index of the left glyph in the kern pair.</p>
-</td></tr>
-<tr valign=top><td><b>right_glyph</b></td><td>
-<p>The index of the right glyph in the kern pair.</p>
-</td></tr>
-<tr valign=top><td><b>kern_mode</b></td><td>
-<p>See <a href="ft2-base_interface.html#FT_Kerning_Mode">FT_Kerning_Mode</a> for more information. Determines the scale and dimension of the returned kerning vector.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>akerning</b></td><td>
-<p>The kerning vector. This is either in font units or in pixels (26.6 format) for scalable formats, and in pixels for fixed-sizes formats.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Only horizontal layouts (left-to-right &amp; right-to-left) are supported by this method. Other layouts, or more sophisticated kernings, are out of the scope of this API function -- they can be implemented through format-specific interfaces.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Track_Kerning">FT_Get_Track_Kerning</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_Track_Kerning</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>    face,
-                        <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>   point_size,
-                        <a href="ft2-basic_types.html#FT_Int">FT_Int</a>     degree,
-                        <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>*  akerning );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the track kerning for a given face object at a given size.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to a source face object.</p>
-</td></tr>
-<tr valign=top><td><b>point_size</b></td><td>
-<p>The point size in 16.16 fractional points.</p>
-</td></tr>
-<tr valign=top><td><b>degree</b></td><td>
-<p>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.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>akerning</b></td><td>
-<p>The kerning in 16.16 fractional points, to be uniformly applied between all glyphs.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Currently, only the Type&nbsp;1 font driver supports track kerning, using data from AFM files (if attached with <a href="ft2-base_interface.html#FT_Attach_File">FT_Attach_File</a> or <a href="ft2-base_interface.html#FT_Attach_Stream">FT_Attach_Stream</a>).</p>
-<p>Only very few AFM files come with track kerning data; please refer to the Adobe's AFM specification for more details.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Glyph_Name">FT_Get_Glyph_Name</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_Glyph_Name</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>     face,
-                     <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     glyph_index,
-                     <a href="ft2-basic_types.html#FT_Pointer">FT_Pointer</a>  buffer,
-                     <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     buffer_max );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the ASCII name of a given glyph in a face. This only works for those faces where <a href="ft2-base_interface.html#FT_HAS_GLYPH_NAMES">FT_HAS_GLYPH_NAMES</a>(face) returns&nbsp;1.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to a source face object.</p>
-</td></tr>
-<tr valign=top><td><b>glyph_index</b></td><td>
-<p>The glyph index.</p>
-</td></tr>
-<tr valign=top><td><b>buffer_max</b></td><td>
-<p>The maximal number of bytes available in the buffer.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>buffer</b></td><td>
-<p>A pointer to a target buffer where the name is copied to.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>An error is returned if the face doesn't provide glyph names or if the glyph index is invalid. In all cases of failure, the first byte of &lsquo;buffer&rsquo; is set to&nbsp;0 to indicate an empty name.</p>
-<p>The glyph name is truncated to fit within the buffer if it is too long. The returned string is always zero-terminated.</p>
-<p>Be aware that FreeType reorders glyph indices internally so that glyph index&nbsp;0 always corresponds to the &lsquo;missing glyph&rsquo; (called &lsquo;.notdef&rsquo;).</p>
-<p>This function is not compiled within the library if the config macro &lsquo;FT_CONFIG_OPTION_NO_GLYPH_NAMES&rsquo; is defined in &lsquo;include/freetype/config/ftoptions.h&rsquo;.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Postscript_Name">FT_Get_Postscript_Name</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">const</span> <span class="keyword">char</span>* )
-  <b>FT_Get_Postscript_Name</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>  face );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the ASCII PostScript name of a given face, if available. This only works with PostScript and TrueType fonts.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>A pointer to the face's PostScript name. NULL if unavailable.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The returned pointer is owned by the face and is destroyed with it.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Select_Charmap">FT_Select_Charmap</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Select_Charmap</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>      face,
-                     <a href="ft2-base_interface.html#FT_Encoding">FT_Encoding</a>  encoding );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Select a given charmap by its encoding tag (as listed in &lsquo;freetype.h&rsquo;).</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>encoding</b></td><td>
-<p>A handle to the selected encoding.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function returns an error if no charmap in the face corresponds to the encoding queried here.</p>
-<p>Because many fonts contain more than a single cmap for Unicode encoding, this function has some special code to select the one which covers Unicode best (&lsquo;best&rsquo; in the sense that a UCS-4 cmap is preferred to a UCS-2 cmap). It is thus preferable to <a href="ft2-base_interface.html#FT_Set_Charmap">FT_Set_Charmap</a> in this case.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Set_Charmap">FT_Set_Charmap</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Set_Charmap</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>     face,
-                  <a href="ft2-base_interface.html#FT_CharMap">FT_CharMap</a>  charmap );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Select a given charmap for character code to glyph index mapping.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>charmap</b></td><td>
-<p>A handle to the selected charmap.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function returns an error if the charmap is not part of the face (i.e., if it is not listed in the &lsquo;face-&gt;charmaps&rsquo; table).</p>
-<p>It also fails if a type&nbsp;14 charmap is selected.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Charmap_Index">FT_Get_Charmap_Index</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Int">FT_Int</a> )
-  <b>FT_Get_Charmap_Index</b>( <a href="ft2-base_interface.html#FT_CharMap">FT_CharMap</a>  charmap );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve index of a given charmap.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>charmap</b></td><td>
-<p>A handle to a charmap.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The index into the array of character maps within the face to which &lsquo;charmap&rsquo; belongs. If an error occurs, -1 is returned.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Char_Index">FT_Get_Char_Index</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> )
-  <b>FT_Get_Char_Index</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                     <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  charcode );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the glyph index of a given character code. This function uses a charmap object to do the mapping.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face object.</p>
-</td></tr>
-<tr valign=top><td><b>charcode</b></td><td>
-<p>The character code.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The glyph index. 0&nbsp;means &lsquo;undefined character code&rsquo;.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>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&nbsp;0 always corresponds to the &lsquo;missing glyph&rsquo;.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_First_Char">FT_Get_First_Char</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a> )
-  <b>FT_Get_First_Char</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                     <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>  *agindex );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This function is used to return the first character code in the current charmap of a given face. It also returns the corresponding glyph index.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>agindex</b></td><td>
-<p>Glyph index of first character code. 0&nbsp;if charmap is empty.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The charmap's first character code.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>You should use this function with <a href="ft2-base_interface.html#FT_Get_Next_Char">FT_Get_Next_Char</a> to be able to parse all character codes available in a given charmap. The code should look like this:</p>
-<pre class="colored">
-  FT_ULong  charcode;                                              
-  FT_UInt   gindex;                                                
-                                                                   
-                                                                   
-  charcode = FT_Get_First_Char( face, &amp;gindex );                   
-  while ( gindex != 0 )                                            
-  {                                                                
-    ... do something with (charcode,gindex) pair ...               
-                                                                   
-    charcode = FT_Get_Next_Char( face, charcode, &amp;gindex );        
-  }                                                                
-</pre>
-<p>Note that &lsquo;*agindex&rsquo; is set to&nbsp;0 if the charmap is empty. The result itself can be&nbsp;0 in two cases: if the charmap is empty or if the value&nbsp;0 is the first valid character code.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Next_Char">FT_Get_Next_Char</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a> )
-  <b>FT_Get_Next_Char</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>    face,
-                    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   char_code,
-                    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>   *agindex );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This function is used to return the next character code in the current charmap of a given face following the value &lsquo;char_code&rsquo;, as well as the corresponding glyph index.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face object.</p>
-</td></tr>
-<tr valign=top><td><b>char_code</b></td><td>
-<p>The starting character code.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>agindex</b></td><td>
-<p>Glyph index of next character code. 0&nbsp;if charmap is empty.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The charmap's next character code.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>You should use this function with <a href="ft2-base_interface.html#FT_Get_First_Char">FT_Get_First_Char</a> to walk over all character codes available in a given charmap. See the note for this function for a simple code example.</p>
-<p>Note that &lsquo;*agindex&rsquo; is set to&nbsp;0 when there are no more codes in the charmap.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Name_Index">FT_Get_Name_Index</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> )
-  <b>FT_Get_Name_Index</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>     face,
-                     <a href="ft2-basic_types.html#FT_String">FT_String</a>*  glyph_name );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the glyph index of a given glyph name. This function uses driver specific objects to do the translation.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face object.</p>
-</td></tr>
-<tr valign=top><td><b>glyph_name</b></td><td>
-<p>The glyph name.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The glyph index. 0&nbsp;means &lsquo;undefined character code&rsquo;.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS</a>          1
-#define <a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES</a>      2
-#define <a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID</a>        4
-#define <a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_SCALE</a>                   8
-#define <a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_XY_SCALE</a>             0x40
-#define <a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_2X2</a>                  0x80
-#define <a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_USE_MY_METRICS</a>      0x200
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of constants used to describe subglyphs. Please refer to the TrueType specification for the meaning of the various flags.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td colspan=0><b>FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS</b></td></tr>
-<tr valign=top><td></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES</b></td></tr>
-<tr valign=top><td></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID</b></td></tr>
-<tr valign=top><td></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>FT_SUBGLYPH_FLAG_SCALE</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_SUBGLYPH_FLAG_XY_SCALE</b></td></tr>
-<tr valign=top><td></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>FT_SUBGLYPH_FLAG_2X2</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_SUBGLYPH_FLAG_USE_MY_METRICS</b></td></tr>
-<tr valign=top><td></td><td>
-<p></p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_SubGlyph_Info">FT_Get_SubGlyph_Info</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_SubGlyph_Info</b>( <a href="ft2-base_interface.html#FT_GlyphSlot">FT_GlyphSlot</a>  glyph,
-                        <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>       sub_index,
-                        <a href="ft2-basic_types.html#FT_Int">FT_Int</a>       *p_index,
-                        <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>      *p_flags,
-                        <a href="ft2-basic_types.html#FT_Int">FT_Int</a>       *p_arg1,
-                        <a href="ft2-basic_types.html#FT_Int">FT_Int</a>       *p_arg2,
-                        <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>    *p_transform );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve a description of a given subglyph. Only use it if &lsquo;glyph-&gt;format&rsquo; is <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_COMPOSITE</a>; an error is returned otherwise.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>glyph</b></td><td>
-<p>The source glyph slot.</p>
-</td></tr>
-<tr valign=top><td><b>sub_index</b></td><td>
-<p>The index of the subglyph. Must be less than &lsquo;glyph-&gt;num_subglyphs&rsquo;.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>p_index</b></td><td>
-<p>The glyph index of the subglyph.</p>
-</td></tr>
-<tr valign=top><td><b>p_flags</b></td><td>
-<p>The subglyph flags, see <a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_XXX</a>.</p>
-</td></tr>
-<tr valign=top><td><b>p_arg1</b></td><td>
-<p>The subglyph's first argument (if any).</p>
-</td></tr>
-<tr valign=top><td><b>p_arg2</b></td><td>
-<p>The subglyph's second argument (if any).</p>
-</td></tr>
-<tr valign=top><td><b>p_transform</b></td><td>
-<p>The subglyph transformation (if any).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The values of &lsquo;*p_arg1&rsquo;, &lsquo;*p_arg2&rsquo;, and &lsquo;*p_transform&rsquo; must be interpreted depending on the flags returned in &lsquo;*p_flags&rsquo;. See the TrueType specification for details.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_FSTYPE_XXX">FT_FSTYPE_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-base_interface.html#FT_FSTYPE_XXX">FT_FSTYPE_INSTALLABLE_EMBEDDING</a>         0x0000
-#define <a href="ft2-base_interface.html#FT_FSTYPE_XXX">FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING</a>  0x0002
-#define <a href="ft2-base_interface.html#FT_FSTYPE_XXX">FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING</a>   0x0004
-#define <a href="ft2-base_interface.html#FT_FSTYPE_XXX">FT_FSTYPE_EDITABLE_EMBEDDING</a>            0x0008
-#define <a href="ft2-base_interface.html#FT_FSTYPE_XXX">FT_FSTYPE_NO_SUBSETTING</a>                 0x0100
-#define <a href="ft2-base_interface.html#FT_FSTYPE_XXX">FT_FSTYPE_BITMAP_EMBEDDING_ONLY</a>         0x0200
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of bit flags used in the &lsquo;fsType&rsquo; field of the OS/2 table in a TrueType or OpenType font and the &lsquo;FSType&rsquo; entry in a PostScript font. These bit flags are returned by <a href="ft2-base_interface.html#FT_Get_FSType_Flags">FT_Get_FSType_Flags</a>; they inform client applications of embedding and subsetting restrictions associated with a font.</p>
-<p>See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for more details.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td colspan=0><b>FT_FSTYPE_INSTALLABLE_EMBEDDING</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Fonts with no fsType bit set may be embedded and permanently installed on the remote system by an application.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Fonts that have only this bit set must not be modified, embedded or exchanged in any manner without first obtaining permission of the font software copyright owner.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING</b></td></tr>
-<tr valign=top><td></td><td>
-<p>If this bit is set, the font may be embedded and temporarily loaded on the remote system. Documents containing Preview &amp; Print fonts must be opened &lsquo;read-only&rsquo;; no edits can be applied to the document.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_FSTYPE_EDITABLE_EMBEDDING</b></td></tr>
-<tr valign=top><td></td><td>
-<p>If this bit is set, the font may be embedded but must only be installed temporarily on other systems. In contrast to Preview &amp; Print fonts, documents containing editable fonts may be opened for reading, editing is permitted, and changes may be saved.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_FSTYPE_NO_SUBSETTING</b></td></tr>
-<tr valign=top><td></td><td>
-<p>If this bit is set, the font may not be subsetted prior to embedding.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_FSTYPE_BITMAP_EMBEDDING_ONLY</b></td></tr>
-<tr valign=top><td></td><td>
-<p>If this bit is set, only bitmaps contained in the font may be embedded; no outline data may be embedded. If there are no bitmaps available in the font, then the font is unembeddable.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>While the fsType flags can indicate that a font may be embedded, a license with the font vendor may be separately required to use the font in this way.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_FSType_Flags">FT_Get_FSType_Flags</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a> )
-  <b>FT_Get_FSType_Flags</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>  face );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the fsType flags for a font.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The fsType flags, <a href="ft2-base_interface.html#FT_FSTYPE_XXX">FT_FSTYPE_XXX</a>.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Use this function rather than directly reading the &lsquo;fs_type&rsquo; field in the <a href="ft2-type1_tables.html#PS_FontInfoRec">PS_FontInfoRec</a> structure which is only guaranteed to return the correct results for Type&nbsp;1 fonts.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.8</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-basic_types.html b/docs/reference/ft2-basic_types.html
deleted file mode 100644 (file)
index 510d04b..0000000
+++ /dev/null
@@ -1,1173 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Basic Data Types
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Byte">FT_Byte</a></td><td></td><td><a href="#FT_Offset">FT_Offset</a></td><td></td><td><a href="#FT_UnitVector">FT_UnitVector</a></td></tr>
-<tr><td></td><td><a href="#FT_Bytes">FT_Bytes</a></td><td></td><td><a href="#FT_PtrDist">FT_PtrDist</a></td><td></td><td><a href="#FT_F26Dot6">FT_F26Dot6</a></td></tr>
-<tr><td></td><td><a href="#FT_Char">FT_Char</a></td><td></td><td><a href="#FT_String">FT_String</a></td><td></td><td><a href="#FT_Pixel_Mode">FT_Pixel_Mode</a></td></tr>
-<tr><td></td><td><a href="#FT_Int">FT_Int</a></td><td></td><td><a href="#FT_Tag">FT_Tag</a></td><td></td><td><a href="#ft_pixel_mode_xxx">ft_pixel_mode_xxx</a></td></tr>
-<tr><td></td><td><a href="#FT_UInt">FT_UInt</a></td><td></td><td><a href="#FT_Error">FT_Error</a></td><td></td><td><a href="#FT_Palette_Mode">FT_Palette_Mode</a></td></tr>
-<tr><td></td><td><a href="#FT_Int16">FT_Int16</a></td><td></td><td><a href="#FT_Fixed">FT_Fixed</a></td><td></td><td><a href="#FT_Bitmap">FT_Bitmap</a></td></tr>
-<tr><td></td><td><a href="#FT_UInt16">FT_UInt16</a></td><td></td><td><a href="#FT_Pointer">FT_Pointer</a></td><td></td><td><a href="#FT_IMAGE_TAG">FT_IMAGE_TAG</a></td></tr>
-<tr><td></td><td><a href="#FT_Int32">FT_Int32</a></td><td></td><td><a href="#FT_Pos">FT_Pos</a></td><td></td><td><a href="#FT_Glyph_Format">FT_Glyph_Format</a></td></tr>
-<tr><td></td><td><a href="#FT_UInt32">FT_UInt32</a></td><td></td><td><a href="#FT_Vector">FT_Vector</a></td><td></td><td><a href="#ft_glyph_format_xxx">ft_glyph_format_xxx</a></td></tr>
-<tr><td></td><td><a href="#FT_Short">FT_Short</a></td><td></td><td><a href="#FT_BBox">FT_BBox</a></td><td></td><td><a href="#FT_Data">FT_Data</a></td></tr>
-<tr><td></td><td><a href="#FT_UShort">FT_UShort</a></td><td></td><td><a href="#FT_Matrix">FT_Matrix</a></td><td></td><td><a href="#FT_Generic_Finalizer">FT_Generic_Finalizer</a></td></tr>
-<tr><td></td><td><a href="#FT_Long">FT_Long</a></td><td></td><td><a href="#FT_FWord">FT_FWord</a></td><td></td><td><a href="#FT_Generic">FT_Generic</a></td></tr>
-<tr><td></td><td><a href="#FT_ULong">FT_ULong</a></td><td></td><td><a href="#FT_UFWord">FT_UFWord</a></td><td></td><td><a href="#FT_MAKE_TAG">FT_MAKE_TAG</a></td></tr>
-<tr><td></td><td><a href="#FT_Bool">FT_Bool</a></td><td></td><td><a href="#FT_F2Dot14">FT_F2Dot14</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains the basic data types defined by FreeType&nbsp;2, ranging from simple scalar types to bitmap descriptors. More font-specific structures are defined in a different section.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Byte">FT_Byte</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">char</span>  <b>FT_Byte</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A simple typedef for the <i>unsigned</i> char type.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Bytes">FT_Bytes</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>*  <b>FT_Bytes</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A typedef for constant memory areas.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Char">FT_Char</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">char</span>  <b>FT_Char</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A simple typedef for the <i>signed</i> char type.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Int">FT_Int</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">int</span>  <b>FT_Int</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A typedef for the int type.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_UInt">FT_UInt</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">int</span>  <b>FT_UInt</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A typedef for the unsigned int type.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Int16">FT_Int16</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CONFIG_CONFIG_H (freetype/config/ftconfig.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">short</span>  <b>FT_Int16</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A typedef for a 16bit signed integer type.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_UInt16">FT_UInt16</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CONFIG_CONFIG_H (freetype/config/ftconfig.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">short</span>  <b>FT_UInt16</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A typedef for a 16bit unsigned integer type.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Int32">FT_Int32</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CONFIG_CONFIG_H (freetype/config/ftconfig.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">signed</span> XXX  <b>FT_Int32</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A typedef for a 32bit signed integer type. The size depends on the configuration.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_UInt32">FT_UInt32</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CONFIG_CONFIG_H (freetype/config/ftconfig.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">unsigned</span> XXX  <b>FT_UInt32</b>;
-
-</pre></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Short">FT_Short</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">short</span>  <b>FT_Short</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A typedef for signed short.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_UShort">FT_UShort</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">short</span>  <b>FT_UShort</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A typedef for unsigned short.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Long">FT_Long</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">long</span>  <b>FT_Long</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A typedef for signed long.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_ULong">FT_ULong</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">long</span>  <b>FT_ULong</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A typedef for unsigned long.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Bool">FT_Bool</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">char</span>  <b>FT_Bool</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A typedef of unsigned char, used for simple booleans. As usual, values 1 and&nbsp;0 represent true and false, respectively.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Offset">FT_Offset</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> size_t  <b>FT_Offset</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This is equivalent to the ANSI&nbsp;C &lsquo;size_t&rsquo; type, i.e., the largest <i>unsigned</i> integer type used to express a file size or position, or a memory block size.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_PtrDist">FT_PtrDist</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> ft_ptrdiff_t  <b>FT_PtrDist</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This is equivalent to the ANSI&nbsp;C &lsquo;ptrdiff_t&rsquo; type, i.e., the largest <i>signed</i> integer type used to express the distance between two pointers.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_String">FT_String</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">char</span>  <b>FT_String</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A simple typedef for the char type, usually used for strings.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Tag">FT_Tag</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_UInt32">FT_UInt32</a>  <b>FT_Tag</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A typedef for 32-bit tags (as used in the SFNT format).</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Error">FT_Error</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">int</span>  <b>FT_Error</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>The FreeType error code type. A value of&nbsp;0 is always interpreted as a successful operation.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Fixed">FT_Fixed</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">long</span>  <b>FT_Fixed</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This type is used to store 16.16 fixed float values, like scaling values or matrix coefficients.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Pointer">FT_Pointer</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">void</span>*  <b>FT_Pointer</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A simple typedef for a typeless pointer.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Pos">FT_Pos</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">long</span>  <b>FT_Pos</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>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.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Vector">FT_Vector</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Vector_
-  {
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>  x;
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>  y;
-
-  } <b>FT_Vector</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A simple structure used to store a 2D vector; coordinates are of the FT_Pos type.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>x</b></td><td>
-<p>The horizontal coordinate.</p>
-</td></tr>
-<tr valign=top><td><b>y</b></td><td>
-<p>The vertical coordinate.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_BBox">FT_BBox</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_BBox_
-  {
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>  xMin, yMin;
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>  xMax, yMax;
-
-  } <b>FT_BBox</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to hold an outline's bounding box, i.e., the coordinates of its extrema in the horizontal and vertical directions.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>xMin</b></td><td>
-<p>The horizontal minimum (left-most).</p>
-</td></tr>
-<tr valign=top><td><b>yMin</b></td><td>
-<p>The vertical minimum (bottom-most).</p>
-</td></tr>
-<tr valign=top><td><b>xMax</b></td><td>
-<p>The horizontal maximum (right-most).</p>
-</td></tr>
-<tr valign=top><td><b>yMax</b></td><td>
-<p>The vertical maximum (top-most).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The bounding box is specified with the coordinates of the lower left and the upper right corner. In PostScript, those values are often called (llx,lly) and (urx,ury), respectively.</p>
-<p>If &lsquo;yMin&rsquo; is negative, this value gives the glyph's descender. Otherwise, the glyph doesn't descend below the baseline. Similarly, if &lsquo;ymax&rsquo; is positive, this value gives the glyph's ascender.</p>
-<p>&lsquo;xMin&rsquo; gives the horizontal distance from the glyph's origin to the left edge of the glyph's bounding box. If &lsquo;xMin&rsquo; is negative, the glyph extends to the left of the origin.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Matrix">FT_Matrix</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Matrix_
-  {
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>  xx, xy;
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>  yx, yy;
-
-  } <b>FT_Matrix</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A simple structure used to store a 2x2 matrix. Coefficients are in 16.16 fixed float format. The computation performed is:</p>
-<pre class="colored">
-   x' = x*xx + y*xy                                             
-   y' = x*yx + y*yy                                             
-</pre>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>xx</b></td><td>
-<p>Matrix coefficient.</p>
-</td></tr>
-<tr valign=top><td><b>xy</b></td><td>
-<p>Matrix coefficient.</p>
-</td></tr>
-<tr valign=top><td><b>yx</b></td><td>
-<p>Matrix coefficient.</p>
-</td></tr>
-<tr valign=top><td><b>yy</b></td><td>
-<p>Matrix coefficient.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_FWord">FT_FWord</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">short</span>  <b>FT_FWord</b>;   /* distance in FUnits */
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A signed 16-bit integer used to store a distance in original font units.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_UFWord">FT_UFWord</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">short</span>  <b>FT_UFWord</b>;  /* <span class="keyword">unsigned</span> distance */
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An unsigned 16-bit integer used to store a distance in original font units.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_F2Dot14">FT_F2Dot14</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">short</span>  <b>FT_F2Dot14</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A signed 2.14 fixed float type used for unit vectors.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_UnitVector">FT_UnitVector</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_UnitVector_
-  {
-    <a href="ft2-basic_types.html#FT_F2Dot14">FT_F2Dot14</a>  x;
-    <a href="ft2-basic_types.html#FT_F2Dot14">FT_F2Dot14</a>  y;
-
-  } <b>FT_UnitVector</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A simple structure used to store a 2D vector unit vector. Uses FT_F2Dot14 types.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>x</b></td><td>
-<p>Horizontal coordinate.</p>
-</td></tr>
-<tr valign=top><td><b>y</b></td><td>
-<p>Vertical coordinate.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_F26Dot6">FT_F26Dot6</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">long</span>  <b>FT_F26Dot6</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A signed 26.6 fixed float type used for vectorial pixel coordinates.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Pixel_Mode">FT_Pixel_Mode</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_Pixel_Mode_
-  {
-    <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_NONE</a> = 0,
-    <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_MONO</a>,
-    <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_GRAY</a>,
-    <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_GRAY2</a>,
-    <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_GRAY4</a>,
-    <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_LCD</a>,
-    <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_LCD_V</a>,
-
-    FT_PIXEL_MODE_MAX      /* do not remove */
-
-  } <b>FT_Pixel_Mode</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An enumeration type used to describe the format of pixels in a given bitmap. Note that additional formats may be added in the future.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_PIXEL_MODE_NONE</b></td><td>
-<p>Value&nbsp;0 is reserved.</p>
-</td></tr>
-<tr valign=top><td><b>FT_PIXEL_MODE_MONO</b></td><td>
-<p>A monochrome bitmap, using 1&nbsp;bit per pixel. Note that pixels are stored in most-significant order (MSB), which means that the left-most pixel in a byte has value 128.</p>
-</td></tr>
-<tr valign=top><td><b>FT_PIXEL_MODE_GRAY</b></td><td>
-<p>An 8-bit bitmap, generally used to represent anti-aliased glyph images. Each pixel is stored in one byte. Note that the number of &lsquo;gray&rsquo; levels is stored in the &lsquo;num_grays&rsquo; field of the <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a> structure (it generally is 256).</p>
-</td></tr>
-<tr valign=top><td><b>FT_PIXEL_MODE_GRAY2</b></td><td>
-<p>A 2-bit per pixel bitmap, used to represent embedded anti-aliased bitmaps in font files according to the OpenType specification. We haven't found a single font using this format, however.</p>
-</td></tr>
-<tr valign=top><td><b>FT_PIXEL_MODE_GRAY4</b></td><td>
-<p>A 4-bit per pixel bitmap, representing embedded anti-aliased bitmaps in font files according to the OpenType specification. We haven't found a single font using this format, however.</p>
-</td></tr>
-<tr valign=top><td><b>FT_PIXEL_MODE_LCD</b></td><td>
-<p>An 8-bit bitmap, representing RGB or BGR decimated glyph images used for display on LCD displays; the bitmap is three times wider than the original glyph image. See also <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LCD</a>.</p>
-</td></tr>
-<tr valign=top><td><b>FT_PIXEL_MODE_LCD_V</b></td><td>
-<p>An 8-bit bitmap, representing RGB or BGR decimated glyph images used for display on rotated LCD displays; the bitmap is three times taller than the original glyph image. See also <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LCD_V</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="ft_pixel_mode_xxx">ft_pixel_mode_xxx</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-basic_types.html#ft_pixel_mode_xxx">ft_pixel_mode_none</a>   <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_NONE</a>
-#define <a href="ft2-basic_types.html#ft_pixel_mode_xxx">ft_pixel_mode_mono</a>   <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_MONO</a>
-#define <a href="ft2-basic_types.html#ft_pixel_mode_xxx">ft_pixel_mode_grays</a>  <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_GRAY</a>
-#define <a href="ft2-basic_types.html#ft_pixel_mode_xxx">ft_pixel_mode_pal2</a>   <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_GRAY2</a>
-#define <a href="ft2-basic_types.html#ft_pixel_mode_xxx">ft_pixel_mode_pal4</a>   <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_GRAY4</a>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of deprecated constants. Use the corresponding <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_Pixel_Mode</a> values instead.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>ft_pixel_mode_none</b></td><td>
-<p>See <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_NONE</a>.</p>
-</td></tr>
-<tr valign=top><td><b>ft_pixel_mode_mono</b></td><td>
-<p>See <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_MONO</a>.</p>
-</td></tr>
-<tr valign=top><td><b>ft_pixel_mode_grays</b></td><td>
-<p>See <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_GRAY</a>.</p>
-</td></tr>
-<tr valign=top><td><b>ft_pixel_mode_pal2</b></td><td>
-<p>See <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_GRAY2</a>.</p>
-</td></tr>
-<tr valign=top><td><b>ft_pixel_mode_pal4</b></td><td>
-<p>See <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_GRAY4</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Palette_Mode">FT_Palette_Mode</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_Palette_Mode_
-  {
-    <a href="ft2-basic_types.html#FT_Palette_Mode">ft_palette_mode_rgb</a> = 0,
-    <a href="ft2-basic_types.html#FT_Palette_Mode">ft_palette_mode_rgba</a>,
-
-    ft_palette_mode_max   /* do not remove */
-
-  } <b>FT_Palette_Mode</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>THIS TYPE IS DEPRECATED. DO NOT USE IT!</p>
-<p>An enumeration type to describe the format of a bitmap palette, used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>ft_palette_mode_rgb</b></td><td>
-<p>The palette is an array of 3-byte RGB records.</p>
-</td></tr>
-<tr valign=top><td><b>ft_palette_mode_rgba</b></td><td>
-<p>The palette is an array of 4-byte RGBA records.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by FreeType, these types are not handled by the library itself.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Bitmap">FT_Bitmap</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Bitmap_
-  {
-    <span class="keyword">int</span>             rows;
-    <span class="keyword">int</span>             width;
-    <span class="keyword">int</span>             pitch;
-    <span class="keyword">unsigned</span> <span class="keyword">char</span>*  buffer;
-    <span class="keyword">short</span>           num_grays;
-    <span class="keyword">char</span>            pixel_mode;
-    <span class="keyword">char</span>            palette_mode;
-    <span class="keyword">void</span>*           palette;
-
-  } <b>FT_Bitmap</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to describe a bitmap or pixmap to the raster. Note that we now manage pixmaps of various depths through the &lsquo;pixel_mode&rsquo; field.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>rows</b></td><td>
-<p>The number of bitmap rows.</p>
-</td></tr>
-<tr valign=top><td><b>width</b></td><td>
-<p>The number of pixels in bitmap row.</p>
-</td></tr>
-<tr valign=top><td><b>pitch</b></td><td>
-<p>The pitch's absolute value is the number of bytes taken by one bitmap row, including padding. However, the pitch is positive when the bitmap has a &lsquo;down&rsquo; flow, and negative when it has an &lsquo;up&rsquo; flow. In all cases, the pitch is an offset to add to a bitmap pointer in order to go down one row.</p>
-<p>Note that &lsquo;padding&rsquo; means the alignment of a bitmap to a byte border, and FreeType functions normally align to the smallest possible integer value.</p>
-<p>For the B/W rasterizer, &lsquo;pitch&rsquo; is always an even number.</p>
-<p>To change the pitch of a bitmap (say, to make it a multiple of 4), use <a href="ft2-bitmap_handling.html#FT_Bitmap_Convert">FT_Bitmap_Convert</a>. Alternatively, you might use callback functions to directly render to the application's surface; see the file &lsquo;example2.cpp&rsquo; in the tutorial for a demonstration.</p>
-</td></tr>
-<tr valign=top><td><b>buffer</b></td><td>
-<p>A typeless pointer to the bitmap buffer. This value should be aligned on 32-bit boundaries in most cases.</p>
-</td></tr>
-<tr valign=top><td><b>num_grays</b></td><td>
-<p>This field is only used with <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_GRAY</a>; it gives the number of gray levels used in the bitmap.</p>
-</td></tr>
-<tr valign=top><td><b>pixel_mode</b></td><td>
-<p>The pixel mode, i.e., how pixel bits are stored. See <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_Pixel_Mode</a> for possible values.</p>
-</td></tr>
-<tr valign=top><td><b>palette_mode</b></td><td>
-<p>This field is intended for paletted pixel modes; it indicates how the palette is stored. Not used currently.</p>
-</td></tr>
-<tr valign=top><td><b>palette</b></td><td>
-<p>A typeless pointer to the bitmap palette; this field is intended for paletted pixel modes. Not used currently.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>For now, the only pixel modes supported by FreeType are mono and grays. However, drivers might be added in the future to support more &lsquo;colorful&rsquo; options.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_IMAGE_TAG">FT_IMAGE_TAG</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#ifndef <b>FT_IMAGE_TAG</b>
-#define <b>FT_IMAGE_TAG</b>( value, _x1, _x2, _x3, _x4 )  \
-          value = ( ( (<span class="keyword">unsigned</span> <span class="keyword">long</span>)_x1 &lt;&lt; 24 ) | \
-                    ( (<span class="keyword">unsigned</span> <span class="keyword">long</span>)_x2 &lt;&lt; 16 ) | \
-                    ( (<span class="keyword">unsigned</span> <span class="keyword">long</span>)_x3 &lt;&lt; 8  ) | \
-                      (<span class="keyword">unsigned</span> <span class="keyword">long</span>)_x4         )
-#endif /* <b>FT_IMAGE_TAG</b> */
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This macro converts four-letter tags to an unsigned long type.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Since many 16-bit compilers don't like 32-bit enumerations, you should redefine this macro in case of problems to something like this:</p>
-<pre class="colored">
-  #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  value         
-</pre>
-<p>to get a simple enumeration without assigning special numbers.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Glyph_Format">FT_Glyph_Format</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_Glyph_Format_
-  {
-    <a href="ft2-basic_types.html#FT_IMAGE_TAG">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_NONE</a>, 0, 0, 0, 0 ),
-
-    <a href="ft2-basic_types.html#FT_IMAGE_TAG">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_COMPOSITE</a>, 'c', 'o', 'm', 'p' ),
-    <a href="ft2-basic_types.html#FT_IMAGE_TAG">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_BITMAP</a>,    'b', 'i', 't', 's' ),
-    <a href="ft2-basic_types.html#FT_IMAGE_TAG">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_OUTLINE</a>,   'o', 'u', 't', 'l' ),
-    <a href="ft2-basic_types.html#FT_IMAGE_TAG">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_PLOTTER</a>,   'p', 'l', 'o', 't' )
-
-  } <b>FT_Glyph_Format</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An enumeration type used to describe the format of a given glyph image. Note that this version of FreeType only supports two image formats, even though future font drivers will be able to register their own format.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_GLYPH_FORMAT_NONE</b></td><td>
-<p>The value&nbsp;0 is reserved.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_GLYPH_FORMAT_COMPOSITE</b></td></tr>
-<tr valign=top><td></td><td>
-<p>The glyph image is a composite of several other images. This format is <i>only</i> used with <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_RECURSE</a>, and is used to report compound glyphs (like accented characters).</p>
-</td></tr>
-<tr valign=top><td><b>FT_GLYPH_FORMAT_BITMAP</b></td><td>
-<p>The glyph image is a bitmap, and can be described as an <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>. You generally need to access the &lsquo;bitmap&rsquo; field of the <a href="ft2-base_interface.html#FT_GlyphSlotRec">FT_GlyphSlotRec</a> structure to read it.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_GLYPH_FORMAT_OUTLINE</b></td></tr>
-<tr valign=top><td></td><td>
-<p>The glyph image is a vectorial outline made of line segments and Bézier arcs; it can be described as an <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>; you generally want to access the &lsquo;outline&rsquo; field of the <a href="ft2-base_interface.html#FT_GlyphSlotRec">FT_GlyphSlotRec</a> structure to read it.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_GLYPH_FORMAT_PLOTTER</b></td></tr>
-<tr valign=top><td></td><td>
-<p>The glyph image is a vectorial path with no inside and outside contours. Some Type&nbsp;1 fonts, like those in the Hershey family, contain glyphs in this format. These are described as <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>, but FreeType isn't currently capable of rendering them correctly.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="ft_glyph_format_xxx">ft_glyph_format_xxx</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-basic_types.html#ft_glyph_format_xxx">ft_glyph_format_none</a>       <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_NONE</a>
-#define <a href="ft2-basic_types.html#ft_glyph_format_xxx">ft_glyph_format_composite</a>  <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_COMPOSITE</a>
-#define <a href="ft2-basic_types.html#ft_glyph_format_xxx">ft_glyph_format_bitmap</a>     <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_BITMAP</a>
-#define <a href="ft2-basic_types.html#ft_glyph_format_xxx">ft_glyph_format_outline</a>    <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_OUTLINE</a>
-#define <a href="ft2-basic_types.html#ft_glyph_format_xxx">ft_glyph_format_plotter</a>    <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_PLOTTER</a>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of deprecated constants. Use the corresponding <a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a> values instead.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>ft_glyph_format_none</b></td><td>
-<p>See <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_NONE</a>.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>ft_glyph_format_composite</b></td></tr>
-<tr valign=top><td></td><td>
-<p>See <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_COMPOSITE</a>.</p>
-</td></tr>
-<tr valign=top><td><b>ft_glyph_format_bitmap</b></td><td>
-<p>See <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_BITMAP</a>.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>ft_glyph_format_outline</b></td></tr>
-<tr valign=top><td></td><td>
-<p>See <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_OUTLINE</a>.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>ft_glyph_format_plotter</b></td></tr>
-<tr valign=top><td></td><td>
-<p>See <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_PLOTTER</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Data">FT_Data</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Data_
-  {
-    <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>*  pointer;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>          length;
-
-  } <b>FT_Data</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Read-only binary data represented as a pointer and a length.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>pointer</b></td><td>
-<p>The data.</p>
-</td></tr>
-<tr valign=top><td><b>length</b></td><td>
-<p>The length of the data in bytes.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Generic_Finalizer">FT_Generic_Finalizer</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">void</span>  (*<b>FT_Generic_Finalizer</b>)(<span class="keyword">void</span>*  object);
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Describe a function used to destroy the &lsquo;client&rsquo; data of any FreeType object. See the description of the <a href="ft2-basic_types.html#FT_Generic">FT_Generic</a> type for details of usage.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p>The address of the FreeType object which is under finalization. Its client data is accessed through its &lsquo;generic&rsquo; field.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Generic">FT_Generic</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Generic_
-  {
-    <span class="keyword">void</span>*                 data;
-    <a href="ft2-basic_types.html#FT_Generic_Finalizer">FT_Generic_Finalizer</a>  finalizer;
-
-  } <b>FT_Generic</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Client applications often need to associate their own data to a variety of FreeType core objects. For example, a text layout API might want to associate a glyph cache to a given size object.</p>
-<p>Some FreeType object contains a &lsquo;generic&rsquo; field, of type FT_Generic, which usage is left to client applications and font servers.</p>
-<p>It can be used to store a pointer to client-specific data, as well as the address of a &lsquo;finalizer&rsquo; function, which will be called by FreeType when the object is destroyed (for example, the previous client example would put the address of the glyph cache destructor in the &lsquo;finalizer&rsquo; field).</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>data</b></td><td>
-<p>A typeless pointer to any client-specified data. This field is completely ignored by the FreeType library.</p>
-</td></tr>
-<tr valign=top><td><b>finalizer</b></td><td>
-<p>A pointer to a &lsquo;generic finalizer&rsquo; function, which will be called when the object is destroyed. If this field is set to NULL, no code will be called.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_MAKE_TAG">FT_MAKE_TAG</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_MAKE_TAG</b>( _x1, _x2, _x3, _x4 ) \
-          (<a href="ft2-basic_types.html#FT_Tag">FT_Tag</a>)                        \
-          ( ( (<a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>)_x1 &lt;&lt; 24 ) |     \
-            ( (<a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>)_x2 &lt;&lt; 16 ) |     \
-            ( (<a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>)_x3 &lt;&lt;  8 ) |     \
-              (<a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>)_x4         )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This macro converts four-letter tags which are used to label TrueType tables into an unsigned long to be used within FreeType.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The produced values <b>must</b> be 32-bit integers. Don't redefine this macro.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-bdf_fonts.html b/docs/reference/ft2-bdf_fonts.html
deleted file mode 100644 (file)
index 0f41254..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-BDF and PCF Files
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_PropertyType">FT_PropertyType</a></td><td></td><td><a href="#BDF_PropertyRec">BDF_PropertyRec</a></td><td></td><td><a href="#FT_Get_BDF_Property">FT_Get_BDF_Property</a></td></tr>
-<tr><td></td><td><a href="#BDF_Property">BDF_Property</a></td><td></td><td><a href="#FT_Get_BDF_Charset_ID">FT_Get_BDF_Charset_ID</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains the declaration of functions specific to BDF and PCF fonts.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_PropertyType">FT_PropertyType</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_BDF_H (freetype/ftbdf.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  BDF_PropertyType_
-  {
-    <a href="ft2-bdf_fonts.html#FT_PropertyType">BDF_PROPERTY_TYPE_NONE</a>     = 0,
-    <a href="ft2-bdf_fonts.html#FT_PropertyType">BDF_PROPERTY_TYPE_ATOM</a>     = 1,
-    <a href="ft2-bdf_fonts.html#FT_PropertyType">BDF_PROPERTY_TYPE_INTEGER</a>  = 2,
-    <a href="ft2-bdf_fonts.html#FT_PropertyType">BDF_PROPERTY_TYPE_CARDINAL</a> = 3
-
-  } BDF_PropertyType;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of BDF property types.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>BDF_PROPERTY_TYPE_NONE</b></td><td>
-<p>Value&nbsp;0 is used to indicate a missing property.</p>
-</td></tr>
-<tr valign=top><td><b>BDF_PROPERTY_TYPE_ATOM</b></td><td>
-<p>Property is a string atom.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>BDF_PROPERTY_TYPE_INTEGER</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Property is a 32-bit signed integer.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>BDF_PROPERTY_TYPE_CARDINAL</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Property is a 32-bit unsigned integer.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="BDF_Property">BDF_Property</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_BDF_H (freetype/ftbdf.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> BDF_PropertyRec_*  <b>BDF_Property</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a <a href="ft2-bdf_fonts.html#BDF_PropertyRec">BDF_PropertyRec</a> structure to model a given BDF/PCF property.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="BDF_PropertyRec">BDF_PropertyRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_BDF_H (freetype/ftbdf.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  BDF_PropertyRec_
-  {
-    BDF_PropertyType  type;
-    <span class="keyword">union</span> {
-      <span class="keyword">const</span> <span class="keyword">char</span>*     atom;
-      <a href="ft2-basic_types.html#FT_Int32">FT_Int32</a>        integer;
-      <a href="ft2-basic_types.html#FT_UInt32">FT_UInt32</a>       cardinal;
-
-    } u;
-
-  } <b>BDF_PropertyRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This structure models a given BDF/PCF property.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>type</b></td><td>
-<p>The property type.</p>
-</td></tr>
-<tr valign=top><td><b>u.atom</b></td><td>
-<p>The atom string, if type is <a href="ft2-bdf_fonts.html#FT_PropertyType">BDF_PROPERTY_TYPE_ATOM</a>.</p>
-</td></tr>
-<tr valign=top><td><b>u.integer</b></td><td>
-<p>A signed integer, if type is <a href="ft2-bdf_fonts.html#FT_PropertyType">BDF_PROPERTY_TYPE_INTEGER</a>.</p>
-</td></tr>
-<tr valign=top><td><b>u.cardinal</b></td><td>
-<p>An unsigned integer, if type is <a href="ft2-bdf_fonts.html#FT_PropertyType">BDF_PROPERTY_TYPE_CARDINAL</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_BDF_Charset_ID">FT_Get_BDF_Charset_ID</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_BDF_H (freetype/ftbdf.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_BDF_Charset_ID</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>       face,
-                         <span class="keyword">const</span> <span class="keyword">char</span>*  *acharset_encoding,
-                         <span class="keyword">const</span> <span class="keyword">char</span>*  *acharset_registry );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve a BDF font character set identity, according to the BDF specification.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the input face.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>acharset_encoding</b></td><td>
-<p>Charset encoding, as a C&nbsp;string, owned by the face.</p>
-</td></tr>
-<tr valign=top><td><b>acharset_registry</b></td><td>
-<p>Charset registry, as a C&nbsp;string, owned by the face.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function only works with BDF faces, returning an error otherwise.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_BDF_Property">FT_Get_BDF_Property</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_BDF_H (freetype/ftbdf.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_BDF_Property</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>           face,
-                       <span class="keyword">const</span> <span class="keyword">char</span>*       prop_name,
-                       <a href="ft2-bdf_fonts.html#BDF_PropertyRec">BDF_PropertyRec</a>  *aproperty );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve a BDF property from a BDF or PCF font file.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the input face.</p>
-</td></tr>
-<tr valign=top><td><b>name</b></td><td>
-<p>The property name.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aproperty</b></td><td>
-<p>The property.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function works with BDF <i>and</i> PCF fonts. It returns an error otherwise. It also returns an error if the property is not in the font.</p>
-<p>A &lsquo;property&rsquo; is a either key-value pair within the STARTPROPERTIES ... ENDPROPERTIES block of a BDF font or a key-value pair from the &lsquo;info-&gt;props&rsquo; array within a &lsquo;FontRec&rsquo; structure of a PCF font.</p>
-<p>Integer properties are always stored as &lsquo;signed&rsquo; within PCF fonts; consequently, <a href="ft2-bdf_fonts.html#FT_PropertyType">BDF_PROPERTY_TYPE_CARDINAL</a> is a possible return value for BDF fonts only.</p>
-<p>In case of error, &lsquo;aproperty-&gt;type&rsquo; is always set to <a href="ft2-bdf_fonts.html#FT_PropertyType">BDF_PROPERTY_TYPE_NONE</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-bitmap_handling.html b/docs/reference/ft2-bitmap_handling.html
deleted file mode 100644 (file)
index db5c763..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Bitmap Handling
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Bitmap_New">FT_Bitmap_New</a></td><td></td><td><a href="#FT_Bitmap_Embolden">FT_Bitmap_Embolden</a></td><td></td><td><a href="#FT_GlyphSlot_Own_Bitmap">FT_GlyphSlot_Own_Bitmap</a></td></tr>
-<tr><td></td><td><a href="#FT_Bitmap_Copy">FT_Bitmap_Copy</a></td><td></td><td><a href="#FT_Bitmap_Convert">FT_Bitmap_Convert</a></td><td></td><td><a href="#FT_Bitmap_Done">FT_Bitmap_Done</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains functions for converting FT_Bitmap objects.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Bitmap_New">FT_Bitmap_New</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_BITMAP_H (freetype/ftbitmap.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Bitmap_New</b>( <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>  *abitmap );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Initialize a pointer to an <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a> structure.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>abitmap</b></td><td>
-<p>A pointer to the bitmap structure.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Bitmap_Copy">FT_Bitmap_Copy</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_BITMAP_H (freetype/ftbitmap.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Bitmap_Copy</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>        library,
-                  <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>  *source,
-                  <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>        *target);
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Copy a bitmap into another one.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to a library object.</p>
-</td></tr>
-<tr valign=top><td><b>source</b></td><td>
-<p>A handle to the source bitmap.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>target</b></td><td>
-<p>A handle to the target bitmap.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Bitmap_Embolden">FT_Bitmap_Embolden</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_BITMAP_H (freetype/ftbitmap.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Bitmap_Embolden</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library,
-                      <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>*  bitmap,
-                      <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>      xStrength,
-                      <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>      yStrength );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Embolden a bitmap. The new bitmap will be about &lsquo;xStrength&rsquo; pixels wider and &lsquo;yStrength&rsquo; pixels higher. The left and bottom borders are kept unchanged.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to a library object.</p>
-</td></tr>
-<tr valign=top><td><b>xStrength</b></td><td>
-<p>How strong the glyph is emboldened horizontally. Expressed in 26.6 pixel format.</p>
-</td></tr>
-<tr valign=top><td><b>yStrength</b></td><td>
-<p>How strong the glyph is emboldened vertically. Expressed in 26.6 pixel format.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>bitmap</b></td><td>
-<p>A handle to the target bitmap.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The current implementation restricts &lsquo;xStrength&rsquo; to be less than or equal to&nbsp;8 if bitmap is of pixel_mode <a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_MONO</a>.</p>
-<p>If you want to embolden the bitmap owned by a <a href="ft2-base_interface.html#FT_GlyphSlotRec">FT_GlyphSlotRec</a>, you should call <a href="ft2-bitmap_handling.html#FT_GlyphSlot_Own_Bitmap">FT_GlyphSlot_Own_Bitmap</a> on the slot first.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Bitmap_Convert">FT_Bitmap_Convert</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_BITMAP_H (freetype/ftbitmap.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Bitmap_Convert</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>        library,
-                     <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>  *source,
-                     <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>        *target,
-                     <a href="ft2-basic_types.html#FT_Int">FT_Int</a>            alignment );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>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 &lsquo;pitch&rsquo;) a multiple of &lsquo;alignment&rsquo;.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to a library object.</p>
-</td></tr>
-<tr valign=top><td><b>source</b></td><td>
-<p>The source bitmap.</p>
-</td></tr>
-<tr valign=top><td><b>alignment</b></td><td>
-<p>The pitch of the bitmap is a multiple of this parameter. Common values are 1, 2, or 4.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>target</b></td><td>
-<p>The target bitmap.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>It is possible to call <a href="ft2-bitmap_handling.html#FT_Bitmap_Convert">FT_Bitmap_Convert</a> multiple times without calling <a href="ft2-bitmap_handling.html#FT_Bitmap_Done">FT_Bitmap_Done</a> (the memory is simply reallocated).</p>
-<p>Use <a href="ft2-bitmap_handling.html#FT_Bitmap_Done">FT_Bitmap_Done</a> to finally remove the bitmap object.</p>
-<p>The &lsquo;library&rsquo; argument is taken to have access to FreeType's memory handling functions.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_GlyphSlot_Own_Bitmap">FT_GlyphSlot_Own_Bitmap</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_BITMAP_H (freetype/ftbitmap.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_GlyphSlot_Own_Bitmap</b>( <a href="ft2-base_interface.html#FT_GlyphSlot">FT_GlyphSlot</a>  slot );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Make sure that a glyph slot owns &lsquo;slot-&gt;bitmap&rsquo;.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>slot</b></td><td>
-<p>The glyph slot.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function is to be used in combination with <a href="ft2-bitmap_handling.html#FT_Bitmap_Embolden">FT_Bitmap_Embolden</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Bitmap_Done">FT_Bitmap_Done</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_BITMAP_H (freetype/ftbitmap.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Bitmap_Done</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library,
-                  <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>  *bitmap );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Destroy a bitmap object created with <a href="ft2-bitmap_handling.html#FT_Bitmap_New">FT_Bitmap_New</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to a library object.</p>
-</td></tr>
-<tr valign=top><td><b>bitmap</b></td><td>
-<p>The bitmap object to be freed.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The &lsquo;library&rsquo; argument is taken to have access to FreeType's memory handling functions.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-cache_subsystem.html b/docs/reference/ft2-cache_subsystem.html
deleted file mode 100644 (file)
index cb7ad05..0000000
+++ /dev/null
@@ -1,1170 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Cache Sub-System
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FTC_Manager">FTC_Manager</a></td><td></td><td><a href="#FTC_CMapCache_New">FTC_CMapCache_New</a></td></tr>
-<tr><td></td><td><a href="#FTC_FaceID">FTC_FaceID</a></td><td></td><td><a href="#FTC_CMapCache_Lookup">FTC_CMapCache_Lookup</a></td></tr>
-<tr><td></td><td><a href="#FTC_Face_Requester">FTC_Face_Requester</a></td><td></td><td><a href="#FTC_ImageTypeRec">FTC_ImageTypeRec</a></td></tr>
-<tr><td></td><td><a href="#FTC_Node">FTC_Node</a></td><td></td><td><a href="#FTC_ImageType">FTC_ImageType</a></td></tr>
-<tr><td></td><td><a href="#FTC_Manager_New">FTC_Manager_New</a></td><td></td><td><a href="#FTC_ImageCache">FTC_ImageCache</a></td></tr>
-<tr><td></td><td><a href="#FTC_Manager_Reset">FTC_Manager_Reset</a></td><td></td><td><a href="#FTC_ImageCache_New">FTC_ImageCache_New</a></td></tr>
-<tr><td></td><td><a href="#FTC_Manager_Done">FTC_Manager_Done</a></td><td></td><td><a href="#FTC_ImageCache_Lookup">FTC_ImageCache_Lookup</a></td></tr>
-<tr><td></td><td><a href="#FTC_Manager_LookupFace">FTC_Manager_LookupFace</a></td><td></td><td><a href="#FTC_ImageCache_LookupScaler">FTC_ImageCache_LookupScaler</a></td></tr>
-<tr><td></td><td><a href="#FTC_ScalerRec">FTC_ScalerRec</a></td><td></td><td><a href="#FTC_SBit">FTC_SBit</a></td></tr>
-<tr><td></td><td><a href="#FTC_Scaler">FTC_Scaler</a></td><td></td><td><a href="#FTC_SBitRec">FTC_SBitRec</a></td></tr>
-<tr><td></td><td><a href="#FTC_Manager_LookupSize">FTC_Manager_LookupSize</a></td><td></td><td><a href="#FTC_SBitCache">FTC_SBitCache</a></td></tr>
-<tr><td></td><td><a href="#FTC_Node_Unref">FTC_Node_Unref</a></td><td></td><td><a href="#FTC_SBitCache_New">FTC_SBitCache_New</a></td></tr>
-<tr><td></td><td><a href="#FTC_Manager_RemoveFaceID">FTC_Manager_RemoveFaceID</a></td><td></td><td><a href="#FTC_SBitCache_Lookup">FTC_SBitCache_Lookup</a></td></tr>
-<tr><td></td><td><a href="#FTC_CMapCache">FTC_CMapCache</a></td><td></td><td><a href="#FTC_SBitCache_LookupScaler">FTC_SBitCache_LookupScaler</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section describes the FreeType&nbsp;2 cache sub-system, which is used to limit the number of concurrently opened <a href="ft2-base_interface.html#FT_Face">FT_Face</a> and <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects, as well as caching information like character maps and glyph images while limiting their maximum memory usage.</p>
-<p>Note that all types and functions begin with the &lsquo;FTC_&rsquo; prefix.</p>
-<p>The cache is highly portable and thus doesn't know anything about the fonts installed on your system, or how to access them. This implies the following scheme:</p>
-<p>First, available or installed font faces are uniquely identified by <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> values, provided to the cache by the client. Note that the cache only stores and compares these values, and doesn't try to interpret them in any way.</p>
-<p>Second, the cache calls, only when needed, a client-provided function to convert an <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> into a new <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object. The latter is then completely managed by the cache, including its termination through <a href="ft2-base_interface.html#FT_Done_Face">FT_Done_Face</a>. To monitor termination of face objects, the finalizer callback in the &lsquo;generic&rsquo; field of the <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object can be used, which might also be used to store the <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> of the face.</p>
-<p>Clients are free to map face IDs to anything else. The most simple usage is to associate them to a (pathname,face_index) pair that is used to call <a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a>. However, more complex schemes are also possible.</p>
-<p>Note that for the cache to work correctly, the face ID values must be <b>persistent</b>, which means that the contents they point to should not change at runtime, or that their value should not become invalid.</p>
-<p>If this is unavoidable (e.g., when a font is uninstalled at runtime), you should call <a href="ft2-cache_subsystem.html#FTC_Manager_RemoveFaceID">FTC_Manager_RemoveFaceID</a> as soon as possible, to let the cache get rid of any references to the old <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> it may keep internally. Failure to do so will lead to incorrect behaviour or even crashes.</p>
-<p>To use the cache, start with calling <a href="ft2-cache_subsystem.html#FTC_Manager_New">FTC_Manager_New</a> to create a new <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> object, which models a single cache instance. You can then look up <a href="ft2-base_interface.html#FT_Face">FT_Face</a> and <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects with <a href="ft2-cache_subsystem.html#FTC_Manager_LookupFace">FTC_Manager_LookupFace</a> and <a href="ft2-cache_subsystem.html#FTC_Manager_LookupSize">FTC_Manager_LookupSize</a>, respectively.</p>
-<p>If you want to use the charmap caching, call <a href="ft2-cache_subsystem.html#FTC_CMapCache_New">FTC_CMapCache_New</a>, then later use <a href="ft2-cache_subsystem.html#FTC_CMapCache_Lookup">FTC_CMapCache_Lookup</a> to perform the equivalent of <a href="ft2-base_interface.html#FT_Get_Char_Index">FT_Get_Char_Index</a>, only much faster.</p>
-<p>If you want to use the <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> caching, call <a href="ft2-cache_subsystem.html#FTC_ImageCache">FTC_ImageCache</a>, then later use <a href="ft2-cache_subsystem.html#FTC_ImageCache_Lookup">FTC_ImageCache_Lookup</a> to retrieve the corresponding <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> objects from the cache.</p>
-<p>If you need lots of small bitmaps, it is much more memory efficient to call <a href="ft2-cache_subsystem.html#FTC_SBitCache_New">FTC_SBitCache_New</a> followed by <a href="ft2-cache_subsystem.html#FTC_SBitCache_Lookup">FTC_SBitCache_Lookup</a>. This returns <a href="ft2-cache_subsystem.html#FTC_SBitRec">FTC_SBitRec</a> structures, which are used to store small bitmaps directly. (A small bitmap is one whose metrics and dimensions all fit into 8-bit integers).</p>
-<p>We hope to also provide a kerning cache in the near future.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_Manager">FTC_Manager</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ManagerRec_*  <b>FTC_Manager</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This object corresponds to one instance of the cache-subsystem. It is used to cache one or more <a href="ft2-base_interface.html#FT_Face">FT_Face</a> objects, along with corresponding <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects.</p>
-<p>The manager intentionally limits the total number of opened <a href="ft2-base_interface.html#FT_Face">FT_Face</a> and <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects to control memory usage. See the &lsquo;max_faces&rsquo; and &lsquo;max_sizes&rsquo; parameters of <a href="ft2-cache_subsystem.html#FTC_Manager_New">FTC_Manager_New</a>.</p>
-<p>The manager is also used to cache &lsquo;nodes&rsquo; of various types while limiting their total memory usage.</p>
-<p>All limitations are enforced by keeping lists of managed objects in most-recently-used order, and flushing old nodes to make room for new ones.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_FaceID">FTC_FaceID</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_Pointer">FT_Pointer</a>  <b>FTC_FaceID</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An opaque pointer type that is used to identity face objects. The contents of such objects is application-dependent.</p>
-<p>These pointers are typically used to point to a user-defined structure containing a font file path, and face index.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Never use NULL as a valid <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a>.</p>
-<p>Face IDs are passed by the client to the cache manager, which calls, when needed, the <a href="ft2-cache_subsystem.html#FTC_Face_Requester">FTC_Face_Requester</a> to translate them into new <a href="ft2-base_interface.html#FT_Face">FT_Face</a> objects.</p>
-<p>If the content of a given face ID changes at runtime, or if the value becomes invalid (e.g., when uninstalling a font), you should immediately call <a href="ft2-cache_subsystem.html#FTC_Manager_RemoveFaceID">FTC_Manager_RemoveFaceID</a> before any other cache function.</p>
-<p>Failure to do so will result in incorrect behaviour or even memory leaks and crashes.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_Face_Requester">FTC_Face_Requester</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_Error">FT_Error</a>
-  (*<b>FTC_Face_Requester</b>)( <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a>  face_id,
-                         <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library,
-                         <a href="ft2-basic_types.html#FT_Pointer">FT_Pointer</a>  request_data,
-                         <a href="ft2-base_interface.html#FT_Face">FT_Face</a>*    aface );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A callback function provided by client applications. It is used by the cache manager to translate a given <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> into a new valid <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object, on demand.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face_id</b></td><td>
-<p>The face ID to resolve.</p>
-</td></tr>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to a FreeType library object.</p>
-</td></tr>
-<tr valign=top><td><b>req_data</b></td><td>
-<p>Application-provided request data (see note below).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aface</b></td><td>
-<p>A new <a href="ft2-base_interface.html#FT_Face">FT_Face</a> handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The third parameter &lsquo;req_data&rsquo; is the same as the one passed by the client when <a href="ft2-cache_subsystem.html#FTC_Manager_New">FTC_Manager_New</a> is called.</p>
-<p>The face requester should not perform funny things on the returned face object, like creating a new <a href="ft2-base_interface.html#FT_Size">FT_Size</a> for it, or setting a transformation through <a href="ft2-base_interface.html#FT_Set_Transform">FT_Set_Transform</a>!</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_Node">FTC_Node</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_NodeRec_*  <b>FTC_Node</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An opaque handle to a cache node object. Each cache node is reference-counted. A node with a count of&nbsp;0 might be flushed out of a full cache whenever a lookup request is performed.</p>
-<p>If you look up nodes, you have the ability to &lsquo;acquire&rsquo; them, i.e., to increment their reference count. This will prevent the node from being flushed out of the cache until you explicitly &lsquo;release&rsquo; it (see <a href="ft2-cache_subsystem.html#FTC_Node_Unref">FTC_Node_Unref</a>).</p>
-<p>See also <a href="ft2-cache_subsystem.html#FTC_SBitCache_Lookup">FTC_SBitCache_Lookup</a> and <a href="ft2-cache_subsystem.html#FTC_ImageCache_Lookup">FTC_ImageCache_Lookup</a>.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_Manager_New">FTC_Manager_New</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FTC_Manager_New</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>          library,
-                   <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>             max_faces,
-                   <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>             max_sizes,
-                   <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>            max_bytes,
-                   <a href="ft2-cache_subsystem.html#FTC_Face_Requester">FTC_Face_Requester</a>  requester,
-                   <a href="ft2-basic_types.html#FT_Pointer">FT_Pointer</a>          req_data,
-                   <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a>        *amanager );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Create a new cache manager.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>The parent FreeType library handle to use.</p>
-</td></tr>
-<tr valign=top><td><b>max_faces</b></td><td>
-<p>Maximum number of opened <a href="ft2-base_interface.html#FT_Face">FT_Face</a> objects managed by this cache instance. Use&nbsp;0 for defaults.</p>
-</td></tr>
-<tr valign=top><td><b>max_sizes</b></td><td>
-<p>Maximum number of opened <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects managed by this cache instance. Use&nbsp;0 for defaults.</p>
-</td></tr>
-<tr valign=top><td><b>max_bytes</b></td><td>
-<p>Maximum number of bytes to use for cached data nodes. Use&nbsp;0 for defaults. Note that this value does not account for managed <a href="ft2-base_interface.html#FT_Face">FT_Face</a> and <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects.</p>
-</td></tr>
-<tr valign=top><td><b>requester</b></td><td>
-<p>An application-provided callback used to translate face IDs into real <a href="ft2-base_interface.html#FT_Face">FT_Face</a> objects.</p>
-</td></tr>
-<tr valign=top><td><b>req_data</b></td><td>
-<p>A generic pointer that is passed to the requester each time it is called (see <a href="ft2-cache_subsystem.html#FTC_Face_Requester">FTC_Face_Requester</a>).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>amanager</b></td><td>
-<p>A handle to a new manager object. 0&nbsp;in case of failure.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_Manager_Reset">FTC_Manager_Reset</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FTC_Manager_Reset</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a>  manager );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Empty a given cache manager. This simply gets rid of all the currently cached <a href="ft2-base_interface.html#FT_Face">FT_Face</a> and <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects within the manager.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>manager</b></td><td>
-<p>A handle to the manager.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_Manager_Done">FTC_Manager_Done</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FTC_Manager_Done</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a>  manager );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Destroy a given manager after emptying it.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>manager</b></td><td>
-<p>A handle to the target cache manager object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_Manager_LookupFace">FTC_Manager_LookupFace</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FTC_Manager_LookupFace</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a>  manager,
-                          <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a>   face_id,
-                          <a href="ft2-base_interface.html#FT_Face">FT_Face</a>     *aface );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object that corresponds to a given face ID through a cache manager.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>manager</b></td><td>
-<p>A handle to the cache manager.</p>
-</td></tr>
-<tr valign=top><td><b>face_id</b></td><td>
-<p>The ID of the face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aface</b></td><td>
-<p>A handle to the face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The returned <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object is always owned by the manager. You should never try to discard it yourself.</p>
-<p>The <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object doesn't necessarily have a current size object (i.e., face-&gt;size can be 0). If you need a specific &lsquo;font size&rsquo;, use <a href="ft2-cache_subsystem.html#FTC_Manager_LookupSize">FTC_Manager_LookupSize</a> instead.</p>
-<p>Never change the face's transformation matrix (i.e., never call the <a href="ft2-base_interface.html#FT_Set_Transform">FT_Set_Transform</a> function) on a returned face! If you need to transform glyphs, do it yourself after glyph loading.</p>
-<p>When you perform a lookup, out-of-memory errors are detected <i>within</i> the lookup and force incremental flushes of the cache until enough memory is released for the lookup to succeed.</p>
-<p>If a lookup fails with &lsquo;FT_Err_Out_Of_Memory&rsquo; the cache has already been completely flushed, and still no memory was available for the operation.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_ScalerRec">FTC_ScalerRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FTC_ScalerRec_
-  {
-    <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a>  face_id;
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     width;
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     height;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>      pixel;
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     x_res;
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     y_res;
-
-  } <b>FTC_ScalerRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to describe a given character size in either pixels or points to the cache manager. See <a href="ft2-cache_subsystem.html#FTC_Manager_LookupSize">FTC_Manager_LookupSize</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face_id</b></td><td>
-<p>The source face ID.</p>
-</td></tr>
-<tr valign=top><td><b>width</b></td><td>
-<p>The character width.</p>
-</td></tr>
-<tr valign=top><td><b>height</b></td><td>
-<p>The character height.</p>
-</td></tr>
-<tr valign=top><td><b>pixel</b></td><td>
-<p>A Boolean. If 1, the &lsquo;width&rsquo; and &lsquo;height&rsquo; fields are interpreted as integer pixel character sizes. Otherwise, they are expressed as 1/64th of points.</p>
-</td></tr>
-<tr valign=top><td><b>x_res</b></td><td>
-<p>Only used when &lsquo;pixel&rsquo; is value&nbsp;0 to indicate the horizontal resolution in dpi.</p>
-</td></tr>
-<tr valign=top><td><b>y_res</b></td><td>
-<p>Only used when &lsquo;pixel&rsquo; is value&nbsp;0 to indicate the vertical resolution in dpi.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This type is mainly used to retrieve <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects through the cache manager.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_Scaler">FTC_Scaler</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ScalerRec_*  <b>FTC_Scaler</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to an <a href="ft2-cache_subsystem.html#FTC_ScalerRec">FTC_ScalerRec</a> structure.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_Manager_LookupSize">FTC_Manager_LookupSize</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FTC_Manager_LookupSize</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a>  manager,
-                          <a href="ft2-cache_subsystem.html#FTC_Scaler">FTC_Scaler</a>   scaler,
-                          <a href="ft2-base_interface.html#FT_Size">FT_Size</a>     *asize );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the <a href="ft2-base_interface.html#FT_Size">FT_Size</a> object that corresponds to a given <a href="ft2-cache_subsystem.html#FTC_ScalerRec">FTC_ScalerRec</a> pointer through a cache manager.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>manager</b></td><td>
-<p>A handle to the cache manager.</p>
-</td></tr>
-<tr valign=top><td><b>scaler</b></td><td>
-<p>A scaler handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>asize</b></td><td>
-<p>A handle to the size object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The returned <a href="ft2-base_interface.html#FT_Size">FT_Size</a> object is always owned by the manager. You should never try to discard it by yourself.</p>
-<p>You can access the parent <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object simply as &lsquo;size-&gt;face&rsquo; if you need it. Note that this object is also owned by the manager.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>When you perform a lookup, out-of-memory errors are detected <i>within</i> the lookup and force incremental flushes of the cache until enough memory is released for the lookup to succeed.</p>
-<p>If a lookup fails with &lsquo;FT_Err_Out_Of_Memory&rsquo; the cache has already been completely flushed, and still no memory is available for the operation.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_Node_Unref">FTC_Node_Unref</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FTC_Node_Unref</b>( <a href="ft2-cache_subsystem.html#FTC_Node">FTC_Node</a>     node,
-                  <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a>  manager );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Decrement a cache node's internal reference count. When the count reaches 0, it is not destroyed but becomes eligible for subsequent cache flushes.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>node</b></td><td>
-<p>The cache node handle.</p>
-</td></tr>
-<tr valign=top><td><b>manager</b></td><td>
-<p>The cache manager handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_Manager_RemoveFaceID">FTC_Manager_RemoveFaceID</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FTC_Manager_RemoveFaceID</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a>  manager,
-                            <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a>   face_id );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A special function used to indicate to the cache manager that a given <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> is no longer valid, either because its content changed, or because it was deallocated or uninstalled.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>manager</b></td><td>
-<p>The cache manager handle.</p>
-</td></tr>
-<tr valign=top><td><b>face_id</b></td><td>
-<p>The <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> to be removed.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function flushes all nodes from the cache corresponding to this &lsquo;face_id&rsquo;, with the exception of nodes with a non-null reference count.</p>
-<p>Such nodes are however modified internally so as to never appear in later lookups with the same &lsquo;face_id&rsquo; value, and to be immediately destroyed when released by all their users.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_CMapCache">FTC_CMapCache</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_CMapCacheRec_*  <b>FTC_CMapCache</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An opaque handle used to model a charmap cache. This cache is to hold character codes -&gt; glyph indices mappings.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_CMapCache_New">FTC_CMapCache_New</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FTC_CMapCache_New</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a>     manager,
-                     <a href="ft2-cache_subsystem.html#FTC_CMapCache">FTC_CMapCache</a>  *acache );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Create a new charmap cache.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>manager</b></td><td>
-<p>A handle to the cache manager.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>acache</b></td><td>
-<p>A new cache handle. NULL in case of error.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Like all other caches, this one will be destroyed with the cache manager.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_CMapCache_Lookup">FTC_CMapCache_Lookup</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> )
-  <b>FTC_CMapCache_Lookup</b>( <a href="ft2-cache_subsystem.html#FTC_CMapCache">FTC_CMapCache</a>  cache,
-                        <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a>     face_id,
-                        <a href="ft2-basic_types.html#FT_Int">FT_Int</a>         cmap_index,
-                        <a href="ft2-basic_types.html#FT_UInt32">FT_UInt32</a>      char_code );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Translate a character code into a glyph index, using the charmap cache.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>cache</b></td><td>
-<p>A charmap cache handle.</p>
-</td></tr>
-<tr valign=top><td><b>face_id</b></td><td>
-<p>The source face ID.</p>
-</td></tr>
-<tr valign=top><td><b>cmap_index</b></td><td>
-<p>The index of the charmap in the source face. Any negative value means to use the cache <a href="ft2-base_interface.html#FT_Face">FT_Face</a>'s default charmap.</p>
-</td></tr>
-<tr valign=top><td><b>char_code</b></td><td>
-<p>The character code (in the corresponding charmap).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>Glyph index. 0&nbsp;means &lsquo;no glyph&rsquo;.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_ImageTypeRec">FTC_ImageTypeRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FTC_ImageTypeRec_
-  {
-    <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a>  face_id;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>      width;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>      height;
-    <a href="ft2-basic_types.html#FT_Int32">FT_Int32</a>    flags;
-
-  } <b>FTC_ImageTypeRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model the type of images in a glyph cache.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face_id</b></td><td>
-<p>The face ID.</p>
-</td></tr>
-<tr valign=top><td><b>width</b></td><td>
-<p>The width in pixels.</p>
-</td></tr>
-<tr valign=top><td><b>height</b></td><td>
-<p>The height in pixels.</p>
-</td></tr>
-<tr valign=top><td><b>flags</b></td><td>
-<p>The load flags, as in <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_ImageType">FTC_ImageType</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ImageTypeRec_*  <b>FTC_ImageType</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to an <a href="ft2-cache_subsystem.html#FTC_ImageTypeRec">FTC_ImageTypeRec</a> structure.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_ImageCache">FTC_ImageCache</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ImageCacheRec_*  <b>FTC_ImageCache</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to an glyph image cache object. They are designed to hold many distinct glyph images while not exceeding a certain memory threshold.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_ImageCache_New">FTC_ImageCache_New</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FTC_ImageCache_New</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a>      manager,
-                      <a href="ft2-cache_subsystem.html#FTC_ImageCache">FTC_ImageCache</a>  *acache );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Create a new glyph image cache.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>manager</b></td><td>
-<p>The parent manager for the image cache.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>acache</b></td><td>
-<p>A handle to the new glyph image cache object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_ImageCache_Lookup">FTC_ImageCache_Lookup</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FTC_ImageCache_Lookup</b>( <a href="ft2-cache_subsystem.html#FTC_ImageCache">FTC_ImageCache</a>  cache,
-                         <a href="ft2-cache_subsystem.html#FTC_ImageType">FTC_ImageType</a>   type,
-                         <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>         gindex,
-                         <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>       *aglyph,
-                         <a href="ft2-cache_subsystem.html#FTC_Node">FTC_Node</a>       *anode );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve a given glyph image from a glyph image cache.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>cache</b></td><td>
-<p>A handle to the source glyph image cache.</p>
-</td></tr>
-<tr valign=top><td><b>type</b></td><td>
-<p>A pointer to a glyph image type descriptor.</p>
-</td></tr>
-<tr valign=top><td><b>gindex</b></td><td>
-<p>The glyph index to retrieve.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aglyph</b></td><td>
-<p>The corresponding <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> object. 0&nbsp;in case of failure.</p>
-</td></tr>
-<tr valign=top><td><b>anode</b></td><td>
-<p>Used to return the address of of the corresponding cache node after incrementing its reference count (see note below).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The returned glyph is owned and managed by the glyph image cache. Never try to transform or discard it manually! You can however create a copy with <a href="ft2-glyph_management.html#FT_Glyph_Copy">FT_Glyph_Copy</a> and modify the new one.</p>
-<p>If &lsquo;anode&rsquo; is <i>not</i> NULL, it receives the address of the cache node containing the glyph image, after increasing its reference count. This ensures that the node (as well as the <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>) will always be kept in the cache until you call <a href="ft2-cache_subsystem.html#FTC_Node_Unref">FTC_Node_Unref</a> to &lsquo;release&rsquo; it.</p>
-<p>If &lsquo;anode&rsquo; is NULL, the cache node is left unchanged, which means that the <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_ImageCache_LookupScaler">FTC_ImageCache_LookupScaler</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FTC_ImageCache_LookupScaler</b>( <a href="ft2-cache_subsystem.html#FTC_ImageCache">FTC_ImageCache</a>  cache,
-                               <a href="ft2-cache_subsystem.html#FTC_Scaler">FTC_Scaler</a>      scaler,
-                               <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>        load_flags,
-                               <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>         gindex,
-                               <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>       *aglyph,
-                               <a href="ft2-cache_subsystem.html#FTC_Node">FTC_Node</a>       *anode );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A variant of <a href="ft2-cache_subsystem.html#FTC_ImageCache_Lookup">FTC_ImageCache_Lookup</a> that uses an <a href="ft2-cache_subsystem.html#FTC_ScalerRec">FTC_ScalerRec</a> to specify the face ID and its size.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>cache</b></td><td>
-<p>A handle to the source glyph image cache.</p>
-</td></tr>
-<tr valign=top><td><b>scaler</b></td><td>
-<p>A pointer to a scaler descriptor.</p>
-</td></tr>
-<tr valign=top><td><b>load_flags</b></td><td>
-<p>The corresponding load flags.</p>
-</td></tr>
-<tr valign=top><td><b>gindex</b></td><td>
-<p>The glyph index to retrieve.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aglyph</b></td><td>
-<p>The corresponding <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> object. 0&nbsp;in case of failure.</p>
-</td></tr>
-<tr valign=top><td><b>anode</b></td><td>
-<p>Used to return the address of of the corresponding cache node after incrementing its reference count (see note below).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The returned glyph is owned and managed by the glyph image cache. Never try to transform or discard it manually! You can however create a copy with <a href="ft2-glyph_management.html#FT_Glyph_Copy">FT_Glyph_Copy</a> and modify the new one.</p>
-<p>If &lsquo;anode&rsquo; is <i>not</i> NULL, it receives the address of the cache node containing the glyph image, after increasing its reference count. This ensures that the node (as well as the <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>) will always be kept in the cache until you call <a href="ft2-cache_subsystem.html#FTC_Node_Unref">FTC_Node_Unref</a> to &lsquo;release&rsquo; it.</p>
-<p>If &lsquo;anode&rsquo; is NULL, the cache node is left unchanged, which means that the <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!</p>
-<p>Calls to <a href="ft2-base_interface.html#FT_Set_Char_Size">FT_Set_Char_Size</a> and friends have no effect on cached glyphs; you should always use the FreeType cache API instead.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_SBit">FTC_SBit</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_SBitRec_*  <b>FTC_SBit</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a small bitmap descriptor. See the <a href="ft2-cache_subsystem.html#FTC_SBitRec">FTC_SBitRec</a> structure for details.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_SBitRec">FTC_SBitRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FTC_SBitRec_
-  {
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>   width;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>   height;
-    <a href="ft2-basic_types.html#FT_Char">FT_Char</a>   left;
-    <a href="ft2-basic_types.html#FT_Char">FT_Char</a>   top;
-
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>   format;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>   max_grays;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>  pitch;
-    <a href="ft2-basic_types.html#FT_Char">FT_Char</a>   xadvance;
-    <a href="ft2-basic_types.html#FT_Char">FT_Char</a>   yadvance;
-
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>*  buffer;
-
-  } <b>FTC_SBitRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A very compact structure used to describe a small glyph bitmap.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>width</b></td><td>
-<p>The bitmap width in pixels.</p>
-</td></tr>
-<tr valign=top><td><b>height</b></td><td>
-<p>The bitmap height in pixels.</p>
-</td></tr>
-<tr valign=top><td><b>left</b></td><td>
-<p>The horizontal distance from the pen position to the left bitmap border (a.k.a. &lsquo;left side bearing&rsquo;, or &lsquo;lsb&rsquo;).</p>
-</td></tr>
-<tr valign=top><td><b>top</b></td><td>
-<p>The vertical distance from the pen position (on the baseline) to the upper bitmap border (a.k.a. &lsquo;top side bearing&rsquo;). The distance is positive for upwards y&nbsp;coordinates.</p>
-</td></tr>
-<tr valign=top><td><b>format</b></td><td>
-<p>The format of the glyph bitmap (monochrome or gray).</p>
-</td></tr>
-<tr valign=top><td><b>max_grays</b></td><td>
-<p>Maximum gray level value (in the range 1 to&nbsp;255).</p>
-</td></tr>
-<tr valign=top><td><b>pitch</b></td><td>
-<p>The number of bytes per bitmap line. May be positive or negative.</p>
-</td></tr>
-<tr valign=top><td><b>xadvance</b></td><td>
-<p>The horizontal advance width in pixels.</p>
-</td></tr>
-<tr valign=top><td><b>yadvance</b></td><td>
-<p>The vertical advance height in pixels.</p>
-</td></tr>
-<tr valign=top><td><b>buffer</b></td><td>
-<p>A pointer to the bitmap pixels.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_SBitCache">FTC_SBitCache</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_SBitCacheRec_*  <b>FTC_SBitCache</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a small bitmap cache. These are special cache objects used to store small glyph bitmaps (and anti-aliased pixmaps) in a much more efficient way than the traditional glyph image cache implemented by <a href="ft2-cache_subsystem.html#FTC_ImageCache">FTC_ImageCache</a>.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_SBitCache_New">FTC_SBitCache_New</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FTC_SBitCache_New</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a>     manager,
-                     <a href="ft2-cache_subsystem.html#FTC_SBitCache">FTC_SBitCache</a>  *acache );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Create a new cache to store small glyph bitmaps.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>manager</b></td><td>
-<p>A handle to the source cache manager.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>acache</b></td><td>
-<p>A handle to the new sbit cache. NULL in case of error.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_SBitCache_Lookup">FTC_SBitCache_Lookup</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FTC_SBitCache_Lookup</b>( <a href="ft2-cache_subsystem.html#FTC_SBitCache">FTC_SBitCache</a>    cache,
-                        <a href="ft2-cache_subsystem.html#FTC_ImageType">FTC_ImageType</a>    type,
-                        <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>          gindex,
-                        <a href="ft2-cache_subsystem.html#FTC_SBit">FTC_SBit</a>        *sbit,
-                        <a href="ft2-cache_subsystem.html#FTC_Node">FTC_Node</a>        *anode );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Look up a given small glyph bitmap in a given sbit cache and &lsquo;lock&rsquo; it to prevent its flushing from the cache until needed.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>cache</b></td><td>
-<p>A handle to the source sbit cache.</p>
-</td></tr>
-<tr valign=top><td><b>type</b></td><td>
-<p>A pointer to the glyph image type descriptor.</p>
-</td></tr>
-<tr valign=top><td><b>gindex</b></td><td>
-<p>The glyph index.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>sbit</b></td><td>
-<p>A handle to a small bitmap descriptor.</p>
-</td></tr>
-<tr valign=top><td><b>anode</b></td><td>
-<p>Used to return the address of of the corresponding cache node after incrementing its reference count (see note below).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The small bitmap descriptor and its bit buffer are owned by the cache and should never be freed by the application. They might as well disappear from memory on the next cache lookup, so don't treat them as persistent data.</p>
-<p>The descriptor's &lsquo;buffer&rsquo; field is set to&nbsp;0 to indicate a missing glyph bitmap.</p>
-<p>If &lsquo;anode&rsquo; is <i>not</i> NULL, it receives the address of the cache node containing the bitmap, after increasing its reference count. This ensures that the node (as well as the image) will always be kept in the cache until you call <a href="ft2-cache_subsystem.html#FTC_Node_Unref">FTC_Node_Unref</a> to &lsquo;release&rsquo; it.</p>
-<p>If &lsquo;anode&rsquo; is NULL, the cache node is left unchanged, which means that the bitmap could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FTC_SBitCache_LookupScaler">FTC_SBitCache_LookupScaler</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CACHE_H (freetype/ftcache.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FTC_SBitCache_LookupScaler</b>( <a href="ft2-cache_subsystem.html#FTC_SBitCache">FTC_SBitCache</a>  cache,
-                              <a href="ft2-cache_subsystem.html#FTC_Scaler">FTC_Scaler</a>     scaler,
-                              <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>       load_flags,
-                              <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>        gindex,
-                              <a href="ft2-cache_subsystem.html#FTC_SBit">FTC_SBit</a>      *sbit,
-                              <a href="ft2-cache_subsystem.html#FTC_Node">FTC_Node</a>      *anode );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A variant of <a href="ft2-cache_subsystem.html#FTC_SBitCache_Lookup">FTC_SBitCache_Lookup</a> that uses an <a href="ft2-cache_subsystem.html#FTC_ScalerRec">FTC_ScalerRec</a> to specify the face ID and its size.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>cache</b></td><td>
-<p>A handle to the source sbit cache.</p>
-</td></tr>
-<tr valign=top><td><b>scaler</b></td><td>
-<p>A pointer to the scaler descriptor.</p>
-</td></tr>
-<tr valign=top><td><b>load_flags</b></td><td>
-<p>The corresponding load flags.</p>
-</td></tr>
-<tr valign=top><td><b>gindex</b></td><td>
-<p>The glyph index.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>sbit</b></td><td>
-<p>A handle to a small bitmap descriptor.</p>
-</td></tr>
-<tr valign=top><td><b>anode</b></td><td>
-<p>Used to return the address of of the corresponding cache node after incrementing its reference count (see note below).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The small bitmap descriptor and its bit buffer are owned by the cache and should never be freed by the application. They might as well disappear from memory on the next cache lookup, so don't treat them as persistent data.</p>
-<p>The descriptor's &lsquo;buffer&rsquo; field is set to&nbsp;0 to indicate a missing glyph bitmap.</p>
-<p>If &lsquo;anode&rsquo; is <i>not</i> NULL, it receives the address of the cache node containing the bitmap, after increasing its reference count. This ensures that the node (as well as the image) will always be kept in the cache until you call <a href="ft2-cache_subsystem.html#FTC_Node_Unref">FTC_Node_Unref</a> to &lsquo;release&rsquo; it.</p>
-<p>If &lsquo;anode&rsquo; is NULL, the cache node is left unchanged, which means that the bitmap could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-cid_fonts.html b/docs/reference/ft2-cid_fonts.html
deleted file mode 100644 (file)
index cc533b5..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-CID Fonts
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Get_CID_Registry_Ordering_Supplement">FT_Get_CID_Registry_Ordering_Supplement</a></td></tr>
-<tr><td></td><td><a href="#FT_Get_CID_Is_Internally_CID_Keyed">FT_Get_CID_Is_Internally_CID_Keyed</a></td></tr>
-<tr><td></td><td><a href="#FT_Get_CID_From_Glyph_Index">FT_Get_CID_From_Glyph_Index</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains the declaration of CID-keyed font specific functions.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_CID_Registry_Ordering_Supplement">FT_Get_CID_Registry_Ordering_Supplement</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CID_H (freetype/ftcid.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_CID_Registry_Ordering_Supplement</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>       face,
-                                           <span class="keyword">const</span> <span class="keyword">char</span>*  *registry,
-                                           <span class="keyword">const</span> <span class="keyword">char</span>*  *ordering,
-                                           <a href="ft2-basic_types.html#FT_Int">FT_Int</a>       *supplement);
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the Registry/Ordering/Supplement triple (also known as the "R/O/S") from a CID-keyed font.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the input face.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>registry</b></td><td>
-<p>The registry, as a C&nbsp;string, owned by the face.</p>
-</td></tr>
-<tr valign=top><td><b>ordering</b></td><td>
-<p>The ordering, as a C&nbsp;string, owned by the face.</p>
-</td></tr>
-<tr valign=top><td><b>supplement</b></td><td>
-<p>The supplement.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function only works with CID faces, returning an error otherwise.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.6</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_CID_Is_Internally_CID_Keyed">FT_Get_CID_Is_Internally_CID_Keyed</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CID_H (freetype/ftcid.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_CID_Is_Internally_CID_Keyed</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                                      <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>  *is_cid );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the type of the input face, CID keyed or not. In constrast to the <a href="ft2-base_interface.html#FT_IS_CID_KEYED">FT_IS_CID_KEYED</a> macro this function returns successfully also for CID-keyed fonts in an SNFT wrapper.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the input face.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>is_cid</b></td><td>
-<p>The type of the face as an <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function only works with CID faces and OpenType fonts, returning an error otherwise.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.9</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_CID_From_Glyph_Index">FT_Get_CID_From_Glyph_Index</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_CID_H (freetype/ftcid.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_CID_From_Glyph_Index</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                               <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>   glyph_index,
-                               <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>  *cid );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the CID of the input glyph index.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the input face.</p>
-</td></tr>
-<tr valign=top><td><b>glyph_index</b></td><td>
-<p>The input glyph index.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>cid</b></td><td>
-<p>The CID as an <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function only works with CID faces and OpenType fonts, returning an error otherwise.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.9</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-computations.html b/docs/reference/ft2-computations.html
deleted file mode 100644 (file)
index 82a2a27..0000000
+++ /dev/null
@@ -1,832 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Computations
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_MulDiv">FT_MulDiv</a></td><td></td><td><a href="#FT_Matrix_Invert">FT_Matrix_Invert</a></td><td></td><td><a href="#FT_Tan">FT_Tan</a></td></tr>
-<tr><td></td><td><a href="#FT_MulFix">FT_MulFix</a></td><td></td><td><a href="#FT_Angle">FT_Angle</a></td><td></td><td><a href="#FT_Atan2">FT_Atan2</a></td></tr>
-<tr><td></td><td><a href="#FT_DivFix">FT_DivFix</a></td><td></td><td><a href="#FT_ANGLE_PI">FT_ANGLE_PI</a></td><td></td><td><a href="#FT_Angle_Diff">FT_Angle_Diff</a></td></tr>
-<tr><td></td><td><a href="#FT_RoundFix">FT_RoundFix</a></td><td></td><td><a href="#FT_ANGLE_2PI">FT_ANGLE_2PI</a></td><td></td><td><a href="#FT_Vector_Unit">FT_Vector_Unit</a></td></tr>
-<tr><td></td><td><a href="#FT_CeilFix">FT_CeilFix</a></td><td></td><td><a href="#FT_ANGLE_PI2">FT_ANGLE_PI2</a></td><td></td><td><a href="#FT_Vector_Rotate">FT_Vector_Rotate</a></td></tr>
-<tr><td></td><td><a href="#FT_FloorFix">FT_FloorFix</a></td><td></td><td><a href="#FT_ANGLE_PI4">FT_ANGLE_PI4</a></td><td></td><td><a href="#FT_Vector_Length">FT_Vector_Length</a></td></tr>
-<tr><td></td><td><a href="#FT_Vector_Transform">FT_Vector_Transform</a></td><td></td><td><a href="#FT_Sin">FT_Sin</a></td><td></td><td><a href="#FT_Vector_Polarize">FT_Vector_Polarize</a></td></tr>
-<tr><td></td><td><a href="#FT_Matrix_Multiply">FT_Matrix_Multiply</a></td><td></td><td><a href="#FT_Cos">FT_Cos</a></td><td></td><td><a href="#FT_Vector_From_Polar">FT_Vector_From_Polar</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains various functions used to perform computations on 16.16 fixed-float numbers or 2d vectors.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_MulDiv">FT_MulDiv</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> )
-  <b>FT_MulDiv</b>( <a href="ft2-basic_types.html#FT_Long">FT_Long</a>  a,
-             <a href="ft2-basic_types.html#FT_Long">FT_Long</a>  b,
-             <a href="ft2-basic_types.html#FT_Long">FT_Long</a>  c );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A very simple function used to perform the computation &lsquo;(a*b)/c&rsquo; with maximal accuracy (it uses a 64-bit intermediate integer whenever necessary).</p>
-<p>This function isn't necessarily as fast as some processor specific operations, but is at least completely portable.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>a</b></td><td>
-<p>The first multiplier.</p>
-</td></tr>
-<tr valign=top><td><b>b</b></td><td>
-<p>The second multiplier.</p>
-</td></tr>
-<tr valign=top><td><b>c</b></td><td>
-<p>The divisor.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The result of &lsquo;(a*b)/c&rsquo;. This function never traps when trying to divide by zero; it simply returns &lsquo;MaxInt&rsquo; or &lsquo;MinInt&rsquo; depending on the signs of &lsquo;a&rsquo; and &lsquo;b&rsquo;.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_MulFix">FT_MulFix</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> )
-  <b>FT_MulFix</b>( <a href="ft2-basic_types.html#FT_Long">FT_Long</a>  a,
-             <a href="ft2-basic_types.html#FT_Long">FT_Long</a>  b );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A very simple function used to perform the computation &lsquo;(a*b)/0x10000&rsquo; with maximal accuracy. Most of the time this is used to multiply a given value by a 16.16 fixed float factor.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>a</b></td><td>
-<p>The first multiplier.</p>
-</td></tr>
-<tr valign=top><td><b>b</b></td><td>
-<p>The second multiplier. Use a 16.16 factor here whenever possible (see note below).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The result of &lsquo;(a*b)/0x10000&rsquo;.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function has been optimized for the case where the absolute value of &lsquo;a&rsquo; is less than 2048, and &lsquo;b&rsquo; is a 16.16 scaling factor. As this happens mainly when scaling from notional units to fractional pixels in FreeType, it resulted in noticeable speed improvements between versions 2.x and 1.x.</p>
-<p>As a conclusion, always try to place a 16.16 factor as the <i>second</i> argument of this function; this can make a great difference.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_DivFix">FT_DivFix</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> )
-  <b>FT_DivFix</b>( <a href="ft2-basic_types.html#FT_Long">FT_Long</a>  a,
-             <a href="ft2-basic_types.html#FT_Long">FT_Long</a>  b );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A very simple function used to perform the computation &lsquo;(a*0x10000)/b&rsquo; with maximal accuracy. Most of the time, this is used to divide a given value by a 16.16 fixed float factor.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>a</b></td><td>
-<p>The first multiplier.</p>
-</td></tr>
-<tr valign=top><td><b>b</b></td><td>
-<p>The second multiplier. Use a 16.16 factor here whenever possible (see note below).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The result of &lsquo;(a*0x10000)/b&rsquo;.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The optimization for FT_DivFix() is simple: If (a&nbsp;&lt;&lt;&nbsp;16) fits in 32&nbsp;bits, then the division is computed directly. Otherwise, we use a specialized version of <a href="ft2-computations.html#FT_MulDiv">FT_MulDiv</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_RoundFix">FT_RoundFix</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
-  <b>FT_RoundFix</b>( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>  a );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A very simple function used to round a 16.16 fixed number.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>a</b></td><td>
-<p>The number to be rounded.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The result of &lsquo;(a + 0x8000) &amp; -0x10000&rsquo;.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_CeilFix">FT_CeilFix</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
-  <b>FT_CeilFix</b>( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>  a );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A very simple function used to compute the ceiling function of a 16.16 fixed number.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>a</b></td><td>
-<p>The number for which the ceiling function is to be computed.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The result of &lsquo;(a + 0x10000 - 1) &amp; -0x10000&rsquo;.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_FloorFix">FT_FloorFix</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
-  <b>FT_FloorFix</b>( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>  a );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A very simple function used to compute the floor function of a 16.16 fixed number.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>a</b></td><td>
-<p>The number for which the floor function is to be computed.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The result of &lsquo;a &amp; -0x10000&rsquo;.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Vector_Transform">FT_Vector_Transform</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Vector_Transform</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*        vec,
-                       <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>*  matrix );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Transform a single vector through a 2x2 matrix.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>vector</b></td><td>
-<p>The target vector to transform.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>matrix</b></td><td>
-<p>A pointer to the source 2x2 matrix.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The result is undefined if either &lsquo;vector&rsquo; or &lsquo;matrix&rsquo; is invalid.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Matrix_Multiply">FT_Matrix_Multiply</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Matrix_Multiply</b>( <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>*  a,
-                      <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>*        b );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Perform the matrix operation &lsquo;b = a*b&rsquo;.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>a</b></td><td>
-<p>A pointer to matrix &lsquo;a&rsquo;.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>b</b></td><td>
-<p>A pointer to matrix &lsquo;b&rsquo;.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The result is undefined if either &lsquo;a&rsquo; or &lsquo;b&rsquo; is zero.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Matrix_Invert">FT_Matrix_Invert</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Matrix_Invert</b>( <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>*  matrix );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Invert a 2x2 matrix. Return an error if it can't be inverted.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>matrix</b></td><td>
-<p>A pointer to the target matrix. Remains untouched in case of error.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Angle">FT_Angle</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>  <b>FT_Angle</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This type is used to model angle values in FreeType. Note that the angle is a 16.16 fixed float value expressed in degrees.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_ANGLE_PI">FT_ANGLE_PI</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_ANGLE_PI</b>  ( 180L &lt;&lt; 16 )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>The angle pi expressed in <a href="ft2-computations.html#FT_Angle">FT_Angle</a> units.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_ANGLE_2PI">FT_ANGLE_2PI</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_ANGLE_2PI</b>  ( <a href="ft2-computations.html#FT_ANGLE_PI">FT_ANGLE_PI</a> * 2 )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>The angle 2*pi expressed in <a href="ft2-computations.html#FT_Angle">FT_Angle</a> units.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_ANGLE_PI2">FT_ANGLE_PI2</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_ANGLE_PI2</b>  ( <a href="ft2-computations.html#FT_ANGLE_PI">FT_ANGLE_PI</a> / 2 )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>The angle pi/2 expressed in <a href="ft2-computations.html#FT_Angle">FT_Angle</a> units.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_ANGLE_PI4">FT_ANGLE_PI4</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_ANGLE_PI4</b>  ( <a href="ft2-computations.html#FT_ANGLE_PI">FT_ANGLE_PI</a> / 4 )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>The angle pi/4 expressed in <a href="ft2-computations.html#FT_Angle">FT_Angle</a> units.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Sin">FT_Sin</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
-  <b>FT_Sin</b>( <a href="ft2-computations.html#FT_Angle">FT_Angle</a>  angle );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the sinus of a given angle in fixed point format.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>angle</b></td><td>
-<p>The input angle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The sinus value.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>If you need both the sinus and cosinus for a given angle, use the function <a href="ft2-computations.html#FT_Vector_Unit">FT_Vector_Unit</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Cos">FT_Cos</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
-  <b>FT_Cos</b>( <a href="ft2-computations.html#FT_Angle">FT_Angle</a>  angle );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the cosinus of a given angle in fixed point format.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>angle</b></td><td>
-<p>The input angle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The cosinus value.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>If you need both the sinus and cosinus for a given angle, use the function <a href="ft2-computations.html#FT_Vector_Unit">FT_Vector_Unit</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Tan">FT_Tan</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
-  <b>FT_Tan</b>( <a href="ft2-computations.html#FT_Angle">FT_Angle</a>  angle );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the tangent of a given angle in fixed point format.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>angle</b></td><td>
-<p>The input angle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The tangent value.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Atan2">FT_Atan2</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-computations.html#FT_Angle">FT_Angle</a> )
-  <b>FT_Atan2</b>( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>  x,
-            <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>  y );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the arc-tangent corresponding to a given vector (x,y) in the 2d plane.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>x</b></td><td>
-<p>The horizontal vector coordinate.</p>
-</td></tr>
-<tr valign=top><td><b>y</b></td><td>
-<p>The vertical vector coordinate.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The arc-tangent value (i.e. angle).</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Angle_Diff">FT_Angle_Diff</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-computations.html#FT_Angle">FT_Angle</a> )
-  <b>FT_Angle_Diff</b>( <a href="ft2-computations.html#FT_Angle">FT_Angle</a>  angle1,
-                 <a href="ft2-computations.html#FT_Angle">FT_Angle</a>  angle2 );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the difference between two angles. The result is always constrained to the ]-PI..PI] interval.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>angle1</b></td><td>
-<p>First angle.</p>
-</td></tr>
-<tr valign=top><td><b>angle2</b></td><td>
-<p>Second angle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>Constrained value of &lsquo;value2-value1&rsquo;.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Vector_Unit">FT_Vector_Unit</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Vector_Unit</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  vec,
-                  <a href="ft2-computations.html#FT_Angle">FT_Angle</a>    angle );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the unit vector corresponding to a given angle. After the call, the value of &lsquo;vec.x&rsquo; will be &lsquo;sin(angle)&rsquo;, and the value of &lsquo;vec.y&rsquo; will be &lsquo;cos(angle)&rsquo;.</p>
-<p>This function is useful to retrieve both the sinus and cosinus of a given angle quickly.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>vec</b></td><td>
-<p>The address of target vector.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>angle</b></td><td>
-<p>The address of angle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Vector_Rotate">FT_Vector_Rotate</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Vector_Rotate</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  vec,
-                    <a href="ft2-computations.html#FT_Angle">FT_Angle</a>    angle );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Rotate a vector by a given angle.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>vec</b></td><td>
-<p>The address of target vector.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>angle</b></td><td>
-<p>The address of angle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Vector_Length">FT_Vector_Length</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
-  <b>FT_Vector_Length</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  vec );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the length of a given vector.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>vec</b></td><td>
-<p>The address of target vector.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The vector length, expressed in the same units that the original vector coordinates.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Vector_Polarize">FT_Vector_Polarize</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Vector_Polarize</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  vec,
-                      <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>   *length,
-                      <a href="ft2-computations.html#FT_Angle">FT_Angle</a>   *angle );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Compute both the length and angle of a given vector.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>vec</b></td><td>
-<p>The address of source vector.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>length</b></td><td>
-<p>The vector length.</p>
-</td></tr>
-<tr valign=top><td><b>angle</b></td><td>
-<p>The vector angle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Vector_From_Polar">FT_Vector_From_Polar</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Vector_From_Polar</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  vec,
-                        <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>    length,
-                        <a href="ft2-computations.html#FT_Angle">FT_Angle</a>    angle );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Compute vector coordinates from a length and angle.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>vec</b></td><td>
-<p>The address of source vector.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>length</b></td><td>
-<p>The vector length.</p>
-</td></tr>
-<tr valign=top><td><b>angle</b></td><td>
-<p>The vector angle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-font_formats.html b/docs/reference/ft2-font_formats.html
deleted file mode 100644 (file)
index 661480e..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Font Formats
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Get_X11_Font_Format">FT_Get_X11_Font_Format</a></td><td></td><td></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>The single function in this section can be used to get the font format. Note that this information is not needed normally; however, there are special cases (like in PDF devices) where it is important to differentiate, in spite of FreeType's uniform API.</p>
-<p>This function is in the X11/xf86 namespace for historical reasons and in no way depends on that windowing system.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_X11_Font_Format">FT_Get_X11_Font_Format</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_XFREE86_H (freetype/ftxf86.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">const</span> <span class="keyword">char</span>* )
-  <b>FT_Get_X11_Font_Format</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>  face );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return a string describing the format of a given face, using values which can be used as an X11 FONT_PROPERTY. Possible values are &lsquo;TrueType&rsquo;, &lsquo;Type&nbsp;1&rsquo;, &lsquo;BDF&rsquo;, &lsquo;PCF&rsquo;, &lsquo;Type&nbsp;42&rsquo;, &lsquo;CID&nbsp;Type&nbsp;1&rsquo;, &lsquo;CFF&rsquo;, &lsquo;PFR&rsquo;, and &lsquo;Windows&nbsp;FNT&rsquo;.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>Input face handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>Font format string. NULL in case of error.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-gasp_table.html b/docs/reference/ft2-gasp_table.html
deleted file mode 100644 (file)
index 8199778..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Gasp Table
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_GASP_XXX">FT_GASP_XXX</a></td><td></td><td><a href="#FT_Get_Gasp">FT_Get_Gasp</a></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>The function <a href="ft2-gasp_table.html#FT_Get_Gasp">FT_Get_Gasp</a> can be used to query a TrueType or OpenType font for specific entries in its &lsquo;gasp&rsquo; table, if any. This is mainly useful when implementing native TrueType hinting with the bytecode interpreter to duplicate the Windows text rendering results.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_GASP_XXX">FT_GASP_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GASP_H (freetype/ftgasp.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-gasp_table.html#FT_GASP_XXX">FT_GASP_NO_TABLE</a>               -1
-#define <a href="ft2-gasp_table.html#FT_GASP_XXX">FT_GASP_DO_GRIDFIT</a>           0x01
-#define <a href="ft2-gasp_table.html#FT_GASP_XXX">FT_GASP_DO_GRAY</a>              0x02
-#define <a href="ft2-gasp_table.html#FT_GASP_XXX">FT_GASP_SYMMETRIC_SMOOTHING</a>  0x08
-#define <a href="ft2-gasp_table.html#FT_GASP_XXX">FT_GASP_SYMMETRIC_GRIDFIT</a>    0x10
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of values and/or bit-flags returned by the <a href="ft2-gasp_table.html#FT_Get_Gasp">FT_Get_Gasp</a> function.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_GASP_NO_TABLE</b></td><td>
-<p>This special value means that there is no GASP table in this face. It is up to the client to decide what to do.</p>
-</td></tr>
-<tr valign=top><td><b>FT_GASP_DO_GRIDFIT</b></td><td>
-<p>Grid-fitting and hinting should be performed at the specified ppem. This <b>really</b> means TrueType bytecode interpretation. If this bit is not set, no hinting gets applied.</p>
-</td></tr>
-<tr valign=top><td><b>FT_GASP_DO_GRAY</b></td><td>
-<p>Anti-aliased rendering should be performed at the specified ppem. If not set, do monochrome rendering.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_GASP_SYMMETRIC_SMOOTHING</b></td></tr>
-<tr valign=top><td></td><td>
-<p>If set, smoothing along multiple axes must be used with ClearType.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_GASP_SYMMETRIC_GRIDFIT</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Grid-fitting must be used with ClearType's symmetric smoothing.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The bit-flags &lsquo;FT_GASP_DO_GRIDFIT&rsquo; and &lsquo;FT_GASP_DO_GRAY&rsquo; are to be used for standard font rasterization only. Independently of that, &lsquo;FT_GASP_SYMMETRIC_SMOOTHING&rsquo; and &lsquo;FT_GASP_SYMMETRIC_GRIDFIT&rsquo; are to be used if ClearType is enabled (and &lsquo;FT_GASP_DO_GRIDFIT&rsquo; and &lsquo;FT_GASP_DO_GRAY&rsquo; are consequently ignored).</p>
-<p>&lsquo;ClearType&rsquo; is Microsoft's implementation of LCD rendering, partly protected by patents.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.0</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Gasp">FT_Get_Gasp</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GASP_H (freetype/ftgasp.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Int">FT_Int</a> )
-  <b>FT_Get_Gasp</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>  face,
-               <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>  ppem );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Read the &lsquo;gasp&rsquo; table from a TrueType or OpenType font file and return the entry corresponding to a given character pixel size.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>The source face handle.</p>
-</td></tr>
-<tr valign=top><td><b>ppem</b></td><td>
-<p>The vertical character pixel size.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>Bit flags (see <a href="ft2-gasp_table.html#FT_GASP_XXX">FT_GASP_XXX</a>), or <a href="ft2-gasp_table.html#FT_GASP_XXX">FT_GASP_NO_TABLE</a> if there is no &lsquo;gasp&rsquo; table in the face.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.0</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-glyph_management.html b/docs/reference/ft2-glyph_management.html
deleted file mode 100644 (file)
index f9ba910..0000000
+++ /dev/null
@@ -1,673 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Glyph Management
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Glyph">FT_Glyph</a></td><td></td><td><a href="#FT_OutlineGlyphRec">FT_OutlineGlyphRec</a></td><td></td><td><a href="#ft_glyph_bbox_xxx">ft_glyph_bbox_xxx</a></td></tr>
-<tr><td></td><td><a href="#FT_GlyphRec">FT_GlyphRec</a></td><td></td><td><a href="#FT_Get_Glyph">FT_Get_Glyph</a></td><td></td><td><a href="#FT_Glyph_Get_CBox">FT_Glyph_Get_CBox</a></td></tr>
-<tr><td></td><td><a href="#FT_BitmapGlyph">FT_BitmapGlyph</a></td><td></td><td><a href="#FT_Glyph_Copy">FT_Glyph_Copy</a></td><td></td><td><a href="#FT_Glyph_To_Bitmap">FT_Glyph_To_Bitmap</a></td></tr>
-<tr><td></td><td><a href="#FT_BitmapGlyphRec">FT_BitmapGlyphRec</a></td><td></td><td><a href="#FT_Glyph_Transform">FT_Glyph_Transform</a></td><td></td><td><a href="#FT_Done_Glyph">FT_Done_Glyph</a></td></tr>
-<tr><td></td><td><a href="#FT_OutlineGlyph">FT_OutlineGlyph</a></td><td></td><td><a href="#FT_Glyph_BBox_Mode">FT_Glyph_BBox_Mode</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains definitions used to manage glyph data through generic FT_Glyph objects. Each of them can contain a bitmap, a vector outline, or even images in other formats.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Glyph">FT_Glyph</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_GlyphRec_*  <b>FT_Glyph</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Handle to an object used to model generic glyph images. It is a pointer to the <a href="ft2-glyph_management.html#FT_GlyphRec">FT_GlyphRec</a> structure and can contain a glyph bitmap or pointer.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Glyph objects are not owned by the library. You must thus release them manually (through <a href="ft2-glyph_management.html#FT_Done_Glyph">FT_Done_Glyph</a>) <i>before</i> calling <a href="ft2-base_interface.html#FT_Done_FreeType">FT_Done_FreeType</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_GlyphRec">FT_GlyphRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_GlyphRec_
-  {
-    <a href="ft2-base_interface.html#FT_Library">FT_Library</a>             library;
-    <span class="keyword">const</span> FT_Glyph_Class*  clazz;
-    <a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a>        format;
-    <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>              advance;
-
-  } <b>FT_GlyphRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>The root glyph structure contains a given glyph image plus its advance width in 16.16 fixed float format.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the FreeType library object.</p>
-</td></tr>
-<tr valign=top><td><b>clazz</b></td><td>
-<p>A pointer to the glyph's class. Private.</p>
-</td></tr>
-<tr valign=top><td><b>format</b></td><td>
-<p>The format of the glyph's image.</p>
-</td></tr>
-<tr valign=top><td><b>advance</b></td><td>
-<p>A 16.16 vector that gives the glyph's advance width.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_BitmapGlyph">FT_BitmapGlyph</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_BitmapGlyphRec_*  <b>FT_BitmapGlyph</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to an object used to model a bitmap glyph image. This is a sub-class of <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>, and a pointer to <a href="ft2-glyph_management.html#FT_BitmapGlyphRec">FT_BitmapGlyphRec</a>.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_BitmapGlyphRec">FT_BitmapGlyphRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_BitmapGlyphRec_
-  {
-    <a href="ft2-glyph_management.html#FT_GlyphRec">FT_GlyphRec</a>  root;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>       left;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>       top;
-    <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>    bitmap;
-
-  } <b>FT_BitmapGlyphRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used for bitmap glyph images. This really is a &lsquo;sub-class&rsquo; of <a href="ft2-glyph_management.html#FT_GlyphRec">FT_GlyphRec</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>root</b></td><td>
-<p>The root <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> fields.</p>
-</td></tr>
-<tr valign=top><td><b>left</b></td><td>
-<p>The left-side bearing, i.e., the horizontal distance from the current pen position to the left border of the glyph bitmap.</p>
-</td></tr>
-<tr valign=top><td><b>top</b></td><td>
-<p>The top-side bearing, i.e., the vertical distance from the current pen position to the top border of the glyph bitmap. This distance is positive for upwards&nbsp;y!</p>
-</td></tr>
-<tr valign=top><td><b>bitmap</b></td><td>
-<p>A descriptor for the bitmap.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>You can typecast an <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> to <a href="ft2-glyph_management.html#FT_BitmapGlyph">FT_BitmapGlyph</a> if you have &lsquo;glyph-&gt;format == FT_GLYPH_FORMAT_BITMAP&rsquo;. This lets you access the bitmap's contents easily.</p>
-<p>The corresponding pixel buffer is always owned by <a href="ft2-glyph_management.html#FT_BitmapGlyph">FT_BitmapGlyph</a> and is thus created and destroyed with it.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_OutlineGlyph">FT_OutlineGlyph</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_OutlineGlyphRec_*  <b>FT_OutlineGlyph</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to an object used to model an outline glyph image. This is a sub-class of <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>, and a pointer to <a href="ft2-glyph_management.html#FT_OutlineGlyphRec">FT_OutlineGlyphRec</a>.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_OutlineGlyphRec">FT_OutlineGlyphRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_OutlineGlyphRec_
-  {
-    <a href="ft2-glyph_management.html#FT_GlyphRec">FT_GlyphRec</a>  root;
-    <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>   outline;
-
-  } <b>FT_OutlineGlyphRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used for outline (vectorial) glyph images. This really is a &lsquo;sub-class&rsquo; of <a href="ft2-glyph_management.html#FT_GlyphRec">FT_GlyphRec</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>root</b></td><td>
-<p>The root <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> fields.</p>
-</td></tr>
-<tr valign=top><td><b>outline</b></td><td>
-<p>A descriptor for the outline.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>You can typecast an <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> to <a href="ft2-glyph_management.html#FT_OutlineGlyph">FT_OutlineGlyph</a> if you have &lsquo;glyph-&gt;format == FT_GLYPH_FORMAT_OUTLINE&rsquo;. This lets you access the outline's content easily.</p>
-<p>As the outline is extracted from a glyph slot, its coordinates are expressed normally in 26.6 pixels, unless the flag <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a> was used in <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a>() or <a href="ft2-base_interface.html#FT_Load_Char">FT_Load_Char</a>().</p>
-<p>The outline's tables are always owned by the object and are destroyed with it.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Glyph">FT_Get_Glyph</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_Glyph</b>( <a href="ft2-base_interface.html#FT_GlyphSlot">FT_GlyphSlot</a>  slot,
-                <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>     *aglyph );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to extract a glyph image from a slot. Note that the created <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> object must be released with <a href="ft2-glyph_management.html#FT_Done_Glyph">FT_Done_Glyph</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>slot</b></td><td>
-<p>A handle to the source glyph slot.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aglyph</b></td><td>
-<p>A handle to the glyph object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Glyph_Copy">FT_Glyph_Copy</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Glyph_Copy</b>( <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>   source,
-                 <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>  *target );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to copy a glyph image. Note that the created <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> object must be released with <a href="ft2-glyph_management.html#FT_Done_Glyph">FT_Done_Glyph</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>source</b></td><td>
-<p>A handle to the source glyph object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>target</b></td><td>
-<p>A handle to the target glyph object. 0&nbsp;in case of error.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Glyph_Transform">FT_Glyph_Transform</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Glyph_Transform</b>( <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>    glyph,
-                      <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>*  matrix,
-                      <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  delta );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Transform a glyph image if its format is scalable.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>glyph</b></td><td>
-<p>A handle to the target glyph object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>matrix</b></td><td>
-<p>A pointer to a 2x2 matrix to apply.</p>
-</td></tr>
-<tr valign=top><td><b>delta</b></td><td>
-<p>A pointer to a 2d vector to apply. Coordinates are expressed in 1/64th of a pixel.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code (if not 0, the glyph format is not scalable).</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The 2x2 transformation matrix is also applied to the glyph's advance vector.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Glyph_BBox_Mode">FT_Glyph_BBox_Mode</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_Glyph_BBox_Mode_
-  {
-    <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_UNSCALED</a>  = 0,
-    <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_SUBPIXELS</a> = 0,
-    <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_GRIDFIT</a>   = 1,
-    <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_TRUNCATE</a>  = 2,
-    <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_PIXELS</a>    = 3
-
-  } <b>FT_Glyph_BBox_Mode</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>The mode how the values of <a href="ft2-glyph_management.html#FT_Glyph_Get_CBox">FT_Glyph_Get_CBox</a> are returned.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_GLYPH_BBOX_UNSCALED</b></td><td>
-<p>Return unscaled font units.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_GLYPH_BBOX_SUBPIXELS</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Return unfitted 26.6 coordinates.</p>
-</td></tr>
-<tr valign=top><td><b>FT_GLYPH_BBOX_GRIDFIT</b></td><td>
-<p>Return grid-fitted 26.6 coordinates.</p>
-</td></tr>
-<tr valign=top><td><b>FT_GLYPH_BBOX_TRUNCATE</b></td><td>
-<p>Return coordinates in integer pixels.</p>
-</td></tr>
-<tr valign=top><td><b>FT_GLYPH_BBOX_PIXELS</b></td><td>
-<p>Return grid-fitted pixel coordinates.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="ft_glyph_bbox_xxx">ft_glyph_bbox_xxx</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_unscaled</a>   <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_UNSCALED</a>
-#define <a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_subpixels</a>  <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_SUBPIXELS</a>
-#define <a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_gridfit</a>    <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_GRIDFIT</a>
-#define <a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_truncate</a>   <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_TRUNCATE</a>
-#define <a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_pixels</a>     <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_PIXELS</a>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>These constants are deprecated. Use the corresponding <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_Glyph_BBox_Mode</a> values instead.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>ft_glyph_bbox_unscaled</b></td><td>
-<p>See <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_UNSCALED</a>.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>ft_glyph_bbox_subpixels</b></td></tr>
-<tr valign=top><td></td><td>
-<p>See <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_SUBPIXELS</a>.</p>
-</td></tr>
-<tr valign=top><td><b>ft_glyph_bbox_gridfit</b></td><td>
-<p>See <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_GRIDFIT</a>.</p>
-</td></tr>
-<tr valign=top><td><b>ft_glyph_bbox_truncate</b></td><td>
-<p>See <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_TRUNCATE</a>.</p>
-</td></tr>
-<tr valign=top><td><b>ft_glyph_bbox_pixels</b></td><td>
-<p>See <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_PIXELS</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Glyph_Get_CBox">FT_Glyph_Get_CBox</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Glyph_Get_CBox</b>( <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>  glyph,
-                     <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>   bbox_mode,
-                     <a href="ft2-basic_types.html#FT_BBox">FT_BBox</a>  *acbox );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return a glyph's &lsquo;control box&rsquo;. The control box encloses all the outline's points, including Bézier control points. Though it coincides with the exact bounding box for most glyphs, it can be slightly larger in some situations (like when rotating an outline which contains Bézier outside arcs).</p>
-<p>Computing the control box is very fast, while getting the bounding box can take much more time as it needs to walk over all segments and arcs in the outline. To get the latter, you can use the &lsquo;ftbbox&rsquo; component which is dedicated to this single task.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>glyph</b></td><td>
-<p>A handle to the source glyph object.</p>
-</td></tr>
-<tr valign=top><td><b>mode</b></td><td>
-<p>The mode which indicates how to interpret the returned bounding box values.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>acbox</b></td><td>
-<p>The glyph coordinate bounding box. Coordinates are expressed in 1/64th of pixels if it is grid-fitted.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Coordinates are relative to the glyph origin, using the y&nbsp;upwards convention.</p>
-<p>If the glyph has been loaded with <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a>, &lsquo;bbox_mode&rsquo; must be set to <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_UNSCALED</a> to get unscaled font units in 26.6 pixel format. The value <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_SUBPIXELS</a> is another name for this constant.</p>
-<p>If the font is tricky and the glyph has been loaded with <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a>, 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.</p>
-<p>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:</p>
-<pre class="colored">
-  width  = bbox.xMax - bbox.xMin;                                  
-  height = bbox.yMax - bbox.yMin;                                  
-</pre>
-<p>Note also that for 26.6 coordinates, if &lsquo;bbox_mode&rsquo; is set to <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_GRIDFIT</a>, the coordinates will also be grid-fitted, which corresponds to:</p>
-<pre class="colored">
-  bbox.xMin = FLOOR(bbox.xMin);                                    
-  bbox.yMin = FLOOR(bbox.yMin);                                    
-  bbox.xMax = CEILING(bbox.xMax);                                  
-  bbox.yMax = CEILING(bbox.yMax);                                  
-</pre>
-<p>To get the bbox in pixel coordinates, set &lsquo;bbox_mode&rsquo; to <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_TRUNCATE</a>.</p>
-<p>To get the bbox in grid-fitted pixel coordinates, set &lsquo;bbox_mode&rsquo; to <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_PIXELS</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Glyph_To_Bitmap">FT_Glyph_To_Bitmap</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Glyph_To_Bitmap</b>( <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>*       the_glyph,
-                      <a href="ft2-base_interface.html#FT_Render_Mode">FT_Render_Mode</a>  render_mode,
-                      <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*      origin,
-                      <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>         destroy );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Convert a given glyph object to a bitmap glyph object.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>the_glyph</b></td><td>
-<p>A pointer to a handle to the target glyph.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>render_mode</b></td><td>
-<p>An enumeration that describes how the data is rendered.</p>
-</td></tr>
-<tr valign=top><td><b>origin</b></td><td>
-<p>A pointer to a vector used to translate the glyph image before rendering. Can be&nbsp;0 (if no translation). The origin is expressed in 26.6 pixels.</p>
-</td></tr>
-<tr valign=top><td><b>destroy</b></td><td>
-<p>A boolean that indicates that the original glyph image should be destroyed by this function. It is never destroyed in case of error.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function does nothing if the glyph format isn't scalable.</p>
-<p>The glyph image is translated with the &lsquo;origin&rsquo; vector before rendering.</p>
-<p>The first parameter is a pointer to an <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> handle, that will be <i>replaced</i> by this function (with newly allocated data). Typically, you would use (omitting error handling):</p>
-<p></p>
-<pre class="colored">
-  FT_Glyph        glyph;                                         
-  FT_BitmapGlyph  glyph_bitmap;                                  
-                                                                 
-                                                                 
-  // load glyph                                                  
-  error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT );     
-                                                                 
-  // extract glyph image                                         
-  error = FT_Get_Glyph( face-&gt;glyph, &amp;glyph );                   
-                                                                 
-  // convert to a bitmap (default render mode + destroying old)  
-  if ( glyph-&gt;format != FT_GLYPH_FORMAT_BITMAP )                 
-  {                                                              
-    error = FT_Glyph_To_Bitmap( &amp;glyph, FT_RENDER_MODE_NORMAL,   
-                                0, 1 );                          
-    if ( error ) // `glyph' unchanged                            
-      ...                                                        
-  }                                                              
-                                                                 
-  // access bitmap content by typecasting                        
-  glyph_bitmap = (FT_BitmapGlyph)glyph;                          
-                                                                 
-  // do funny stuff with it, like blitting/drawing               
-  ...                                                            
-                                                                 
-  // discard glyph image (bitmap or not)                         
-  FT_Done_Glyph( glyph );                                        
-</pre>
-<p></p>
-<p>Here another example, again without error handling:</p>
-<p></p>
-<pre class="colored">
-  FT_Glyph  glyphs[MAX_GLYPHS]                                   
-                                                                 
-                                                                 
-  ...                                                            
-                                                                 
-  for ( idx = 0; i &lt; MAX_GLYPHS; i++ )                           
-    error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) ||       
-            FT_Get_Glyph ( face-&gt;glyph, &amp;glyph[idx] );           
-                                                                 
-  ...                                                            
-                                                                 
-  for ( idx = 0; i &lt; MAX_GLYPHS; i++ )                           
-  {                                                              
-    FT_Glyph  bitmap = glyphs[idx];                              
-                                                                 
-                                                                 
-    ...                                                          
-                                                                 
-    // after this call, `bitmap' no longer points into           
-    // the `glyphs' array (and the old value isn't destroyed)    
-    FT_Glyph_To_Bitmap( &amp;bitmap, FT_RENDER_MODE_MONO, 0, 0 );    
-                                                                 
-    ...                                                          
-                                                                 
-    FT_Done_Glyph( bitmap );                                     
-  }                                                              
-                                                                 
-  ...                                                            
-                                                                 
-  for ( idx = 0; i &lt; MAX_GLYPHS; i++ )                           
-    FT_Done_Glyph( glyphs[idx] );                                
-</pre>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Done_Glyph">FT_Done_Glyph</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GLYPH_H (freetype/ftglyph.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Done_Glyph</b>( <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>  glyph );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Destroy a given glyph.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>glyph</b></td><td>
-<p>A handle to the target glyph object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-glyph_stroker.html b/docs/reference/ft2-glyph_stroker.html
deleted file mode 100644 (file)
index 441ea6d..0000000
+++ /dev/null
@@ -1,938 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Glyph Stroker
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Stroker">FT_Stroker</a></td><td></td><td><a href="#FT_Stroker_EndSubPath">FT_Stroker_EndSubPath</a></td></tr>
-<tr><td></td><td><a href="#FT_Stroker_LineJoin">FT_Stroker_LineJoin</a></td><td></td><td><a href="#FT_Stroker_LineTo">FT_Stroker_LineTo</a></td></tr>
-<tr><td></td><td><a href="#FT_Stroker_LineCap">FT_Stroker_LineCap</a></td><td></td><td><a href="#FT_Stroker_ConicTo">FT_Stroker_ConicTo</a></td></tr>
-<tr><td></td><td><a href="#FT_StrokerBorder">FT_StrokerBorder</a></td><td></td><td><a href="#FT_Stroker_CubicTo">FT_Stroker_CubicTo</a></td></tr>
-<tr><td></td><td><a href="#FT_Outline_GetInsideBorder">FT_Outline_GetInsideBorder</a></td><td></td><td><a href="#FT_Stroker_GetBorderCounts">FT_Stroker_GetBorderCounts</a></td></tr>
-<tr><td></td><td><a href="#FT_Outline_GetOutsideBorder">FT_Outline_GetOutsideBorder</a></td><td></td><td><a href="#FT_Stroker_ExportBorder">FT_Stroker_ExportBorder</a></td></tr>
-<tr><td></td><td><a href="#FT_Stroker_New">FT_Stroker_New</a></td><td></td><td><a href="#FT_Stroker_GetCounts">FT_Stroker_GetCounts</a></td></tr>
-<tr><td></td><td><a href="#FT_Stroker_Set">FT_Stroker_Set</a></td><td></td><td><a href="#FT_Stroker_Export">FT_Stroker_Export</a></td></tr>
-<tr><td></td><td><a href="#FT_Stroker_Rewind">FT_Stroker_Rewind</a></td><td></td><td><a href="#FT_Stroker_Done">FT_Stroker_Done</a></td></tr>
-<tr><td></td><td><a href="#FT_Stroker_ParseOutline">FT_Stroker_ParseOutline</a></td><td></td><td><a href="#FT_Glyph_Stroke">FT_Glyph_Stroke</a></td></tr>
-<tr><td></td><td><a href="#FT_Stroker_BeginSubPath">FT_Stroker_BeginSubPath</a></td><td></td><td><a href="#FT_Glyph_StrokeBorder">FT_Glyph_StrokeBorder</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This component generates stroked outlines of a given vectorial glyph. It also allows you to retrieve the &lsquo;outside&rsquo; and/or the &lsquo;inside&rsquo; borders of the stroke.</p>
-<p>This can be useful to generate &lsquo;bordered&rsquo; glyph, i.e., glyphs displayed with a coloured (and anti-aliased) border around their shape.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker">FT_Stroker</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_StrokerRec_*  <b>FT_Stroker</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Opaque handler to a path stroker object.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_LineJoin">FT_Stroker_LineJoin</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_Stroker_LineJoin_
-  {
-    <a href="ft2-glyph_stroker.html#FT_Stroker_LineJoin">FT_STROKER_LINEJOIN_ROUND</a>          = 0,
-    <a href="ft2-glyph_stroker.html#FT_Stroker_LineJoin">FT_STROKER_LINEJOIN_BEVEL</a>          = 1,
-    <a href="ft2-glyph_stroker.html#FT_Stroker_LineJoin">FT_STROKER_LINEJOIN_MITER_VARIABLE</a> = 2,
-    <a href="ft2-glyph_stroker.html#FT_Stroker_LineJoin">FT_STROKER_LINEJOIN_MITER</a>          = <a href="ft2-glyph_stroker.html#FT_Stroker_LineJoin">FT_STROKER_LINEJOIN_MITER_VARIABLE</a>,
-    <a href="ft2-glyph_stroker.html#FT_Stroker_LineJoin">FT_STROKER_LINEJOIN_MITER_FIXED</a>    = 3
-
-  } <b>FT_Stroker_LineJoin</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>These values determine how two joining lines are rendered in a stroker.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td colspan=0><b>FT_STROKER_LINEJOIN_ROUND</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Used to render rounded line joins. Circular arcs are used to join two lines smoothly.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_STROKER_LINEJOIN_BEVEL</b></td></tr>
-<tr valign=top><td></td><td>
-<p>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.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_STROKER_LINEJOIN_MITER_FIXED</b></td></tr>
-<tr valign=top><td></td><td>
-<p>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.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_STROKER_LINEJOIN_MITER_VARIABLE</b></td></tr>
-<tr valign=top><td></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_STROKER_LINEJOIN_MITER</b></td></tr>
-<tr valign=top><td></td><td>
-<p>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.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_LineCap">FT_Stroker_LineCap</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_Stroker_LineCap_
-  {
-    <a href="ft2-glyph_stroker.html#FT_Stroker_LineCap">FT_STROKER_LINECAP_BUTT</a> = 0,
-    <a href="ft2-glyph_stroker.html#FT_Stroker_LineCap">FT_STROKER_LINECAP_ROUND</a>,
-    <a href="ft2-glyph_stroker.html#FT_Stroker_LineCap">FT_STROKER_LINECAP_SQUARE</a>
-
-  } <b>FT_Stroker_LineCap</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>These values determine how the end of opened sub-paths are rendered in a stroke.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td colspan=0><b>FT_STROKER_LINECAP_BUTT</b></td></tr>
-<tr valign=top><td></td><td>
-<p>The end of lines is rendered as a full stop on the last point itself.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_STROKER_LINECAP_ROUND</b></td></tr>
-<tr valign=top><td></td><td>
-<p>The end of lines is rendered as a half-circle around the last point.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_STROKER_LINECAP_SQUARE</b></td></tr>
-<tr valign=top><td></td><td>
-<p>The end of lines is rendered as a square around the last point.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_StrokerBorder">FT_StrokerBorder</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_StrokerBorder_
-  {
-    <a href="ft2-glyph_stroker.html#FT_StrokerBorder">FT_STROKER_BORDER_LEFT</a> = 0,
-    <a href="ft2-glyph_stroker.html#FT_StrokerBorder">FT_STROKER_BORDER_RIGHT</a>
-
-  } <b>FT_StrokerBorder</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>These values are used to select a given stroke border in <a href="ft2-glyph_stroker.html#FT_Stroker_GetBorderCounts">FT_Stroker_GetBorderCounts</a> and <a href="ft2-glyph_stroker.html#FT_Stroker_ExportBorder">FT_Stroker_ExportBorder</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_STROKER_BORDER_LEFT</b></td><td>
-<p>Select the left border, relative to the drawing direction.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_STROKER_BORDER_RIGHT</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Select the right border, relative to the drawing direction.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Applications are generally interested in the &lsquo;inside&rsquo; and &lsquo;outside&rsquo; borders. However, there is no direct mapping between these and the &lsquo;left&rsquo; and &lsquo;right&rsquo; ones, since this really depends on the glyph's drawing orientation, which varies between font formats.</p>
-<p>You can however use <a href="ft2-glyph_stroker.html#FT_Outline_GetInsideBorder">FT_Outline_GetInsideBorder</a> and <a href="ft2-glyph_stroker.html#FT_Outline_GetOutsideBorder">FT_Outline_GetOutsideBorder</a> to get these.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_GetInsideBorder">FT_Outline_GetInsideBorder</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-glyph_stroker.html#FT_StrokerBorder">FT_StrokerBorder</a> )
-  <b>FT_Outline_GetInsideBorder</b>( <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  outline );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the <a href="ft2-glyph_stroker.html#FT_StrokerBorder">FT_StrokerBorder</a> value corresponding to the &lsquo;inside&rsquo; borders of a given outline.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>outline</b></td><td>
-<p>The source outline handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The border index. <a href="ft2-glyph_stroker.html#FT_StrokerBorder">FT_STROKER_BORDER_RIGHT</a> for empty or invalid outlines.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_GetOutsideBorder">FT_Outline_GetOutsideBorder</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-glyph_stroker.html#FT_StrokerBorder">FT_StrokerBorder</a> )
-  <b>FT_Outline_GetOutsideBorder</b>( <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  outline );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the <a href="ft2-glyph_stroker.html#FT_StrokerBorder">FT_StrokerBorder</a> value corresponding to the &lsquo;outside&rsquo; borders of a given outline.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>outline</b></td><td>
-<p>The source outline handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The border index. <a href="ft2-glyph_stroker.html#FT_StrokerBorder">FT_STROKER_BORDER_LEFT</a> for empty or invalid outlines.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_New">FT_Stroker_New</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Stroker_New</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>   library,
-                  <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>  *astroker );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Create a new stroker object.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>FreeType library handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>astroker</b></td><td>
-<p>A new stroker object handle. NULL in case of error.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_Set">FT_Stroker_Set</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Stroker_Set</b>( <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>           stroker,
-                  <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>             radius,
-                  <a href="ft2-glyph_stroker.html#FT_Stroker_LineCap">FT_Stroker_LineCap</a>   line_cap,
-                  <a href="ft2-glyph_stroker.html#FT_Stroker_LineJoin">FT_Stroker_LineJoin</a>  line_join,
-                  <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>             miter_limit );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Reset a stroker object's attributes.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>The target stroker handle.</p>
-</td></tr>
-<tr valign=top><td><b>radius</b></td><td>
-<p>The border radius.</p>
-</td></tr>
-<tr valign=top><td><b>line_cap</b></td><td>
-<p>The line cap style.</p>
-</td></tr>
-<tr valign=top><td><b>line_join</b></td><td>
-<p>The line join style.</p>
-</td></tr>
-<tr valign=top><td><b>miter_limit</b></td><td>
-<p>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.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The radius is expressed in the same units as the outline coordinates.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_Rewind">FT_Stroker_Rewind</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Stroker_Rewind</b>( <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>  stroker );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Reset a stroker object without changing its attributes. You should call this function before beginning a new series of calls to <a href="ft2-glyph_stroker.html#FT_Stroker_BeginSubPath">FT_Stroker_BeginSubPath</a> or <a href="ft2-glyph_stroker.html#FT_Stroker_EndSubPath">FT_Stroker_EndSubPath</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>The target stroker handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_ParseOutline">FT_Stroker_ParseOutline</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Stroker_ParseOutline</b>( <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>   stroker,
-                           <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  outline,
-                           <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>      opened );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A convenience function used to parse a whole outline with the stroker. The resulting outline(s) can be retrieved later by functions like <a href="ft2-glyph_stroker.html#FT_Stroker_GetCounts">FT_Stroker_GetCounts</a> and <a href="ft2-glyph_stroker.html#FT_Stroker_Export">FT_Stroker_Export</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>The target stroker handle.</p>
-</td></tr>
-<tr valign=top><td><b>outline</b></td><td>
-<p>The source outline.</p>
-</td></tr>
-<tr valign=top><td><b>opened</b></td><td>
-<p>A boolean. If&nbsp;1, the outline is treated as an open path instead of a closed one.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>If &lsquo;opened&rsquo; is&nbsp;0 (the default), the outline is treated as a closed path, and the stroker generates two distinct &lsquo;border&rsquo; outlines.</p>
-<p>If &lsquo;opened&rsquo; is&nbsp;1, the outline is processed as an open path, and the stroker generates a single &lsquo;stroke&rsquo; outline.</p>
-<p>This function calls <a href="ft2-glyph_stroker.html#FT_Stroker_Rewind">FT_Stroker_Rewind</a> automatically.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_BeginSubPath">FT_Stroker_BeginSubPath</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Stroker_BeginSubPath</b>( <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>  stroker,
-                           <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  to,
-                           <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>     open );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Start a new sub-path in the stroker.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>The target stroker handle.</p>
-</td></tr>
-<tr valign=top><td><b>to</b></td><td>
-<p>A pointer to the start vector.</p>
-</td></tr>
-<tr valign=top><td><b>open</b></td><td>
-<p>A boolean. If&nbsp;1, the sub-path is treated as an open one.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function is useful when you need to stroke a path that is not stored as an <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a> object.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_EndSubPath">FT_Stroker_EndSubPath</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Stroker_EndSubPath</b>( <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>  stroker );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Close the current sub-path in the stroker.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>The target stroker handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>You should call this function after <a href="ft2-glyph_stroker.html#FT_Stroker_BeginSubPath">FT_Stroker_BeginSubPath</a>. If the subpath was not &lsquo;opened&rsquo;, this function &lsquo;draws&rsquo; a single line segment to the start position when needed.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_LineTo">FT_Stroker_LineTo</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Stroker_LineTo</b>( <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>  stroker,
-                     <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  to );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>&lsquo;Draw&rsquo; a single line segment in the stroker's current sub-path, from the last position.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>The target stroker handle.</p>
-</td></tr>
-<tr valign=top><td><b>to</b></td><td>
-<p>A pointer to the destination point.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>You should call this function between <a href="ft2-glyph_stroker.html#FT_Stroker_BeginSubPath">FT_Stroker_BeginSubPath</a> and <a href="ft2-glyph_stroker.html#FT_Stroker_EndSubPath">FT_Stroker_EndSubPath</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_ConicTo">FT_Stroker_ConicTo</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Stroker_ConicTo</b>( <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>  stroker,
-                      <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  control,
-                      <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  to );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>&lsquo;Draw&rsquo; a single quadratic Bézier in the stroker's current sub-path, from the last position.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>The target stroker handle.</p>
-</td></tr>
-<tr valign=top><td><b>control</b></td><td>
-<p>A pointer to a Bézier control point.</p>
-</td></tr>
-<tr valign=top><td><b>to</b></td><td>
-<p>A pointer to the destination point.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>You should call this function between <a href="ft2-glyph_stroker.html#FT_Stroker_BeginSubPath">FT_Stroker_BeginSubPath</a> and <a href="ft2-glyph_stroker.html#FT_Stroker_EndSubPath">FT_Stroker_EndSubPath</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_CubicTo">FT_Stroker_CubicTo</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Stroker_CubicTo</b>( <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>  stroker,
-                      <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  control1,
-                      <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  control2,
-                      <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  to );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>&lsquo;Draw&rsquo; a single cubic Bézier in the stroker's current sub-path, from the last position.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>The target stroker handle.</p>
-</td></tr>
-<tr valign=top><td><b>control1</b></td><td>
-<p>A pointer to the first Bézier control point.</p>
-</td></tr>
-<tr valign=top><td><b>control2</b></td><td>
-<p>A pointer to second Bézier control point.</p>
-</td></tr>
-<tr valign=top><td><b>to</b></td><td>
-<p>A pointer to the destination point.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>You should call this function between <a href="ft2-glyph_stroker.html#FT_Stroker_BeginSubPath">FT_Stroker_BeginSubPath</a> and <a href="ft2-glyph_stroker.html#FT_Stroker_EndSubPath">FT_Stroker_EndSubPath</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_GetBorderCounts">FT_Stroker_GetBorderCounts</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Stroker_GetBorderCounts</b>( <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>        stroker,
-                              <a href="ft2-glyph_stroker.html#FT_StrokerBorder">FT_StrokerBorder</a>  border,
-                              <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>          *anum_points,
-                              <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>          *anum_contours );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Call this function once you have finished parsing your paths with the stroker. It returns the number of points and contours necessary to export one of the &lsquo;border&rsquo; or &lsquo;stroke&rsquo; outlines generated by the stroker.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>The target stroker handle.</p>
-</td></tr>
-<tr valign=top><td><b>border</b></td><td>
-<p>The border index.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>anum_points</b></td><td>
-<p>The number of points.</p>
-</td></tr>
-<tr valign=top><td><b>anum_contours</b></td><td>
-<p>The number of contours.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>When an outline, or a sub-path, is &lsquo;closed&rsquo;, the stroker generates two independent &lsquo;border&rsquo; outlines, named &lsquo;left&rsquo; and &lsquo;right&rsquo;.</p>
-<p>When the outline, or a sub-path, is &lsquo;opened&rsquo;, the stroker merges the &lsquo;border&rsquo; outlines with caps. The &lsquo;left&rsquo; border receives all points, while the &lsquo;right&rsquo; border becomes empty.</p>
-<p>Use the function <a href="ft2-glyph_stroker.html#FT_Stroker_GetCounts">FT_Stroker_GetCounts</a> instead if you want to retrieve the counts associated to both borders.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_ExportBorder">FT_Stroker_ExportBorder</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Stroker_ExportBorder</b>( <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>        stroker,
-                           <a href="ft2-glyph_stroker.html#FT_StrokerBorder">FT_StrokerBorder</a>  border,
-                           <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*       outline );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Call this function after <a href="ft2-glyph_stroker.html#FT_Stroker_GetBorderCounts">FT_Stroker_GetBorderCounts</a> to export the corresponding border to your own <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a> structure.</p>
-<p>Note that this function appends the border points and contours to your outline, but does not try to resize its arrays.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>The target stroker handle.</p>
-</td></tr>
-<tr valign=top><td><b>border</b></td><td>
-<p>The border index.</p>
-</td></tr>
-<tr valign=top><td><b>outline</b></td><td>
-<p>The target outline handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Always call this function after <a href="ft2-glyph_stroker.html#FT_Stroker_GetBorderCounts">FT_Stroker_GetBorderCounts</a> to get sure that there is enough room in your <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a> object to receive all new data.</p>
-<p>When an outline, or a sub-path, is &lsquo;closed&rsquo;, the stroker generates two independent &lsquo;border&rsquo; outlines, named &lsquo;left&rsquo; and &lsquo;right&rsquo;</p>
-<p>When the outline, or a sub-path, is &lsquo;opened&rsquo;, the stroker merges the &lsquo;border&rsquo; outlines with caps. The &lsquo;left&rsquo; border receives all points, while the &lsquo;right&rsquo; border becomes empty.</p>
-<p>Use the function <a href="ft2-glyph_stroker.html#FT_Stroker_Export">FT_Stroker_Export</a> instead if you want to retrieve all borders at once.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_GetCounts">FT_Stroker_GetCounts</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Stroker_GetCounts</b>( <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>  stroker,
-                        <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>    *anum_points,
-                        <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>    *anum_contours );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Call this function once you have finished parsing your paths with the stroker. It returns the number of points and contours necessary to export all points/borders from the stroked outline/path.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>The target stroker handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>anum_points</b></td><td>
-<p>The number of points.</p>
-</td></tr>
-<tr valign=top><td><b>anum_contours</b></td><td>
-<p>The number of contours.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_Export">FT_Stroker_Export</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Stroker_Export</b>( <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>   stroker,
-                     <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  outline );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Call this function after <a href="ft2-glyph_stroker.html#FT_Stroker_GetBorderCounts">FT_Stroker_GetBorderCounts</a> to export all borders to your own <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a> structure.</p>
-<p>Note that this function appends the border points and contours to your outline, but does not try to resize its arrays.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>The target stroker handle.</p>
-</td></tr>
-<tr valign=top><td><b>outline</b></td><td>
-<p>The target outline handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stroker_Done">FT_Stroker_Done</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Stroker_Done</b>( <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>  stroker );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Destroy a stroker object.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>A stroker handle. Can be NULL.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Glyph_Stroke">FT_Glyph_Stroke</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Glyph_Stroke</b>( <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>    *pglyph,
-                   <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>   stroker,
-                   <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>      destroy );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Stroke a given outline glyph object with a given stroker.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>pglyph</b></td><td>
-<p>Source glyph handle on input, new glyph handle on output.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>A stroker handle.</p>
-</td></tr>
-<tr valign=top><td><b>destroy</b></td><td>
-<p>A Boolean. If&nbsp;1, the source glyph object is destroyed on success.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The source glyph is untouched in case of error.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Glyph_StrokeBorder">FT_Glyph_StrokeBorder</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_STROKER_H (freetype/ftstroke.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Glyph_StrokeBorder</b>( <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>    *pglyph,
-                         <a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a>   stroker,
-                         <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>      inside,
-                         <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>      destroy );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Stroke a given outline glyph object with a given stroker, but only return either its inside or outside border.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>pglyph</b></td><td>
-<p>Source glyph handle on input, new glyph handle on output.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stroker</b></td><td>
-<p>A stroker handle.</p>
-</td></tr>
-<tr valign=top><td><b>inside</b></td><td>
-<p>A Boolean. If&nbsp;1, return the inside border, otherwise the outside border.</p>
-</td></tr>
-<tr valign=top><td><b>destroy</b></td><td>
-<p>A Boolean. If&nbsp;1, the source glyph object is destroyed on success.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The source glyph is untouched in case of error.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-glyph_variants.html b/docs/reference/ft2-glyph_variants.html
deleted file mode 100644 (file)
index 04b5f97..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Glyph Variants
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Face_GetCharVariantIndex">FT_Face_GetCharVariantIndex</a></td><td></td><td><a href="#FT_Face_GetVariantsOfChar">FT_Face_GetVariantsOfChar</a></td></tr>
-<tr><td></td><td><a href="#FT_Face_GetCharVariantIsDefault">FT_Face_GetCharVariantIsDefault</a></td><td></td><td><a href="#FT_Face_GetCharsOfVariant">FT_Face_GetCharsOfVariant</a></td></tr>
-<tr><td></td><td><a href="#FT_Face_GetVariantSelectors">FT_Face_GetVariantSelectors</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>Many CJK characters have variant forms. They are a sort of grey area somewhere between being totally irrelevant and semantically distinct; for this reason, the Unicode consortium decided to introduce Ideographic Variation Sequences (IVS), consisting of a Unicode base character and one of 240 variant selectors (U+E0100-U+E01EF), instead of further extending the already huge code range for CJK characters.</p>
-<p>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&nbsp;such IVS.</p>
-<p>Adobe and MS decided to support IVS with a new cmap subtable (format&nbsp;14). It is an odd subtable because it is not a mapping of input code points to glyphs, but contains lists of all variants supported by the font.</p>
-<p>A variant may be either &lsquo;default&rsquo; or &lsquo;non-default&rsquo;. A default variant is the one you will get for that code point if you look it up in the standard Unicode cmap. A non-default variant is a different glyph.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Face_GetCharVariantIndex">FT_Face_GetCharVariantIndex</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> )
-  <b>FT_Face_GetCharVariantIndex</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                               <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  charcode,
-                               <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  variantSelector );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the glyph index of a given character code as modified by the variation selector.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face object.</p>
-</td></tr>
-<tr valign=top><td><b>charcode</b></td><td>
-<p>The character code point in Unicode.</p>
-</td></tr>
-<tr valign=top><td><b>variantSelector</b></td><td>
-<p>The Unicode code point of the variation selector.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The glyph index. 0&nbsp;means either &lsquo;undefined character code&rsquo;, or &lsquo;undefined selector code&rsquo;, or &lsquo;no variation selector cmap subtable&rsquo;, or &lsquo;current CharMap is not Unicode&rsquo;.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>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&nbsp;0 always corresponds to the &lsquo;missing glyph&rsquo;.</p>
-<p>This function is only meaningful if a) the font has a variation selector cmap sub table, and b) the current charmap has a Unicode encoding.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.6</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Face_GetCharVariantIsDefault">FT_Face_GetCharVariantIsDefault</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Int">FT_Int</a> )
-  <b>FT_Face_GetCharVariantIsDefault</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                                   <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  charcode,
-                                   <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  variantSelector );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Check whether this variant of this Unicode character is the one to be found in the &lsquo;cmap&rsquo;.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face object.</p>
-</td></tr>
-<tr valign=top><td><b>charcode</b></td><td>
-<p>The character codepoint in Unicode.</p>
-</td></tr>
-<tr valign=top><td><b>variantSelector</b></td><td>
-<p>The Unicode codepoint of the variation selector.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>1&nbsp;if found in the standard (Unicode) cmap, 0&nbsp;if found in the variation selector cmap, or -1 if it is not a variant.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function is only meaningful if the font has a variation selector cmap subtable.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.6</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Face_GetVariantSelectors">FT_Face_GetVariantSelectors</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_UInt32">FT_UInt32</a>* )
-  <b>FT_Face_GetVariantSelectors</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>  face );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return a zero-terminated list of Unicode variant selectors found in the font.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>A pointer to an array of selector code points, or NULL if there is no valid variant selector cmap subtable.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The last item in the array is&nbsp;0; the array is owned by the <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object but can be overwritten or released on the next call to a FreeType function.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.6</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Face_GetVariantsOfChar">FT_Face_GetVariantsOfChar</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_UInt32">FT_UInt32</a>* )
-  <b>FT_Face_GetVariantsOfChar</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                             <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  charcode );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return a zero-terminated list of Unicode variant selectors found for the specified character code.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face object.</p>
-</td></tr>
-<tr valign=top><td><b>charcode</b></td><td>
-<p>The character codepoint in Unicode.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>A pointer to an array of variant selector code points which are active for the given character, or NULL if the corresponding list is empty.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The last item in the array is&nbsp;0; the array is owned by the <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object but can be overwritten or released on the next call to a FreeType function.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.6</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Face_GetCharsOfVariant">FT_Face_GetCharsOfVariant</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_UInt32">FT_UInt32</a>* )
-  <b>FT_Face_GetCharsOfVariant</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                             <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  variantSelector );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return a zero-terminated list of Unicode character codes found for the specified variant selector.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face object.</p>
-</td></tr>
-<tr valign=top><td><b>variantSelector</b></td><td>
-<p>The variant selector code point in Unicode.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>A list of all the code points which are specified by this selector (both default and non-default codes are returned) or NULL if there is no valid cmap or the variant selector is invalid.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The last item in the array is&nbsp;0; the array is owned by the <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object but can be overwritten or released on the next call to a FreeType function.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.6</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-gx_validation.html b/docs/reference/ft2-gx_validation.html
deleted file mode 100644 (file)
index f9a239a..0000000
+++ /dev/null
@@ -1,356 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-TrueTypeGX/AAT Validation
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_VALIDATE_GX_LENGTH">FT_VALIDATE_GX_LENGTH</a></td><td></td><td><a href="#FT_TrueTypeGX_Free">FT_TrueTypeGX_Free</a></td><td></td><td><a href="#FT_ClassicKern_Free">FT_ClassicKern_Free</a></td></tr>
-<tr><td></td><td><a href="#FT_VALIDATE_GXXXX">FT_VALIDATE_GXXXX</a></td><td></td><td><a href="#FT_VALIDATE_CKERNXXX">FT_VALIDATE_CKERNXXX</a></td><td></td><td></td></tr>
-<tr><td></td><td><a href="#FT_TrueTypeGX_Validate">FT_TrueTypeGX_Validate</a></td><td></td><td><a href="#FT_ClassicKern_Validate">FT_ClassicKern_Validate</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains the declaration of functions to validate some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop, lcar).</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_VALIDATE_GX_LENGTH">FT_VALIDATE_GX_LENGTH</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_VALIDATE_GX_LENGTH</b>     (FT_VALIDATE_GX_LAST_INDEX + 1)
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>The number of tables checked in this module. Use it as a parameter for the &lsquo;table-length&rsquo; argument of function <a href="ft2-gx_validation.html#FT_TrueTypeGX_Validate">FT_TrueTypeGX_Validate</a>.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_VALIDATE_GXXXX">FT_VALIDATE_GXXXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_feat</a>  FT_VALIDATE_GX_BITFIELD( feat )
-#define <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_mort</a>  FT_VALIDATE_GX_BITFIELD( mort )
-#define <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_morx</a>  FT_VALIDATE_GX_BITFIELD( morx )
-#define <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_bsln</a>  FT_VALIDATE_GX_BITFIELD( bsln )
-#define <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_just</a>  FT_VALIDATE_GX_BITFIELD( just )
-#define <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_kern</a>  FT_VALIDATE_GX_BITFIELD( kern )
-#define <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_opbd</a>  FT_VALIDATE_GX_BITFIELD( opbd )
-#define <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_trak</a>  FT_VALIDATE_GX_BITFIELD( trak )
-#define <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_prop</a>  FT_VALIDATE_GX_BITFIELD( prop )
-#define <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_lcar</a>  FT_VALIDATE_GX_BITFIELD( lcar )
-
-#define <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_GX</a>  ( <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_feat</a> | \
-                          <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_mort</a> | \
-                          <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_morx</a> | \
-                          <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_bsln</a> | \
-                          <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_just</a> | \
-                          <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_kern</a> | \
-                          <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_opbd</a> | \
-                          <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_trak</a> | \
-                          <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_prop</a> | \
-                          <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_lcar</a> )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of bit-field constants used with <a href="ft2-gx_validation.html#FT_TrueTypeGX_Validate">FT_TrueTypeGX_Validate</a> to indicate which TrueTypeGX/AAT Type tables should be validated.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_VALIDATE_feat</b></td><td>
-<p>Validate &lsquo;feat&rsquo; table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_mort</b></td><td>
-<p>Validate &lsquo;mort&rsquo; table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_morx</b></td><td>
-<p>Validate &lsquo;morx&rsquo; table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_bsln</b></td><td>
-<p>Validate &lsquo;bsln&rsquo; table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_just</b></td><td>
-<p>Validate &lsquo;just&rsquo; table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_kern</b></td><td>
-<p>Validate &lsquo;kern&rsquo; table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_opbd</b></td><td>
-<p>Validate &lsquo;opbd&rsquo; table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_trak</b></td><td>
-<p>Validate &lsquo;trak&rsquo; table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_prop</b></td><td>
-<p>Validate &lsquo;prop&rsquo; table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_lcar</b></td><td>
-<p>Validate &lsquo;lcar&rsquo; table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_GX</b></td><td>
-<p>Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop and lcar).</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_TrueTypeGX_Validate">FT_TrueTypeGX_Validate</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_TrueTypeGX_Validate</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                          <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>   validation_flags,
-                          <a href="ft2-basic_types.html#FT_Bytes">FT_Bytes</a>  tables[<a href="ft2-gx_validation.html#FT_VALIDATE_GX_LENGTH">FT_VALIDATE_GX_LENGTH</a>],
-                          <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>   table_length );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Validate various TrueTypeGX tables to assure that all offsets and indices are valid. The idea is that a higher-level library which actually does the text layout can access those tables without error checking (which can be quite time consuming).</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the input face.</p>
-</td></tr>
-<tr valign=top><td><b>validation_flags</b></td><td>
-<p>A bit field which specifies the tables to be validated. See <a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_GXXXX</a> for possible values.</p>
-</td></tr>
-<tr valign=top><td><b>table_length</b></td><td>
-<p>The size of the &lsquo;tables&rsquo; array. Normally, <a href="ft2-gx_validation.html#FT_VALIDATE_GX_LENGTH">FT_VALIDATE_GX_LENGTH</a> should be passed.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>tables</b></td><td>
-<p>The array where all validated sfnt tables are stored. The array itself must be allocated by a client.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function only works with TrueTypeGX fonts, returning an error otherwise.</p>
-<p>After use, the application should deallocate the buffers pointed to by each &lsquo;tables&rsquo; element, by calling <a href="ft2-gx_validation.html#FT_TrueTypeGX_Free">FT_TrueTypeGX_Free</a>. A NULL value indicates that the table either doesn't exist in the font, the application hasn't asked for validation, or the validator doesn't have the ability to validate the sfnt table.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_TrueTypeGX_Free">FT_TrueTypeGX_Free</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_TrueTypeGX_Free</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                      <a href="ft2-basic_types.html#FT_Bytes">FT_Bytes</a>  table );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Free the buffer allocated by TrueTypeGX validator.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the input face.</p>
-</td></tr>
-<tr valign=top><td><b>table</b></td><td>
-<p>The pointer to the buffer allocated by <a href="ft2-gx_validation.html#FT_TrueTypeGX_Validate">FT_TrueTypeGX_Validate</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function must be used to free the buffer allocated by <a href="ft2-gx_validation.html#FT_TrueTypeGX_Validate">FT_TrueTypeGX_Validate</a> only.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_VALIDATE_CKERNXXX">FT_VALIDATE_CKERNXXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-gx_validation.html#FT_VALIDATE_CKERNXXX">FT_VALIDATE_MS</a>     ( FT_VALIDATE_GX_START &lt;&lt; 0 )
-#define <a href="ft2-gx_validation.html#FT_VALIDATE_CKERNXXX">FT_VALIDATE_APPLE</a>  ( FT_VALIDATE_GX_START &lt;&lt; 1 )
-
-#define <a href="ft2-gx_validation.html#FT_VALIDATE_CKERNXXX">FT_VALIDATE_CKERN</a>  ( <a href="ft2-gx_validation.html#FT_VALIDATE_CKERNXXX">FT_VALIDATE_MS</a> | <a href="ft2-gx_validation.html#FT_VALIDATE_CKERNXXX">FT_VALIDATE_APPLE</a> )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of bit-field constants used with <a href="ft2-gx_validation.html#FT_ClassicKern_Validate">FT_ClassicKern_Validate</a> to indicate the classic kern dialect or dialects. If the selected type doesn't fit, <a href="ft2-gx_validation.html#FT_ClassicKern_Validate">FT_ClassicKern_Validate</a> regards the table as invalid.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_VALIDATE_MS</b></td><td>
-<p>Handle the &lsquo;kern&rsquo; table as a classic Microsoft kern table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_APPLE</b></td><td>
-<p>Handle the &lsquo;kern&rsquo; table as a classic Apple kern table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_CKERN</b></td><td>
-<p>Handle the &lsquo;kern&rsquo; as either classic Apple or Microsoft kern table.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_ClassicKern_Validate">FT_ClassicKern_Validate</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_ClassicKern_Validate</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>    face,
-                           <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>    validation_flags,
-                           <a href="ft2-basic_types.html#FT_Bytes">FT_Bytes</a>  *ckern_table );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Validate classic (16-bit format) kern table to assure that the offsets and indices are valid. The idea is that a higher-level library which actually does the text layout can access those tables without error checking (which can be quite time consuming).</p>
-<p>The &lsquo;kern&rsquo; table validator in <a href="ft2-gx_validation.html#FT_TrueTypeGX_Validate">FT_TrueTypeGX_Validate</a> deals with both the new 32-bit format and the classic 16-bit format, while FT_ClassicKern_Validate only supports the classic 16-bit format.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the input face.</p>
-</td></tr>
-<tr valign=top><td><b>validation_flags</b></td><td>
-<p>A bit field which specifies the dialect to be validated. See <a href="ft2-gx_validation.html#FT_VALIDATE_CKERNXXX">FT_VALIDATE_CKERNXXX</a> for possible values.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>ckern_table</b></td><td>
-<p>A pointer to the kern table.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>After use, the application should deallocate the buffers pointed to by &lsquo;ckern_table&rsquo;, by calling <a href="ft2-gx_validation.html#FT_ClassicKern_Free">FT_ClassicKern_Free</a>. A NULL value indicates that the table doesn't exist in the font.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_ClassicKern_Free">FT_ClassicKern_Free</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_ClassicKern_Free</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                       <a href="ft2-basic_types.html#FT_Bytes">FT_Bytes</a>  table );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Free the buffer allocated by classic Kern validator.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the input face.</p>
-</td></tr>
-<tr valign=top><td><b>table</b></td><td>
-<p>The pointer to the buffer that is allocated by <a href="ft2-gx_validation.html#FT_ClassicKern_Validate">FT_ClassicKern_Validate</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function must be used to free the buffer allocated by <a href="ft2-gx_validation.html#FT_ClassicKern_Validate">FT_ClassicKern_Validate</a> only.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-gzip.html b/docs/reference/ft2-gzip.html
deleted file mode 100644 (file)
index 698dc74..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-GZIP Streams
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Stream_OpenGzip">FT_Stream_OpenGzip</a></td><td></td><td></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains the declaration of Gzip-specific functions.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stream_OpenGzip">FT_Stream_OpenGzip</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_GZIP_H (freetype/ftgzip.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Stream_OpenGzip</b>( <a href="ft2-system_interface.html#FT_Stream">FT_Stream</a>  stream,
-                      <a href="ft2-system_interface.html#FT_Stream">FT_Stream</a>  source );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Open a new stream to parse gzip-compressed font files. This is mainly used to support the compressed &lsquo;*.pcf.gz&rsquo; fonts that come with XFree86.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stream</b></td><td>
-<p>The target embedding stream.</p>
-</td></tr>
-<tr valign=top><td><b>source</b></td><td>
-<p>The source stream.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The source stream must be opened <i>before</i> calling this function.</p>
-<p>Calling the internal function &lsquo;FT_Stream_Close&rsquo; on the new stream will <b>not</b> call &lsquo;FT_Stream_Close&rsquo; on the source stream. None of the stream objects will be released to the heap.</p>
-<p>The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream.</p>
-<p>In certain builds of the library, gzip compression recognition is automatically handled when calling <a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a> or <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a>. This means that if no font driver is capable of handling the raw compressed file, the library will try to open a gzipped stream from it and re-open the face with it.</p>
-<p>This function may return &lsquo;FT_Err_Unimplemented_Feature&rsquo; if your build of FreeType was not compiled with zlib support.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-header_file_macros.html b/docs/reference/ft2-header_file_macros.html
deleted file mode 100644 (file)
index b94ef5e..0000000
+++ /dev/null
@@ -1,853 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Header File Macros
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_CONFIG_CONFIG_H">FT_CONFIG_CONFIG_H</a></td><td></td><td><a href="#FT_WINFONTS_H">FT_WINFONTS_H</a></td></tr>
-<tr><td></td><td><a href="#FT_CONFIG_STANDARD_LIBRARY_H">FT_CONFIG_STANDARD_LIBRARY_H</a></td><td></td><td><a href="#FT_GLYPH_H">FT_GLYPH_H</a></td></tr>
-<tr><td></td><td><a href="#FT_CONFIG_OPTIONS_H">FT_CONFIG_OPTIONS_H</a></td><td></td><td><a href="#FT_BITMAP_H">FT_BITMAP_H</a></td></tr>
-<tr><td></td><td><a href="#FT_CONFIG_MODULES_H">FT_CONFIG_MODULES_H</a></td><td></td><td><a href="#FT_BBOX_H">FT_BBOX_H</a></td></tr>
-<tr><td></td><td><a href="#FT_FREETYPE_H">FT_FREETYPE_H</a></td><td></td><td><a href="#FT_CACHE_H">FT_CACHE_H</a></td></tr>
-<tr><td></td><td><a href="#FT_ERRORS_H">FT_ERRORS_H</a></td><td></td><td><a href="#FT_CACHE_IMAGE_H">FT_CACHE_IMAGE_H</a></td></tr>
-<tr><td></td><td><a href="#FT_MODULE_ERRORS_H">FT_MODULE_ERRORS_H</a></td><td></td><td><a href="#FT_CACHE_SMALL_BITMAPS_H">FT_CACHE_SMALL_BITMAPS_H</a></td></tr>
-<tr><td></td><td><a href="#FT_SYSTEM_H">FT_SYSTEM_H</a></td><td></td><td><a href="#FT_CACHE_CHARMAP_H">FT_CACHE_CHARMAP_H</a></td></tr>
-<tr><td></td><td><a href="#FT_IMAGE_H">FT_IMAGE_H</a></td><td></td><td><a href="#FT_MAC_H">FT_MAC_H</a></td></tr>
-<tr><td></td><td><a href="#FT_TYPES_H">FT_TYPES_H</a></td><td></td><td><a href="#FT_MULTIPLE_MASTERS_H">FT_MULTIPLE_MASTERS_H</a></td></tr>
-<tr><td></td><td><a href="#FT_LIST_H">FT_LIST_H</a></td><td></td><td><a href="#FT_SFNT_NAMES_H">FT_SFNT_NAMES_H</a></td></tr>
-<tr><td></td><td><a href="#FT_OUTLINE_H">FT_OUTLINE_H</a></td><td></td><td><a href="#FT_OPENTYPE_VALIDATE_H">FT_OPENTYPE_VALIDATE_H</a></td></tr>
-<tr><td></td><td><a href="#FT_SIZES_H">FT_SIZES_H</a></td><td></td><td><a href="#FT_GX_VALIDATE_H">FT_GX_VALIDATE_H</a></td></tr>
-<tr><td></td><td><a href="#FT_MODULE_H">FT_MODULE_H</a></td><td></td><td><a href="#FT_PFR_H">FT_PFR_H</a></td></tr>
-<tr><td></td><td><a href="#FT_RENDER_H">FT_RENDER_H</a></td><td></td><td><a href="#FT_STROKER_H">FT_STROKER_H</a></td></tr>
-<tr><td></td><td><a href="#FT_TYPE1_TABLES_H">FT_TYPE1_TABLES_H</a></td><td></td><td><a href="#FT_SYNTHESIS_H">FT_SYNTHESIS_H</a></td></tr>
-<tr><td></td><td><a href="#FT_TRUETYPE_IDS_H">FT_TRUETYPE_IDS_H</a></td><td></td><td><a href="#FT_XFREE86_H">FT_XFREE86_H</a></td></tr>
-<tr><td></td><td><a href="#FT_TRUETYPE_TABLES_H">FT_TRUETYPE_TABLES_H</a></td><td></td><td><a href="#FT_TRIGONOMETRY_H">FT_TRIGONOMETRY_H</a></td></tr>
-<tr><td></td><td><a href="#FT_TRUETYPE_TAGS_H">FT_TRUETYPE_TAGS_H</a></td><td></td><td><a href="#FT_LCD_FILTER_H">FT_LCD_FILTER_H</a></td></tr>
-<tr><td></td><td><a href="#FT_BDF_H">FT_BDF_H</a></td><td></td><td><a href="#FT_UNPATENTED_HINTING_H">FT_UNPATENTED_HINTING_H</a></td></tr>
-<tr><td></td><td><a href="#FT_CID_H">FT_CID_H</a></td><td></td><td><a href="#FT_INCREMENTAL_H">FT_INCREMENTAL_H</a></td></tr>
-<tr><td></td><td><a href="#FT_GZIP_H">FT_GZIP_H</a></td><td></td><td><a href="#FT_GASP_H">FT_GASP_H</a></td></tr>
-<tr><td></td><td><a href="#FT_LZW_H">FT_LZW_H</a></td><td></td><td><a href="#FT_ADVANCES_H">FT_ADVANCES_H</a></td></tr>
-<tr><td></td><td><a href="#FT_BZIP2_H">FT_BZIP2_H</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>The following macros are defined to the name of specific FreeType&nbsp;2 header files. They can be used directly in #include statements as in:</p>
-<pre class="colored">
-  #include FT_FREETYPE_H                                           
-  #include FT_MULTIPLE_MASTERS_H                                   
-  #include FT_GLYPH_H                                              
-</pre>
-<p>There are several reasons why we are now using macros to name public header files. The first one is that such macros are not limited to the infamous 8.3&nbsp;naming rule required by DOS (and &lsquo;FT_MULTIPLE_MASTERS_H&rsquo; is a lot more meaningful than &lsquo;ftmm.h&rsquo;).</p>
-<p>The second reason is that it allows for more flexibility in the way FreeType&nbsp;2 is installed on a given system.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_CONFIG_CONFIG_H">FT_CONFIG_CONFIG_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#ifndef <b>FT_CONFIG_CONFIG_H</b>
-#define <b>FT_CONFIG_CONFIG_H</b>  &lt;freetype/config/ftconfig.h&gt;
-#endif
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing FreeType&nbsp;2 configuration data.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_CONFIG_STANDARD_LIBRARY_H">FT_CONFIG_STANDARD_LIBRARY_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#ifndef <b>FT_CONFIG_STANDARD_LIBRARY_H</b>
-#define <b>FT_CONFIG_STANDARD_LIBRARY_H</b>  &lt;freetype/config/ftstdlib.h&gt;
-#endif
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing FreeType&nbsp;2 interface to the standard C library functions.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_CONFIG_OPTIONS_H">FT_CONFIG_OPTIONS_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#ifndef <b>FT_CONFIG_OPTIONS_H</b>
-#define <b>FT_CONFIG_OPTIONS_H</b>  &lt;freetype/config/ftoption.h&gt;
-#endif
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing FreeType&nbsp;2 project-specific configuration options.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_CONFIG_MODULES_H">FT_CONFIG_MODULES_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#ifndef <b>FT_CONFIG_MODULES_H</b>
-#define <b>FT_CONFIG_MODULES_H</b>  &lt;freetype/config/ftmodule.h&gt;
-#endif
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the list of FreeType&nbsp;2 modules that are statically linked to new library instances in <a href="ft2-base_interface.html#FT_Init_FreeType">FT_Init_FreeType</a>.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_FREETYPE_H">FT_FREETYPE_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_FREETYPE_H</b>  &lt;freetype/freetype.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the base FreeType&nbsp;2 API.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_ERRORS_H">FT_ERRORS_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_ERRORS_H</b>  &lt;freetype/fterrors.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the list of FreeType&nbsp;2 error codes (and messages).</p>
-<p>It is included by <a href="ft2-header_file_macros.html#FT_FREETYPE_H">FT_FREETYPE_H</a>.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_MODULE_ERRORS_H">FT_MODULE_ERRORS_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_MODULE_ERRORS_H</b>  &lt;freetype/ftmoderr.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the list of FreeType&nbsp;2 module error offsets (and messages).</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_SYSTEM_H">FT_SYSTEM_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_SYSTEM_H</b>  &lt;freetype/ftsystem.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the FreeType&nbsp;2 interface to low-level operations (i.e., memory management and stream i/o).</p>
-<p>It is included by <a href="ft2-header_file_macros.html#FT_FREETYPE_H">FT_FREETYPE_H</a>.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_IMAGE_H">FT_IMAGE_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_IMAGE_H</b>  &lt;freetype/ftimage.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing type definitions related to glyph images (i.e., bitmaps, outlines, scan-converter parameters).</p>
-<p>It is included by <a href="ft2-header_file_macros.html#FT_FREETYPE_H">FT_FREETYPE_H</a>.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_TYPES_H">FT_TYPES_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_TYPES_H</b>  &lt;freetype/fttypes.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the basic data types defined by FreeType&nbsp;2.</p>
-<p>It is included by <a href="ft2-header_file_macros.html#FT_FREETYPE_H">FT_FREETYPE_H</a>.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_LIST_H">FT_LIST_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_LIST_H</b>  &lt;freetype/ftlist.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the list management API of FreeType&nbsp;2.</p>
-<p>(Most applications will never need to include this file.)</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_OUTLINE_H">FT_OUTLINE_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_OUTLINE_H</b>  &lt;freetype/ftoutln.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the scalable outline management API of FreeType&nbsp;2.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_SIZES_H">FT_SIZES_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_SIZES_H</b>  &lt;freetype/ftsizes.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the API which manages multiple <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects per face.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_MODULE_H">FT_MODULE_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_MODULE_H</b>  &lt;freetype/ftmodapi.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the module management API of FreeType&nbsp;2.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_RENDER_H">FT_RENDER_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_RENDER_H</b>  &lt;freetype/ftrender.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the renderer module management API of FreeType&nbsp;2.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_TYPE1_TABLES_H">FT_TYPE1_TABLES_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_TYPE1_TABLES_H</b>  &lt;freetype/t1tables.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the types and API specific to the Type&nbsp;1 format.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_TRUETYPE_IDS_H">FT_TRUETYPE_IDS_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_TRUETYPE_IDS_H</b>  &lt;freetype/ttnameid.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the enumeration values which identify name strings, languages, encodings, etc. This file really contains a <i>large</i> set of constant macro definitions, taken from the TrueType and OpenType specifications.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_TRUETYPE_TABLES_H">FT_TRUETYPE_TABLES_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_TRUETYPE_TABLES_H</b>  &lt;freetype/tttables.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the types and API specific to the TrueType (as well as OpenType) format.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_TRUETYPE_TAGS_H">FT_TRUETYPE_TAGS_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_TRUETYPE_TAGS_H</b>  &lt;freetype/tttags.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the definitions of TrueType four-byte &lsquo;tags&rsquo; which identify blocks in SFNT-based font formats (i.e., TrueType and OpenType).</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_BDF_H">FT_BDF_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_BDF_H</b>  &lt;freetype/ftbdf.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the definitions of an API which accesses BDF-specific strings from a face.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_CID_H">FT_CID_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_CID_H</b>  &lt;freetype/ftcid.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the definitions of an API which access CID font information from a face.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_GZIP_H">FT_GZIP_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_GZIP_H</b>  &lt;freetype/ftgzip.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the definitions of an API which supports gzip-compressed files.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_LZW_H">FT_LZW_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_LZW_H</b>  &lt;freetype/ftlzw.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the definitions of an API which supports LZW-compressed files.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_BZIP2_H">FT_BZIP2_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_BZIP2_H</b>  &lt;freetype/ftbzip2.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the definitions of an API which supports bzip2-compressed files.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_WINFONTS_H">FT_WINFONTS_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_WINFONTS_H</b>   &lt;freetype/ftwinfnt.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the definitions of an API which supports Windows FNT files.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_GLYPH_H">FT_GLYPH_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_GLYPH_H</b>  &lt;freetype/ftglyph.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the API of the optional glyph management component.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_BITMAP_H">FT_BITMAP_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_BITMAP_H</b>  &lt;freetype/ftbitmap.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the API of the optional bitmap conversion component.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_BBOX_H">FT_BBOX_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_BBOX_H</b>  &lt;freetype/ftbbox.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the API of the optional exact bounding box computation routines.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_CACHE_H">FT_CACHE_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_CACHE_H</b>  &lt;freetype/ftcache.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the API of the optional FreeType&nbsp;2 cache sub-system.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_CACHE_IMAGE_H">FT_CACHE_IMAGE_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_CACHE_IMAGE_H</b>  <a href="ft2-header_file_macros.html#FT_CACHE_H">FT_CACHE_H</a>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the &lsquo;glyph image&rsquo; API of the FreeType&nbsp;2 cache sub-system.</p>
-<p>It is used to define a cache for <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> elements. You can also use the API defined in <a href="ft2-header_file_macros.html#FT_CACHE_SMALL_BITMAPS_H">FT_CACHE_SMALL_BITMAPS_H</a> if you only need to store small glyph bitmaps, as it will use less memory.</p>
-<p>This macro is deprecated. Simply include <a href="ft2-header_file_macros.html#FT_CACHE_H">FT_CACHE_H</a> to have all glyph image-related cache declarations.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_CACHE_SMALL_BITMAPS_H">FT_CACHE_SMALL_BITMAPS_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_CACHE_SMALL_BITMAPS_H</b>  <a href="ft2-header_file_macros.html#FT_CACHE_H">FT_CACHE_H</a>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the &lsquo;small bitmaps&rsquo; API of the FreeType&nbsp;2 cache sub-system.</p>
-<p>It is used to define a cache for small glyph bitmaps in a relatively memory-efficient way. You can also use the API defined in <a href="ft2-header_file_macros.html#FT_CACHE_IMAGE_H">FT_CACHE_IMAGE_H</a> if you want to cache arbitrary glyph images, including scalable outlines.</p>
-<p>This macro is deprecated. Simply include <a href="ft2-header_file_macros.html#FT_CACHE_H">FT_CACHE_H</a> to have all small bitmaps-related cache declarations.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_CACHE_CHARMAP_H">FT_CACHE_CHARMAP_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_CACHE_CHARMAP_H</b>  <a href="ft2-header_file_macros.html#FT_CACHE_H">FT_CACHE_H</a>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the &lsquo;charmap&rsquo; API of the FreeType&nbsp;2 cache sub-system.</p>
-<p>This macro is deprecated. Simply include <a href="ft2-header_file_macros.html#FT_CACHE_H">FT_CACHE_H</a> to have all charmap-based cache declarations.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_MAC_H">FT_MAC_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_MAC_H</b>  &lt;freetype/ftmac.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the Macintosh-specific FreeType&nbsp;2 API. The latter is used to access fonts embedded in resource forks.</p>
-<p>This header file must be explicitly included by client applications compiled on the Mac (note that the base API still works though).</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_MULTIPLE_MASTERS_H">FT_MULTIPLE_MASTERS_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_MULTIPLE_MASTERS_H</b>  &lt;freetype/ftmm.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the optional multiple-masters management API of FreeType&nbsp;2.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_SFNT_NAMES_H">FT_SFNT_NAMES_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_SFNT_NAMES_H</b>  &lt;freetype/ftsnames.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the optional FreeType&nbsp;2 API which accesses embedded &lsquo;name&rsquo; strings in SFNT-based font formats (i.e., TrueType and OpenType).</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_OPENTYPE_VALIDATE_H">FT_OPENTYPE_VALIDATE_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_OPENTYPE_VALIDATE_H</b>  &lt;freetype/ftotval.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the optional FreeType&nbsp;2 API which validates OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF).</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_GX_VALIDATE_H">FT_GX_VALIDATE_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_GX_VALIDATE_H</b>  &lt;freetype/ftgxval.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the optional FreeType&nbsp;2 API which validates TrueTypeGX/AAT tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop).</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_PFR_H">FT_PFR_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_PFR_H</b>  &lt;freetype/ftpfr.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the FreeType&nbsp;2 API which accesses PFR-specific data.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_STROKER_H">FT_STROKER_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_STROKER_H</b>  &lt;freetype/ftstroke.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the FreeType&nbsp;2 API which provides functions to stroke outline paths.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_SYNTHESIS_H">FT_SYNTHESIS_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_SYNTHESIS_H</b>  &lt;freetype/ftsynth.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the FreeType&nbsp;2 API which performs artificial obliquing and emboldening.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_XFREE86_H">FT_XFREE86_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_XFREE86_H</b>  &lt;freetype/ftxf86.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the FreeType&nbsp;2 API which provides functions specific to the XFree86 and X.Org X11 servers.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_TRIGONOMETRY_H">FT_TRIGONOMETRY_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_TRIGONOMETRY_H</b>  &lt;freetype/fttrigon.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the FreeType&nbsp;2 API which performs trigonometric computations (e.g., cosines and arc tangents).</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_LCD_FILTER_H">FT_LCD_FILTER_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_LCD_FILTER_H</b>  &lt;freetype/ftlcdfil.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the FreeType&nbsp;2 API which performs color filtering for subpixel rendering.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_UNPATENTED_HINTING_H">FT_UNPATENTED_HINTING_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_UNPATENTED_HINTING_H</b>  &lt;freetype/ttunpat.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the FreeType&nbsp;2 API which performs color filtering for subpixel rendering.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_INCREMENTAL_H">FT_INCREMENTAL_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_INCREMENTAL_H</b>  &lt;freetype/ftincrem.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the FreeType&nbsp;2 API which performs color filtering for subpixel rendering.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_GASP_H">FT_GASP_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_GASP_H</b>  &lt;freetype/ftgasp.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the FreeType&nbsp;2 API which returns entries from the TrueType GASP table.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_ADVANCES_H">FT_ADVANCES_H</a></h4>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_ADVANCES_H</b>  &lt;freetype/ftadvanc.h&gt;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A macro used in #include statements to name the file containing the FreeType&nbsp;2 API which returns individual and ranged glyph advances.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-incremental.html b/docs/reference/ft2-incremental.html
deleted file mode 100644 (file)
index cb14e16..0000000
+++ /dev/null
@@ -1,401 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Incremental Loading
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Incremental">FT_Incremental</a></td><td></td><td><a href="#FT_Incremental_GetGlyphMetricsFunc">FT_Incremental_GetGlyphMetricsFunc</a></td></tr>
-<tr><td></td><td><a href="#FT_Incremental_MetricsRec">FT_Incremental_MetricsRec</a></td><td></td><td><a href="#FT_Incremental_FuncsRec">FT_Incremental_FuncsRec</a></td></tr>
-<tr><td></td><td><a href="#FT_Incremental_Metrics">FT_Incremental_Metrics</a></td><td></td><td><a href="#FT_Incremental_InterfaceRec">FT_Incremental_InterfaceRec</a></td></tr>
-<tr><td></td><td><a href="#FT_Incremental_GetGlyphDataFunc">FT_Incremental_GetGlyphDataFunc</a></td><td></td><td><a href="#FT_Incremental_Interface">FT_Incremental_Interface</a></td></tr>
-<tr><td></td><td><a href="#FT_Incremental_FreeGlyphDataFunc">FT_Incremental_FreeGlyphDataFunc</a></td><td></td><td><a href="#FT_PARAM_TAG_INCREMENTAL">FT_PARAM_TAG_INCREMENTAL</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains various functions used to perform so-called &lsquo;incremental&rsquo; glyph loading. This is a mode where all glyphs loaded from a given <a href="ft2-base_interface.html#FT_Face">FT_Face</a> are provided by the client application,</p>
-<p>Apart from that, all other tables are loaded normally from the font file. This mode is useful when FreeType is used within another engine, e.g., a PostScript Imaging Processor.</p>
-<p>To enable this mode, you must use <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a>, passing an <a href="ft2-base_interface.html#FT_Parameter">FT_Parameter</a> with the <a href="ft2-incremental.html#FT_PARAM_TAG_INCREMENTAL">FT_PARAM_TAG_INCREMENTAL</a> tag and an <a href="ft2-incremental.html#FT_Incremental_Interface">FT_Incremental_Interface</a> value. See the comments for <a href="ft2-incremental.html#FT_Incremental_InterfaceRec">FT_Incremental_InterfaceRec</a> for an example.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Incremental">FT_Incremental</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_INCREMENTAL_H (freetype/ftincrem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_IncrementalRec_*  <b>FT_Incremental</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An opaque type describing a user-provided object used to implement &lsquo;incremental&rsquo; glyph loading within FreeType. This is used to support embedded fonts in certain environments (e.g., PostScript interpreters), where the glyph data isn't in the font file, or must be overridden by different values.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>It is up to client applications to create and implement <a href="ft2-incremental.html#FT_Incremental">FT_Incremental</a> objects, as long as they provide implementations for the methods <a href="ft2-incremental.html#FT_Incremental_GetGlyphDataFunc">FT_Incremental_GetGlyphDataFunc</a>, <a href="ft2-incremental.html#FT_Incremental_FreeGlyphDataFunc">FT_Incremental_FreeGlyphDataFunc</a> and <a href="ft2-incremental.html#FT_Incremental_GetGlyphMetricsFunc">FT_Incremental_GetGlyphMetricsFunc</a>.</p>
-<p>See the description of <a href="ft2-incremental.html#FT_Incremental_InterfaceRec">FT_Incremental_InterfaceRec</a> to understand how to use incremental objects with FreeType.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Incremental_MetricsRec">FT_Incremental_MetricsRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_INCREMENTAL_H (freetype/ftincrem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Incremental_MetricsRec_
-  {
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>  bearing_x;
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>  bearing_y;
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>  advance;
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>  advance_v;     /* since 2.3.12 */
-
-  } <b>FT_Incremental_MetricsRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A small structure used to contain the basic glyph metrics returned by the <a href="ft2-incremental.html#FT_Incremental_GetGlyphMetricsFunc">FT_Incremental_GetGlyphMetricsFunc</a> method.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>bearing_x</b></td><td>
-<p>Left bearing, in font units.</p>
-</td></tr>
-<tr valign=top><td><b>bearing_y</b></td><td>
-<p>Top bearing, in font units.</p>
-</td></tr>
-<tr valign=top><td><b>advance</b></td><td>
-<p>Horizontal component of glyph advance, in font units.</p>
-</td></tr>
-<tr valign=top><td><b>advance_v</b></td><td>
-<p>Vertical component of glyph advance, in font units.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>These correspond to horizontal or vertical metrics depending on the value of the &lsquo;vertical&rsquo; argument to the function <a href="ft2-incremental.html#FT_Incremental_GetGlyphMetricsFunc">FT_Incremental_GetGlyphMetricsFunc</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Incremental_Metrics">FT_Incremental_Metrics</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_INCREMENTAL_H (freetype/ftincrem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-   <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Incremental_MetricsRec_*  <b>FT_Incremental_Metrics</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to an <a href="ft2-incremental.html#FT_Incremental_MetricsRec">FT_Incremental_MetricsRec</a> structure.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Incremental_GetGlyphDataFunc">FT_Incremental_GetGlyphDataFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_INCREMENTAL_H (freetype/ftincrem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_Error">FT_Error</a>
-  (*<b>FT_Incremental_GetGlyphDataFunc</b>)( <a href="ft2-incremental.html#FT_Incremental">FT_Incremental</a>  incremental,
-                                      <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>         glyph_index,
-                                      <a href="ft2-basic_types.html#FT_Data">FT_Data</a>*        adata );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function called by FreeType to access a given glyph's data bytes during <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a> or <a href="ft2-base_interface.html#FT_Load_Char">FT_Load_Char</a> if incremental loading is enabled.</p>
-<p>Note that the format of the glyph's data bytes depends on the font file format. For TrueType, it must correspond to the raw bytes within the &lsquo;glyf&rsquo; table. For PostScript formats, it must correspond to the <b>unencrypted</b> charstring bytes, without any &lsquo;lenIV&rsquo; header. It is undefined for any other format.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>incremental</b></td><td>
-<p>Handle to an opaque <a href="ft2-incremental.html#FT_Incremental">FT_Incremental</a> handle provided by the client application.</p>
-</td></tr>
-<tr valign=top><td><b>glyph_index</b></td><td>
-<p>Index of relevant glyph.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>adata</b></td><td>
-<p>A structure describing the returned glyph data bytes (which will be accessed as a read-only byte block).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>If this function returns successfully the method <a href="ft2-incremental.html#FT_Incremental_FreeGlyphDataFunc">FT_Incremental_FreeGlyphDataFunc</a> will be called later to release the data bytes.</p>
-<p>Nested calls to <a href="ft2-incremental.html#FT_Incremental_GetGlyphDataFunc">FT_Incremental_GetGlyphDataFunc</a> can happen for compound glyphs.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Incremental_FreeGlyphDataFunc">FT_Incremental_FreeGlyphDataFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_INCREMENTAL_H (freetype/ftincrem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">void</span>
-  (*<b>FT_Incremental_FreeGlyphDataFunc</b>)( <a href="ft2-incremental.html#FT_Incremental">FT_Incremental</a>  incremental,
-                                       <a href="ft2-basic_types.html#FT_Data">FT_Data</a>*        data );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to release the glyph data bytes returned by a successful call to <a href="ft2-incremental.html#FT_Incremental_GetGlyphDataFunc">FT_Incremental_GetGlyphDataFunc</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>incremental</b></td><td>
-<p>A handle to an opaque <a href="ft2-incremental.html#FT_Incremental">FT_Incremental</a> handle provided by the client application.</p>
-</td></tr>
-<tr valign=top><td><b>data</b></td><td>
-<p>A structure describing the glyph data bytes (which will be accessed as a read-only byte block).</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Incremental_GetGlyphMetricsFunc">FT_Incremental_GetGlyphMetricsFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_INCREMENTAL_H (freetype/ftincrem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_Error">FT_Error</a>
-  (*<b>FT_Incremental_GetGlyphMetricsFunc</b>)
-                      ( <a href="ft2-incremental.html#FT_Incremental">FT_Incremental</a>              incremental,
-                        <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>                     glyph_index,
-                        <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>                     vertical,
-                        <a href="ft2-incremental.html#FT_Incremental_MetricsRec">FT_Incremental_MetricsRec</a>  *ametrics );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to retrieve the basic metrics of a given glyph index before accessing its data. This is necessary because, in certain formats like TrueType, the metrics are stored in a different place from the glyph images proper.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>incremental</b></td><td>
-<p>A handle to an opaque <a href="ft2-incremental.html#FT_Incremental">FT_Incremental</a> handle provided by the client application.</p>
-</td></tr>
-<tr valign=top><td><b>glyph_index</b></td><td>
-<p>Index of relevant glyph.</p>
-</td></tr>
-<tr valign=top><td><b>vertical</b></td><td>
-<p>If true, return vertical metrics.</p>
-</td></tr>
-<tr valign=top><td><b>ametrics</b></td><td>
-<p>This parameter is used for both input and output. The original glyph metrics, if any, in font units. If metrics are not available all the values must be set to zero.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>ametrics</b></td><td>
-<p>The replacement glyph metrics in font units.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Incremental_FuncsRec">FT_Incremental_FuncsRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_INCREMENTAL_H (freetype/ftincrem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Incremental_FuncsRec_
-  {
-    <a href="ft2-incremental.html#FT_Incremental_GetGlyphDataFunc">FT_Incremental_GetGlyphDataFunc</a>     get_glyph_data;
-    <a href="ft2-incremental.html#FT_Incremental_FreeGlyphDataFunc">FT_Incremental_FreeGlyphDataFunc</a>    free_glyph_data;
-    <a href="ft2-incremental.html#FT_Incremental_GetGlyphMetricsFunc">FT_Incremental_GetGlyphMetricsFunc</a>  get_glyph_metrics;
-
-  } <b>FT_Incremental_FuncsRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A table of functions for accessing fonts that load data incrementally. Used in <a href="ft2-incremental.html#FT_Incremental_InterfaceRec">FT_Incremental_InterfaceRec</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>get_glyph_data</b></td><td>
-<p>The function to get glyph data. Must not be null.</p>
-</td></tr>
-<tr valign=top><td><b>free_glyph_data</b></td><td>
-<p>The function to release glyph data. Must not be null.</p>
-</td></tr>
-<tr valign=top><td><b>get_glyph_metrics</b></td><td>
-<p>The function to get glyph metrics. May be null if the font does not provide overriding glyph metrics.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Incremental_InterfaceRec">FT_Incremental_InterfaceRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_INCREMENTAL_H (freetype/ftincrem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Incremental_InterfaceRec_
-  {
-    <span class="keyword">const</span> <a href="ft2-incremental.html#FT_Incremental_FuncsRec">FT_Incremental_FuncsRec</a>*  funcs;
-    <a href="ft2-incremental.html#FT_Incremental">FT_Incremental</a>                  object;
-
-  } <b>FT_Incremental_InterfaceRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure to be used with <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a> to indicate that the user wants to support incremental glyph loading. You should use it with <a href="ft2-incremental.html#FT_PARAM_TAG_INCREMENTAL">FT_PARAM_TAG_INCREMENTAL</a> as in the following example:</p>
-<pre class="colored">
-  FT_Incremental_InterfaceRec  inc_int;
-  FT_Parameter                 parameter;
-  FT_Open_Args                 open_args;
-
-
-  // set up incremental descriptor
-  inc_int.funcs  = my_funcs;
-  inc_int.object = my_object;
-
-  // set up optional parameter
-  parameter.tag  = FT_PARAM_TAG_INCREMENTAL;
-  parameter.data = &amp;inc_int;
-
-  // set up FT_Open_Args structure
-  open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
-  open_args.pathname   = my_font_pathname;
-  open_args.num_params = 1;
-  open_args.params     = &amp;parameter; // we use one optional argument
-
-  // open the font
-  error = FT_Open_Face( library, &amp;open_args, index, &amp;face );
-  ...
-</pre>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Incremental_Interface">FT_Incremental_Interface</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_INCREMENTAL_H (freetype/ftincrem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <a href="ft2-incremental.html#FT_Incremental_InterfaceRec">FT_Incremental_InterfaceRec</a>*   <b>FT_Incremental_Interface</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A pointer to an <a href="ft2-incremental.html#FT_Incremental_InterfaceRec">FT_Incremental_InterfaceRec</a> structure.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_PARAM_TAG_INCREMENTAL">FT_PARAM_TAG_INCREMENTAL</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_INCREMENTAL_H (freetype/ftincrem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_PARAM_TAG_INCREMENTAL</b>  <a href="ft2-basic_types.html#FT_MAKE_TAG">FT_MAKE_TAG</a>( 'i', 'n', 'c', 'r' )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A constant used as the tag of <a href="ft2-base_interface.html#FT_Parameter">FT_Parameter</a> structures to indicate an incremental loading object to be used by FreeType.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-index.html b/docs/reference/ft2-index.html
deleted file mode 100644 (file)
index fb674a2..0000000
+++ /dev/null
@@ -1,294 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<table align=center border=0 cellpadding=0 cellspacing=0>
-<tr><td><a href="ft2-bdf_fonts.html#FT_PropertyType">BDF_PROPERTY_TYPE_ATOM</a></td><td><a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LcdFilter</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_ParseOutline">FT_Stroker_ParseOutline</a></td></tr>
-<tr><td><a href="ft2-bdf_fonts.html#FT_PropertyType">BDF_PROPERTY_TYPE_CARDINAL</a></td><td><a href="ft2-header_file_macros.html#FT_LIST_H">FT_LIST_H</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_Rewind">FT_Stroker_Rewind</a></td></tr>
-<tr><td><a href="ft2-bdf_fonts.html#FT_PropertyType">BDF_PROPERTY_TYPE_INTEGER</a></td><td><a href="ft2-base_interface.html#FT_Library">FT_Library</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_Set">FT_Stroker_Set</a></td></tr>
-<tr><td><a href="ft2-bdf_fonts.html#FT_PropertyType">BDF_PROPERTY_TYPE_NONE</a></td><td><a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a></td><td><a href="ft2-glyph_stroker.html#FT_StrokerBorder">FT_StrokerBorder</a></td></tr>
-<tr><td><a href="ft2-bdf_fonts.html#BDF_Property">BDF_Property</a></td><td><a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilterWeights">FT_Library_SetLcdFilterWeights</a></td><td><a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_2X2</a></td></tr>
-<tr><td><a href="ft2-bdf_fonts.html#BDF_PropertyRec">BDF_PropertyRec</a></td><td><a href="ft2-version.html#FT_Library_Version">FT_Library_Version</a></td><td><a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS</a></td></tr>
-<tr><td><a href="ft2-type1_tables.html#CID_FaceDict">CID_FaceDict</a></td><td><a href="ft2-list_processing.html#FT_List">FT_List</a></td><td><a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES</a></td></tr>
-<tr><td><a href="ft2-type1_tables.html#CID_FaceDictRec">CID_FaceDictRec</a></td><td><a href="ft2-list_processing.html#FT_List_Add">FT_List_Add</a></td><td><a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID</a></td></tr>
-<tr><td><a href="ft2-type1_tables.html#CID_FaceInfo">CID_FaceInfo</a></td><td><a href="ft2-list_processing.html#FT_List_Destructor">FT_List_Destructor</a></td><td><a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_SCALE</a></td></tr>
-<tr><td><a href="ft2-type1_tables.html#CID_FaceInfoRec">CID_FaceInfoRec</a></td><td><a href="ft2-list_processing.html#FT_List_Finalize">FT_List_Finalize</a></td><td><a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_USE_MY_METRICS</a></td></tr>
-<tr><td><a href="ft2-type1_tables.html#CID_Info">CID_Info</a></td><td><a href="ft2-list_processing.html#FT_List_Find">FT_List_Find</a></td><td><a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_XXX</a></td></tr>
-<tr><td><a href="ft2-version.html#FREETYPE_XXX">FREETYPE_MAJOR</a></td><td><a href="ft2-list_processing.html#FT_List_Insert">FT_List_Insert</a></td><td><a href="ft2-base_interface.html#FT_SUBGLYPH_FLAG_XXX">FT_SUBGLYPH_FLAG_XY_SCALE</a></td></tr>
-<tr><td><a href="ft2-version.html#FREETYPE_XXX">FREETYPE_MINOR</a></td><td><a href="ft2-list_processing.html#FT_List_Iterate">FT_List_Iterate</a></td><td><a href="ft2-base_interface.html#FT_SubGlyph">FT_SubGlyph</a></td></tr>
-<tr><td><a href="ft2-version.html#FREETYPE_XXX">FREETYPE_PATCH</a></td><td><a href="ft2-list_processing.html#FT_List_Iterator">FT_List_Iterator</a></td><td><a href="ft2-header_file_macros.html#FT_SYNTHESIS_H">FT_SYNTHESIS_H</a></td></tr>
-<tr><td><a href="ft2-version.html#FREETYPE_XXX">FREETYPE_XXX</a></td><td><a href="ft2-list_processing.html#FT_List_Remove">FT_List_Remove</a></td><td><a href="ft2-header_file_macros.html#FT_SYSTEM_H">FT_SYSTEM_H</a></td></tr>
-<tr><td><a href="ft2-sizes_management.html#FT_Activate_Size">FT_Activate_Size</a></td><td><a href="ft2-list_processing.html#FT_List_Up">FT_List_Up</a></td><td><a href="ft2-basic_types.html#FT_Tag">FT_Tag</a></td></tr>
-<tr><td><a href="ft2-quick_advance.html#FT_ADVANCE_FLAG_FAST_ONLY">FT_ADVANCE_FLAG_FAST_ONLY</a></td><td><a href="ft2-list_processing.html#FT_ListNode">FT_ListNode</a></td><td><a href="ft2-computations.html#FT_Tan">FT_Tan</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_ADVANCES_H">FT_ADVANCES_H</a></td><td><a href="ft2-list_processing.html#FT_ListNodeRec">FT_ListNodeRec</a></td><td><a href="ft2-header_file_macros.html#FT_TRIGONOMETRY_H">FT_TRIGONOMETRY_H</a></td></tr>
-<tr><td><a href="ft2-module_management.html#FT_Add_Default_Modules">FT_Add_Default_Modules</a></td><td><a href="ft2-list_processing.html#FT_ListRec">FT_ListRec</a></td><td><a href="ft2-truetype_engine.html#FT_TrueTypeEngineType">FT_TRUETYPE_ENGINE_TYPE_NONE</a></td></tr>
-<tr><td><a href="ft2-module_management.html#FT_Add_Module">FT_Add_Module</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_CROP_BITMAP</a></td><td><a href="ft2-truetype_engine.html#FT_TrueTypeEngineType">FT_TRUETYPE_ENGINE_TYPE_PATENTED</a></td></tr>
-<tr><td><a href="ft2-system_interface.html#FT_Alloc_Func">FT_Alloc_Func</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_DEFAULT</a></td><td><a href="ft2-truetype_engine.html#FT_TrueTypeEngineType">FT_TRUETYPE_ENGINE_TYPE_UNPATENTED</a></td></tr>
-<tr><td><a href="ft2-computations.html#FT_ANGLE_2PI">FT_ANGLE_2PI</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_FORCE_AUTOHINT</a></td><td><a href="ft2-header_file_macros.html#FT_TRUETYPE_IDS_H">FT_TRUETYPE_IDS_H</a></td></tr>
-<tr><td><a href="ft2-computations.html#FT_ANGLE_PI">FT_ANGLE_PI</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH</a></td><td><a href="ft2-header_file_macros.html#FT_TRUETYPE_TABLES_H">FT_TRUETYPE_TABLES_H</a></td></tr>
-<tr><td><a href="ft2-computations.html#FT_ANGLE_PI2">FT_ANGLE_PI2</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_IGNORE_TRANSFORM</a></td><td><a href="ft2-header_file_macros.html#FT_TRUETYPE_TAGS_H">FT_TRUETYPE_TAGS_H</a></td></tr>
-<tr><td><a href="ft2-computations.html#FT_ANGLE_PI4">FT_ANGLE_PI4</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_LINEAR_DESIGN</a></td><td><a href="ft2-truetype_engine.html#FT_TrueTypeEngineType">FT_TrueTypeEngineType</a></td></tr>
-<tr><td><a href="ft2-computations.html#FT_Angle">FT_Angle</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_MONOCHROME</a></td><td><a href="ft2-gx_validation.html#FT_TrueTypeGX_Free">FT_TrueTypeGX_Free</a></td></tr>
-<tr><td><a href="ft2-computations.html#FT_Angle_Diff">FT_Angle_Diff</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_AUTOHINT</a></td><td><a href="ft2-gx_validation.html#FT_TrueTypeGX_Validate">FT_TrueTypeGX_Validate</a></td></tr>
-<tr><td><a href="ft2-computations.html#FT_Atan2">FT_Atan2</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_BITMAP</a></td><td><a href="ft2-header_file_macros.html#FT_TYPE1_TABLES_H">FT_TYPE1_TABLES_H</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Attach_File">FT_Attach_File</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_HINTING</a></td><td><a href="ft2-header_file_macros.html#FT_TYPES_H">FT_TYPES_H</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Attach_Stream">FT_Attach_Stream</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_RECURSE</a></td><td><a href="ft2-basic_types.html#FT_UFWord">FT_UFWord</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_BBOX_H">FT_BBOX_H</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a></td><td><a href="ft2-basic_types.html#FT_UInt">FT_UInt</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_BBox">FT_BBox</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_PEDANTIC</a></td><td><a href="ft2-basic_types.html#FT_UInt16">FT_UInt16</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_BDF_H">FT_BDF_H</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_RENDER</a></td><td><a href="ft2-basic_types.html#FT_UInt32">FT_UInt32</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_BITMAP_H">FT_BITMAP_H</a></td><td><a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_LCD</a></td><td><a href="ft2-basic_types.html#FT_ULong">FT_ULong</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a></td><td><a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_LCD_V</a></td><td><a href="ft2-header_file_macros.html#FT_UNPATENTED_HINTING_H">FT_UNPATENTED_HINTING_H</a></td></tr>
-<tr><td><a href="ft2-bitmap_handling.html#FT_Bitmap_Convert">FT_Bitmap_Convert</a></td><td><a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_LIGHT</a></td><td><a href="ft2-basic_types.html#FT_UnitVector">FT_UnitVector</a></td></tr>
-<tr><td><a href="ft2-bitmap_handling.html#FT_Bitmap_Copy">FT_Bitmap_Copy</a></td><td><a href="ft2-base_interface.html#FT_LOAD_TARGET_MODE">FT_LOAD_TARGET_MODE</a></td><td><a href="ft2-basic_types.html#FT_UShort">FT_UShort</a></td></tr>
-<tr><td><a href="ft2-bitmap_handling.html#FT_Bitmap_Done">FT_Bitmap_Done</a></td><td><a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_MONO</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_CKERNXXX">FT_VALIDATE_APPLE</a></td></tr>
-<tr><td><a href="ft2-bitmap_handling.html#FT_Bitmap_Embolden">FT_Bitmap_Embolden</a></td><td><a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_NORMAL</a></td><td><a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_BASE</a></td></tr>
-<tr><td><a href="ft2-bitmap_handling.html#FT_Bitmap_New">FT_Bitmap_New</a></td><td><a href="ft2-base_interface.html#FT_LOAD_TARGET_XXX">FT_LOAD_TARGET_XXX</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_bsln</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Bitmap_Size">FT_Bitmap_Size</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_VERTICAL_LAYOUT</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_CKERNXXX">FT_VALIDATE_CKERN</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_BitmapGlyph">FT_BitmapGlyph</a></td><td><a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_XXX</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_CKERNXXX">FT_VALIDATE_CKERNXXX</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_BitmapGlyphRec">FT_BitmapGlyphRec</a></td><td><a href="ft2-base_interface.html#FT_Load_Char">FT_Load_Char</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_feat</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Bool">FT_Bool</a></td><td><a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a></td><td><a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_GDEF</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Byte">FT_Byte</a></td><td><a href="ft2-truetype_tables.html#FT_Load_Sfnt_Table">FT_Load_Sfnt_Table</a></td><td><a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_GPOS</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Bytes">FT_Bytes</a></td><td><a href="ft2-basic_types.html#FT_Long">FT_Long</a></td><td><a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_GSUB</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_BZIP2_H">FT_BZIP2_H</a></td><td><a href="ft2-header_file_macros.html#FT_LZW_H">FT_LZW_H</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_GX</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_CACHE_CHARMAP_H">FT_CACHE_CHARMAP_H</a></td><td><a href="ft2-header_file_macros.html#FT_MAC_H">FT_MAC_H</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_GX_LENGTH">FT_VALIDATE_GX_LENGTH</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_CACHE_H">FT_CACHE_H</a></td><td><a href="ft2-basic_types.html#FT_MAKE_TAG">FT_MAKE_TAG</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_GXXXX</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_CACHE_IMAGE_H">FT_CACHE_IMAGE_H</a></td><td><a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a></td><td><a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_JSTF</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_CACHE_SMALL_BITMAPS_H">FT_CACHE_SMALL_BITMAPS_H</a></td><td><a href="ft2-computations.html#FT_Matrix_Invert">FT_Matrix_Invert</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_just</a></td></tr>
-<tr><td><a href="ft2-computations.html#FT_CeilFix">FT_CeilFix</a></td><td><a href="ft2-computations.html#FT_Matrix_Multiply">FT_Matrix_Multiply</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_kern</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Char">FT_Char</a></td><td><a href="ft2-system_interface.html#FT_Memory">FT_Memory</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_lcar</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_CharMap">FT_CharMap</a></td><td><a href="ft2-system_interface.html#FT_MemoryRec">FT_MemoryRec</a></td><td><a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_MATH</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_CharMapRec">FT_CharMapRec</a></td><td><a href="ft2-multiple_masters.html#FT_MM_Axis">FT_MM_Axis</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_CKERNXXX">FT_VALIDATE_MS</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_CID_H">FT_CID_H</a></td><td><a href="ft2-multiple_masters.html#FT_MM_Var">FT_MM_Var</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_mort</a></td></tr>
-<tr><td><a href="ft2-gx_validation.html#FT_ClassicKern_Free">FT_ClassicKern_Free</a></td><td><a href="ft2-header_file_macros.html#FT_MODULE_ERRORS_H">FT_MODULE_ERRORS_H</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_morx</a></td></tr>
-<tr><td><a href="ft2-gx_validation.html#FT_ClassicKern_Validate">FT_ClassicKern_Validate</a></td><td><a href="ft2-header_file_macros.html#FT_MODULE_H">FT_MODULE_H</a></td><td><a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_OT</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_CONFIG_CONFIG_H">FT_CONFIG_CONFIG_H</a></td><td><a href="ft2-base_interface.html#FT_Module">FT_Module</a></td><td><a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_OTXXX</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_CONFIG_MODULES_H">FT_CONFIG_MODULES_H</a></td><td><a href="ft2-module_management.html#FT_Module_Class">FT_Module_Class</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_opbd</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_CONFIG_OPTIONS_H">FT_CONFIG_OPTIONS_H</a></td><td><a href="ft2-module_management.html#FT_Module_Constructor">FT_Module_Constructor</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_prop</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_CONFIG_STANDARD_LIBRARY_H">FT_CONFIG_STANDARD_LIBRARY_H</a></td><td><a href="ft2-module_management.html#FT_Module_Destructor">FT_Module_Destructor</a></td><td><a href="ft2-gx_validation.html#FT_VALIDATE_GXXXX">FT_VALIDATE_trak</a></td></tr>
-<tr><td><a href="ft2-computations.html#FT_Cos">FT_Cos</a></td><td><a href="ft2-module_management.html#FT_Module_Requester">FT_Module_Requester</a></td><td><a href="ft2-multiple_masters.html#FT_Var_Axis">FT_Var_Axis</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Data">FT_Data</a></td><td><a href="ft2-header_file_macros.html#FT_MULTIPLE_MASTERS_H">FT_MULTIPLE_MASTERS_H</a></td><td><a href="ft2-multiple_masters.html#FT_Var_Named_Style">FT_Var_Named_Style</a></td></tr>
-<tr><td><a href="ft2-computations.html#FT_DivFix">FT_DivFix</a></td><td><a href="ft2-computations.html#FT_MulDiv">FT_MulDiv</a></td><td><a href="ft2-basic_types.html#FT_Vector">FT_Vector</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Done_Face">FT_Done_Face</a></td><td><a href="ft2-computations.html#FT_MulFix">FT_MulFix</a></td><td><a href="ft2-computations.html#FT_Vector_From_Polar">FT_Vector_From_Polar</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Done_FreeType">FT_Done_FreeType</a></td><td><a href="ft2-multiple_masters.html#FT_Multi_Master">FT_Multi_Master</a></td><td><a href="ft2-computations.html#FT_Vector_Length">FT_Vector_Length</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_Done_Glyph">FT_Done_Glyph</a></td><td><a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a></td><td><a href="ft2-computations.html#FT_Vector_Polarize">FT_Vector_Polarize</a></td></tr>
-<tr><td><a href="ft2-module_management.html#FT_Done_Library">FT_Done_Library</a></td><td><a href="ft2-mac_specific.html#FT_New_Face_From_FOND">FT_New_Face_From_FOND</a></td><td><a href="ft2-computations.html#FT_Vector_Rotate">FT_Vector_Rotate</a></td></tr>
-<tr><td><a href="ft2-sizes_management.html#FT_Done_Size">FT_Done_Size</a></td><td><a href="ft2-mac_specific.html#FT_New_Face_From_FSRef">FT_New_Face_From_FSRef</a></td><td><a href="ft2-computations.html#FT_Vector_Transform">FT_Vector_Transform</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Driver">FT_Driver</a></td><td><a href="ft2-mac_specific.html#FT_New_Face_From_FSSpec">FT_New_Face_From_FSSpec</a></td><td><a href="ft2-computations.html#FT_Vector_Unit">FT_Vector_Unit</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a></td><td><a href="ft2-module_management.html#FT_New_Library">FT_New_Library</a></td><td><a href="ft2-header_file_macros.html#FT_WINFONTS_H">FT_WINFONTS_H</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_CUSTOM</a></td><td><a href="ft2-base_interface.html#FT_New_Memory_Face">FT_New_Memory_Face</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_Header">FT_WinFNT_Header</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_EXPERT</a></td><td><a href="ft2-sizes_management.html#FT_New_Size">FT_New_Size</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_HeaderRec">FT_WinFNT_HeaderRec</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_LATIN_1</a></td><td><a href="ft2-basic_types.html#FT_Offset">FT_Offset</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1250</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_STANDARD</a></td><td><a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_DRIVER</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1251</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_APPLE_ROMAN</a></td><td><a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_MEMORY</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1252</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_BIG5</a></td><td><a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_PARAMS</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1253</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_GB2312</a></td><td><a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_PATHNAME</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1254</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_JOHAB</a></td><td><a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_STREAM</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1255</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_BIG5</a></td><td><a href="ft2-base_interface.html#FT_OPEN_XXX">FT_OPEN_XXX</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1256</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_GB2312</a></td><td><a href="ft2-header_file_macros.html#FT_OPENTYPE_VALIDATE_H">FT_OPENTYPE_VALIDATE_H</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1257</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_JOHAB</a></td><td><a href="ft2-base_interface.html#FT_Open_Args">FT_Open_Args</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1258</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_SJIS</a></td><td><a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1361</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_SYMBOL</a></td><td><a href="ft2-ot_validation.html#FT_OpenType_Free">FT_OpenType_Free</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP874</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_WANSUNG</a></td><td><a href="ft2-ot_validation.html#FT_OpenType_Validate">FT_OpenType_Validate</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP932</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_NONE</a></td><td><a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_FILL_LEFT</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP936</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_OLD_LATIN_2</a></td><td><a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_FILL_RIGHT</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP949</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_SJIS</a></td><td><a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_NONE</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP950</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_UNICODE</a></td><td><a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_POSTSCRIPT</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_DEFAULT</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_WANSUNG</a></td><td><a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_TRUETYPE</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_MAC</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Encoding">FT_Encoding</a></td><td><a href="ft2-outline_processing.html#FT_Orientation">FT_Orientation</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_OEM</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_ERRORS_H">FT_ERRORS_H</a></td><td><a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_EVEN_ODD_FILL</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_SYMBOL</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Error">FT_Error</a></td><td><a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_FLAGS</a></td><td><a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_XXX</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_F26Dot6">FT_F26Dot6</a></td><td><a href="ft2-header_file_macros.html#FT_OUTLINE_H">FT_OUTLINE_H</a></td><td><a href="ft2-header_file_macros.html#FT_XFREE86_H">FT_XFREE86_H</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_F2Dot14">FT_F2Dot14</a></td><td><a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_HIGH_PRECISION</a></td><td><a href="ft2-cache_subsystem.html#FTC_CMapCache">FTC_CMapCache</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_CID_KEYED</a></td><td><a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_IGNORE_DROPOUTS</a></td><td><a href="ft2-cache_subsystem.html#FTC_CMapCache_Lookup">FTC_CMapCache_Lookup</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_EXTERNAL_STREAM</a></td><td><a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_INCLUDE_STUBS</a></td><td><a href="ft2-cache_subsystem.html#FTC_CMapCache_New">FTC_CMapCache_New</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_FAST_GLYPHS</a></td><td><a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_NONE</a></td><td><a href="ft2-cache_subsystem.html#FTC_Face_Requester">FTC_Face_Requester</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_FIXED_SIZES</a></td><td><a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_OWNER</a></td><td><a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_FIXED_WIDTH</a></td><td><a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_REVERSE_FILL</a></td><td><a href="ft2-cache_subsystem.html#FTC_ImageCache">FTC_ImageCache</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_GLYPH_NAMES</a></td><td><a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_SINGLE_PASS</a></td><td><a href="ft2-cache_subsystem.html#FTC_ImageCache_Lookup">FTC_ImageCache_Lookup</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_HINTER</a></td><td><a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_SMART_DROPOUTS</a></td><td><a href="ft2-cache_subsystem.html#FTC_ImageCache_LookupScaler">FTC_ImageCache_LookupScaler</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_HORIZONTAL</a></td><td><a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a></td><td><a href="ft2-cache_subsystem.html#FTC_ImageCache_New">FTC_ImageCache_New</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_KERNING</a></td><td><a href="ft2-outline_processing.html#FT_Outline_Check">FT_Outline_Check</a></td><td><a href="ft2-cache_subsystem.html#FTC_ImageType">FTC_ImageType</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_MULTIPLE_MASTERS</a></td><td><a href="ft2-outline_processing.html#FT_Outline_ConicToFunc">FT_Outline_ConicToFunc</a></td><td><a href="ft2-cache_subsystem.html#FTC_ImageTypeRec">FTC_ImageTypeRec</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_SCALABLE</a></td><td><a href="ft2-outline_processing.html#FT_Outline_Copy">FT_Outline_Copy</a></td><td><a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_SFNT</a></td><td><a href="ft2-outline_processing.html#FT_Outline_CubicToFunc">FT_Outline_CubicToFunc</a></td><td><a href="ft2-cache_subsystem.html#FTC_Manager_Done">FTC_Manager_Done</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_TRICKY</a></td><td><a href="ft2-outline_processing.html#FT_Outline_Decompose">FT_Outline_Decompose</a></td><td><a href="ft2-cache_subsystem.html#FTC_Manager_LookupFace">FTC_Manager_LookupFace</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_VERTICAL</a></td><td><a href="ft2-outline_processing.html#FT_Outline_Done">FT_Outline_Done</a></td><td><a href="ft2-cache_subsystem.html#FTC_Manager_LookupSize">FTC_Manager_LookupSize</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FACE_FLAG_XXX">FT_FACE_FLAG_XXX</a></td><td><a href="ft2-outline_processing.html#FT_Outline_Embolden">FT_Outline_Embolden</a></td><td><a href="ft2-cache_subsystem.html#FTC_Manager_New">FTC_Manager_New</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Face">FT_Face</a></td><td><a href="ft2-outline_processing.html#FT_Outline_Funcs">FT_Outline_Funcs</a></td><td><a href="ft2-cache_subsystem.html#FTC_Manager_RemoveFaceID">FTC_Manager_RemoveFaceID</a></td></tr>
-<tr><td><a href="ft2-version.html#FT_Face_CheckTrueTypePatents">FT_Face_CheckTrueTypePatents</a></td><td><a href="ft2-outline_processing.html#FT_Outline_Get_BBox">FT_Outline_Get_BBox</a></td><td><a href="ft2-cache_subsystem.html#FTC_Manager_Reset">FTC_Manager_Reset</a></td></tr>
-<tr><td><a href="ft2-glyph_variants.html#FT_Face_GetCharsOfVariant">FT_Face_GetCharsOfVariant</a></td><td><a href="ft2-outline_processing.html#FT_Outline_Get_Bitmap">FT_Outline_Get_Bitmap</a></td><td><a href="ft2-cache_subsystem.html#FTC_Node">FTC_Node</a></td></tr>
-<tr><td><a href="ft2-glyph_variants.html#FT_Face_GetCharVariantIndex">FT_Face_GetCharVariantIndex</a></td><td><a href="ft2-outline_processing.html#FT_Outline_Get_CBox">FT_Outline_Get_CBox</a></td><td><a href="ft2-cache_subsystem.html#FTC_Node_Unref">FTC_Node_Unref</a></td></tr>
-<tr><td><a href="ft2-glyph_variants.html#FT_Face_GetCharVariantIsDefault">FT_Face_GetCharVariantIsDefault</a></td><td><a href="ft2-outline_processing.html#FT_Outline_Get_Orientation">FT_Outline_Get_Orientation</a></td><td><a href="ft2-cache_subsystem.html#FTC_SBit">FTC_SBit</a></td></tr>
-<tr><td><a href="ft2-glyph_variants.html#FT_Face_GetVariantSelectors">FT_Face_GetVariantSelectors</a></td><td><a href="ft2-glyph_stroker.html#FT_Outline_GetInsideBorder">FT_Outline_GetInsideBorder</a></td><td><a href="ft2-cache_subsystem.html#FTC_SBitCache">FTC_SBitCache</a></td></tr>
-<tr><td><a href="ft2-glyph_variants.html#FT_Face_GetVariantsOfChar">FT_Face_GetVariantsOfChar</a></td><td><a href="ft2-glyph_stroker.html#FT_Outline_GetOutsideBorder">FT_Outline_GetOutsideBorder</a></td><td><a href="ft2-cache_subsystem.html#FTC_SBitCache_Lookup">FTC_SBitCache_Lookup</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Face_Internal">FT_Face_Internal</a></td><td><a href="ft2-outline_processing.html#FT_Outline_LineToFunc">FT_Outline_LineToFunc</a></td><td><a href="ft2-cache_subsystem.html#FTC_SBitCache_LookupScaler">FTC_SBitCache_LookupScaler</a></td></tr>
-<tr><td><a href="ft2-version.html#FT_Face_SetUnpatentedHinting">FT_Face_SetUnpatentedHinting</a></td><td><a href="ft2-outline_processing.html#FT_Outline_MoveToFunc">FT_Outline_MoveToFunc</a></td><td><a href="ft2-cache_subsystem.html#FTC_SBitCache_New">FTC_SBitCache_New</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a></td><td><a href="ft2-outline_processing.html#FT_Outline_New">FT_Outline_New</a></td><td><a href="ft2-cache_subsystem.html#FTC_SBitRec">FTC_SBitRec</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a></td><td><a href="ft2-outline_processing.html#FT_Outline_Render">FT_Outline_Render</a></td><td><a href="ft2-cache_subsystem.html#FTC_Scaler">FTC_Scaler</a></td></tr>
-<tr><td><a href="ft2-computations.html#FT_FloorFix">FT_FloorFix</a></td><td><a href="ft2-outline_processing.html#FT_Outline_Reverse">FT_Outline_Reverse</a></td><td><a href="ft2-cache_subsystem.html#FTC_ScalerRec">FTC_ScalerRec</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_FREETYPE_H">FT_FREETYPE_H</a></td><td><a href="ft2-outline_processing.html#FT_Outline_Transform">FT_Outline_Transform</a></td><td><a href="ft2-base_interface.html#ft_encoding_xxx">ft_encoding_xxx</a></td></tr>
-<tr><td><a href="ft2-system_interface.html#FT_Free_Func">FT_Free_Func</a></td><td><a href="ft2-outline_processing.html#FT_Outline_Translate">FT_Outline_Translate</a></td><td><a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_gridfit</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FSTYPE_XXX">FT_FSTYPE_BITMAP_EMBEDDING_ONLY</a></td><td><a href="ft2-glyph_management.html#FT_OutlineGlyph">FT_OutlineGlyph</a></td><td><a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_pixels</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FSTYPE_XXX">FT_FSTYPE_EDITABLE_EMBEDDING</a></td><td><a href="ft2-glyph_management.html#FT_OutlineGlyphRec">FT_OutlineGlyphRec</a></td><td><a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_subpixels</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FSTYPE_XXX">FT_FSTYPE_INSTALLABLE_EMBEDDING</a></td><td><a href="ft2-sfnt_names.html#FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY">FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY</a></td><td><a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_truncate</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FSTYPE_XXX">FT_FSTYPE_NO_SUBSETTING</a></td><td><a href="ft2-sfnt_names.html#FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY">FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY</a></td><td><a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_unscaled</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FSTYPE_XXX">FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING</a></td><td><a href="ft2-incremental.html#FT_PARAM_TAG_INCREMENTAL">FT_PARAM_TAG_INCREMENTAL</a></td><td><a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_xxx</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FSTYPE_XXX">FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING</a></td><td><a href="ft2-truetype_tables.html#FT_PARAM_TAG_UNPATENTED_HINTING">FT_PARAM_TAG_UNPATENTED_HINTING</a></td><td><a href="ft2-basic_types.html#ft_glyph_format_xxx">ft_glyph_format_bitmap</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_FSTYPE_XXX">FT_FSTYPE_XXX</a></td><td><a href="ft2-basic_types.html#FT_Palette_Mode">FT_Palette_Mode</a></td><td><a href="ft2-basic_types.html#ft_glyph_format_xxx">ft_glyph_format_composite</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_FWord">FT_FWord</a></td><td><a href="ft2-base_interface.html#FT_Parameter">FT_Parameter</a></td><td><a href="ft2-basic_types.html#ft_glyph_format_xxx">ft_glyph_format_none</a></td></tr>
-<tr><td><a href="ft2-gasp_table.html#FT_GASP_XXX">FT_GASP_DO_GRAY</a></td><td><a href="ft2-header_file_macros.html#FT_PFR_H">FT_PFR_H</a></td><td><a href="ft2-basic_types.html#ft_glyph_format_xxx">ft_glyph_format_outline</a></td></tr>
-<tr><td><a href="ft2-gasp_table.html#FT_GASP_XXX">FT_GASP_DO_GRIDFIT</a></td><td><a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_GRAY</a></td><td><a href="ft2-basic_types.html#ft_glyph_format_xxx">ft_glyph_format_plotter</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_GASP_H">FT_GASP_H</a></td><td><a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_GRAY2</a></td><td><a href="ft2-basic_types.html#ft_glyph_format_xxx">ft_glyph_format_xxx</a></td></tr>
-<tr><td><a href="ft2-gasp_table.html#FT_GASP_XXX">FT_GASP_NO_TABLE</a></td><td><a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_GRAY4</a></td><td><a href="ft2-base_interface.html#ft_kerning_default">ft_kerning_default</a></td></tr>
-<tr><td><a href="ft2-gasp_table.html#FT_GASP_XXX">FT_GASP_SYMMETRIC_GRIDFIT</a></td><td><a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_LCD</a></td><td><a href="ft2-base_interface.html#ft_kerning_unfitted">ft_kerning_unfitted</a></td></tr>
-<tr><td><a href="ft2-gasp_table.html#FT_GASP_XXX">FT_GASP_SYMMETRIC_SMOOTHING</a></td><td><a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_LCD_V</a></td><td><a href="ft2-base_interface.html#ft_kerning_unscaled">ft_kerning_unscaled</a></td></tr>
-<tr><td><a href="ft2-gasp_table.html#FT_GASP_XXX">FT_GASP_XXX</a></td><td><a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_MONO</a></td><td><a href="ft2-base_interface.html#FT_OPEN_XXX">ft_open_driver</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Generic">FT_Generic</a></td><td><a href="ft2-basic_types.html#FT_Pixel_Mode">FT_PIXEL_MODE_NONE</a></td><td><a href="ft2-base_interface.html#FT_OPEN_XXX">ft_open_memory</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Generic_Finalizer">FT_Generic_Finalizer</a></td><td><a href="ft2-basic_types.html#FT_Pixel_Mode">FT_Pixel_Mode</a></td><td><a href="ft2-base_interface.html#FT_OPEN_XXX">ft_open_params</a></td></tr>
-<tr><td><a href="ft2-quick_advance.html#FT_Get_Advance">FT_Get_Advance</a></td><td><a href="ft2-basic_types.html#FT_Pointer">FT_Pointer</a></td><td><a href="ft2-base_interface.html#FT_OPEN_XXX">ft_open_pathname</a></td></tr>
-<tr><td><a href="ft2-quick_advance.html#FT_Get_Advances">FT_Get_Advances</a></td><td><a href="ft2-basic_types.html#FT_Pos">FT_Pos</a></td><td><a href="ft2-base_interface.html#FT_OPEN_XXX">ft_open_stream</a></td></tr>
-<tr><td><a href="ft2-bdf_fonts.html#FT_Get_BDF_Charset_ID">FT_Get_BDF_Charset_ID</a></td><td><a href="ft2-bdf_fonts.html#FT_PropertyType">FT_PropertyType</a></td><td><a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_even_odd_fill</a></td></tr>
-<tr><td><a href="ft2-bdf_fonts.html#FT_Get_BDF_Property">FT_Get_BDF_Property</a></td><td><a href="ft2-basic_types.html#FT_PtrDist">FT_PtrDist</a></td><td><a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_flags</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Get_Char_Index">FT_Get_Char_Index</a></td><td><a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_AA</a></td><td><a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_high_precision</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Get_Charmap_Index">FT_Get_Charmap_Index</a></td><td><a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_CLIP</a></td><td><a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_ignore_dropouts</a></td></tr>
-<tr><td><a href="ft2-cid_fonts.html#FT_Get_CID_From_Glyph_Index">FT_Get_CID_From_Glyph_Index</a></td><td><a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_DEFAULT</a></td><td><a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_none</a></td></tr>
-<tr><td><a href="ft2-cid_fonts.html#FT_Get_CID_Is_Internally_CID_Keyed">FT_Get_CID_Is_Internally_CID_Keyed</a></td><td><a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_DIRECT</a></td><td><a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_owner</a></td></tr>
-<tr><td><a href="ft2-cid_fonts.html#FT_Get_CID_Registry_Ordering_Supplement">FT_Get_CID_Registry_Ordering_Supplement</a></td><td><a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_XXX</a></td><td><a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_reverse_fill</a></td></tr>
-<tr><td><a href="ft2-truetype_tables.html#FT_Get_CMap_Format">FT_Get_CMap_Format</a></td><td><a href="ft2-raster.html#FT_Raster">FT_Raster</a></td><td><a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_single_pass</a></td></tr>
-<tr><td><a href="ft2-truetype_tables.html#FT_Get_CMap_Language_ID">FT_Get_CMap_Language_ID</a></td><td><a href="ft2-raster.html#FT_Raster_BitSet_Func">FT_Raster_BitSet_Func</a></td><td><a href="ft2-basic_types.html#FT_Palette_Mode">ft_palette_mode_rgb</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Get_First_Char">FT_Get_First_Char</a></td><td><a href="ft2-raster.html#FT_Raster_BitTest_Func">FT_Raster_BitTest_Func</a></td><td><a href="ft2-basic_types.html#FT_Palette_Mode">ft_palette_mode_rgba</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Get_FSType_Flags">FT_Get_FSType_Flags</a></td><td><a href="ft2-raster.html#FT_Raster_DoneFunc">FT_Raster_DoneFunc</a></td><td><a href="ft2-basic_types.html#ft_pixel_mode_xxx">ft_pixel_mode_grays</a></td></tr>
-<tr><td><a href="ft2-gasp_table.html#FT_Get_Gasp">FT_Get_Gasp</a></td><td><a href="ft2-raster.html#FT_Raster_Funcs">FT_Raster_Funcs</a></td><td><a href="ft2-basic_types.html#ft_pixel_mode_xxx">ft_pixel_mode_mono</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_Get_Glyph">FT_Get_Glyph</a></td><td><a href="ft2-raster.html#FT_Raster_NewFunc">FT_Raster_NewFunc</a></td><td><a href="ft2-basic_types.html#ft_pixel_mode_xxx">ft_pixel_mode_none</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Get_Glyph_Name">FT_Get_Glyph_Name</a></td><td><a href="ft2-raster.html#FT_Raster_Params">FT_Raster_Params</a></td><td><a href="ft2-basic_types.html#ft_pixel_mode_xxx">ft_pixel_mode_pal2</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Get_Kerning">FT_Get_Kerning</a></td><td><a href="ft2-raster.html#FT_Raster_RenderFunc">FT_Raster_RenderFunc</a></td><td><a href="ft2-basic_types.html#ft_pixel_mode_xxx">ft_pixel_mode_pal4</a></td></tr>
-<tr><td><a href="ft2-multiple_masters.html#FT_Get_MM_Var">FT_Get_MM_Var</a></td><td><a href="ft2-raster.html#FT_Raster_ResetFunc">FT_Raster_ResetFunc</a></td><td><a href="ft2-basic_types.html#ft_pixel_mode_xxx">ft_pixel_mode_xxx</a></td></tr>
-<tr><td><a href="ft2-module_management.html#FT_Get_Module">FT_Get_Module</a></td><td><a href="ft2-raster.html#FT_Raster_SetModeFunc">FT_Raster_SetModeFunc</a></td><td><a href="ft2-base_interface.html#ft_render_mode_xxx">ft_render_mode_mono</a></td></tr>
-<tr><td><a href="ft2-multiple_masters.html#FT_Get_Multi_Master">FT_Get_Multi_Master</a></td><td><a href="ft2-header_file_macros.html#FT_RENDER_H">FT_RENDER_H</a></td><td><a href="ft2-base_interface.html#ft_render_mode_xxx">ft_render_mode_normal</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Get_Name_Index">FT_Get_Name_Index</a></td><td><a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LCD</a></td><td><a href="ft2-base_interface.html#ft_render_mode_xxx">ft_render_mode_xxx</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Get_Next_Char">FT_Get_Next_Char</a></td><td><a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LCD_V</a></td><td><a href="ft2-type1_tables.html#PS_Dict_Keys">PS_Dict_Keys</a></td></tr>
-<tr><td><a href="ft2-pfr_fonts.html#FT_Get_PFR_Advance">FT_Get_PFR_Advance</a></td><td><a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LIGHT</a></td><td><a href="ft2-type1_tables.html#PS_FontInfo">PS_FontInfo</a></td></tr>
-<tr><td><a href="ft2-pfr_fonts.html#FT_Get_PFR_Kerning">FT_Get_PFR_Kerning</a></td><td><a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_MONO</a></td><td><a href="ft2-type1_tables.html#PS_FontInfoRec">PS_FontInfoRec</a></td></tr>
-<tr><td><a href="ft2-pfr_fonts.html#FT_Get_PFR_Metrics">FT_Get_PFR_Metrics</a></td><td><a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_NORMAL</a></td><td><a href="ft2-type1_tables.html#PS_Private">PS_Private</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Get_Postscript_Name">FT_Get_Postscript_Name</a></td><td><a href="ft2-system_interface.html#FT_Realloc_Func">FT_Realloc_Func</a></td><td><a href="ft2-type1_tables.html#PS_PrivateRec">PS_PrivateRec</a></td></tr>
-<tr><td><a href="ft2-type1_tables.html#FT_Get_PS_Font_Info">FT_Get_PS_Font_Info</a></td><td><a href="ft2-base_interface.html#FT_Reference_Face">FT_Reference_Face</a></td><td><a href="ft2-type1_tables.html#T1_Blend_Flags">T1_Blend_Flags</a></td></tr>
-<tr><td><a href="ft2-type1_tables.html#FT_Get_PS_Font_Private">FT_Get_PS_Font_Private</a></td><td><a href="ft2-module_management.html#FT_Reference_Library">FT_Reference_Library</a></td><td><a href="ft2-type1_tables.html#T1_EncodingType">T1_EncodingType</a></td></tr>
-<tr><td><a href="ft2-type1_tables.html#FT_Get_PS_Font_Value">FT_Get_PS_Font_Value</a></td><td><a href="ft2-module_management.html#FT_Remove_Module">FT_Remove_Module</a></td><td><a href="ft2-type1_tables.html#T1_FontInfo">T1_FontInfo</a></td></tr>
-<tr><td><a href="ft2-module_management.html#FT_Get_Renderer">FT_Get_Renderer</a></td><td><a href="ft2-base_interface.html#FT_Render_Glyph">FT_Render_Glyph</a></td><td><a href="ft2-type1_tables.html#T1_Private">T1_Private</a></td></tr>
-<tr><td><a href="ft2-sfnt_names.html#FT_Get_Sfnt_Name">FT_Get_Sfnt_Name</a></td><td><a href="ft2-base_interface.html#FT_Render_Mode">FT_Render_Mode</a></td><td><a href="ft2-truetype_tables.html#TT_ADOBE_ID_XXX">TT_ADOBE_ID_CUSTOM</a></td></tr>
-<tr><td><a href="ft2-sfnt_names.html#FT_Get_Sfnt_Name_Count">FT_Get_Sfnt_Name_Count</a></td><td><a href="ft2-base_interface.html#FT_Renderer">FT_Renderer</a></td><td><a href="ft2-truetype_tables.html#TT_ADOBE_ID_XXX">TT_ADOBE_ID_EXPERT</a></td></tr>
-<tr><td><a href="ft2-truetype_tables.html#FT_Get_Sfnt_Table">FT_Get_Sfnt_Table</a></td><td><a href="ft2-module_management.html#FT_Renderer_Class">FT_Renderer_Class</a></td><td><a href="ft2-truetype_tables.html#TT_ADOBE_ID_XXX">TT_ADOBE_ID_LATIN_1</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Get_SubGlyph_Info">FT_Get_SubGlyph_Info</a></td><td><a href="ft2-base_interface.html#FT_Request_Size">FT_Request_Size</a></td><td><a href="ft2-truetype_tables.html#TT_ADOBE_ID_XXX">TT_ADOBE_ID_STANDARD</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Get_Track_Kerning">FT_Get_Track_Kerning</a></td><td><a href="ft2-computations.html#FT_RoundFix">FT_RoundFix</a></td><td><a href="ft2-truetype_tables.html#TT_ADOBE_ID_XXX">TT_ADOBE_ID_XXX</a></td></tr>
-<tr><td><a href="ft2-truetype_engine.html#FT_Get_TrueType_Engine_Type">FT_Get_TrueType_Engine_Type</a></td><td><a href="ft2-base_interface.html#FT_Select_Charmap">FT_Select_Charmap</a></td><td><a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_DEFAULT</a></td></tr>
-<tr><td><a href="ft2-winfnt_fonts.html#FT_Get_WinFNT_Header">FT_Get_WinFNT_Header</a></td><td><a href="ft2-base_interface.html#FT_Select_Size">FT_Select_Size</a></td><td><a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_ISO_10646</a></td></tr>
-<tr><td><a href="ft2-font_formats.html#FT_Get_X11_Font_Format">FT_Get_X11_Font_Format</a></td><td><a href="ft2-base_interface.html#FT_Set_Char_Size">FT_Set_Char_Size</a></td><td><a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_UNICODE_1_1</a></td></tr>
-<tr><td><a href="ft2-mac_specific.html#FT_GetFile_From_Mac_ATS_Name">FT_GetFile_From_Mac_ATS_Name</a></td><td><a href="ft2-base_interface.html#FT_Set_Charmap">FT_Set_Charmap</a></td><td><a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_UNICODE_2_0</a></td></tr>
-<tr><td><a href="ft2-mac_specific.html#FT_GetFile_From_Mac_Name">FT_GetFile_From_Mac_Name</a></td><td><a href="ft2-module_management.html#FT_Set_Debug_Hook">FT_Set_Debug_Hook</a></td><td><a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_UNICODE_32</a></td></tr>
-<tr><td><a href="ft2-mac_specific.html#FT_GetFilePath_From_Mac_ATS_Name">FT_GetFilePath_From_Mac_ATS_Name</a></td><td><a href="ft2-multiple_masters.html#FT_Set_MM_Blend_Coordinates">FT_Set_MM_Blend_Coordinates</a></td><td><a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_VARIANT_SELECTOR</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_GRIDFIT</a></td><td><a href="ft2-multiple_masters.html#FT_Set_MM_Design_Coordinates">FT_Set_MM_Design_Coordinates</a></td><td><a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_XXX</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_PIXELS</a></td><td><a href="ft2-base_interface.html#FT_Set_Pixel_Sizes">FT_Set_Pixel_Sizes</a></td><td><a href="ft2-truetype_tables.html#TT_Header">TT_Header</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_SUBPIXELS</a></td><td><a href="ft2-module_management.html#FT_Set_Renderer">FT_Set_Renderer</a></td><td><a href="ft2-truetype_tables.html#TT_HoriHeader">TT_HoriHeader</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_TRUNCATE</a></td><td><a href="ft2-base_interface.html#FT_Set_Transform">FT_Set_Transform</a></td><td><a href="ft2-truetype_tables.html#TT_ISO_ID_XXX">TT_ISO_ID_10646</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_UNSCALED</a></td><td><a href="ft2-multiple_masters.html#FT_Set_Var_Blend_Coordinates">FT_Set_Var_Blend_Coordinates</a></td><td><a href="ft2-truetype_tables.html#TT_ISO_ID_XXX">TT_ISO_ID_7BIT_ASCII</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_BITMAP</a></td><td><a href="ft2-multiple_masters.html#FT_Set_Var_Design_Coordinates">FT_Set_Var_Design_Coordinates</a></td><td><a href="ft2-truetype_tables.html#TT_ISO_ID_XXX">TT_ISO_ID_8859_1</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_COMPOSITE</a></td><td><a href="ft2-header_file_macros.html#FT_SFNT_NAMES_H">FT_SFNT_NAMES_H</a></td><td><a href="ft2-truetype_tables.html#TT_ISO_ID_XXX">TT_ISO_ID_XXX</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_NONE</a></td><td><a href="ft2-truetype_tables.html#FT_Sfnt_Table_Info">FT_Sfnt_Table_Info</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_ARABIC</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_OUTLINE</a></td><td><a href="ft2-truetype_tables.html#FT_Sfnt_Tag">FT_Sfnt_Tag</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_ARMENIAN</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_PLOTTER</a></td><td><a href="ft2-sfnt_names.html#FT_SfntName">FT_SfntName</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_BENGALI</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_GLYPH_H">FT_GLYPH_H</a></td><td><a href="ft2-basic_types.html#FT_Short">FT_Short</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_BURMESE</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a></td><td><a href="ft2-base_interface.html#FT_Size_Request_Type">FT_SIZE_REQUEST_TYPE_BBOX</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_DEVANAGARI</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_Glyph_BBox_Mode</a></td><td><a href="ft2-base_interface.html#FT_Size_Request_Type">FT_SIZE_REQUEST_TYPE_CELL</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_GEEZ</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_Glyph_Copy">FT_Glyph_Copy</a></td><td><a href="ft2-base_interface.html#FT_Size_Request_Type">FT_SIZE_REQUEST_TYPE_NOMINAL</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_GEORGIAN</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a></td><td><a href="ft2-base_interface.html#FT_Size_Request_Type">FT_SIZE_REQUEST_TYPE_REAL_DIM</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_GREEK</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_Glyph_Get_CBox">FT_Glyph_Get_CBox</a></td><td><a href="ft2-base_interface.html#FT_Size_Request_Type">FT_SIZE_REQUEST_TYPE_SCALES</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_GUJARATI</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Glyph_Metrics">FT_Glyph_Metrics</a></td><td><a href="ft2-header_file_macros.html#FT_SIZES_H">FT_SIZES_H</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_GURMUKHI</a></td></tr>
-<tr><td><a href="ft2-glyph_stroker.html#FT_Glyph_Stroke">FT_Glyph_Stroke</a></td><td><a href="ft2-computations.html#FT_Sin">FT_Sin</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_HEBREW</a></td></tr>
-<tr><td><a href="ft2-glyph_stroker.html#FT_Glyph_StrokeBorder">FT_Glyph_StrokeBorder</a></td><td><a href="ft2-base_interface.html#FT_Size">FT_Size</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_JAPANESE</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_Glyph_To_Bitmap">FT_Glyph_To_Bitmap</a></td><td><a href="ft2-base_interface.html#FT_Size_Internal">FT_Size_Internal</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_KANNADA</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_Glyph_Transform">FT_Glyph_Transform</a></td><td><a href="ft2-base_interface.html#FT_Size_Metrics">FT_Size_Metrics</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_KHMER</a></td></tr>
-<tr><td><a href="ft2-glyph_management.html#FT_GlyphRec">FT_GlyphRec</a></td><td><a href="ft2-base_interface.html#FT_Size_Request">FT_Size_Request</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_KOREAN</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_GlyphSlot">FT_GlyphSlot</a></td><td><a href="ft2-base_interface.html#FT_Size_Request_Type">FT_Size_Request_Type</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_LAOTIAN</a></td></tr>
-<tr><td><a href="ft2-bitmap_handling.html#FT_GlyphSlot_Own_Bitmap">FT_GlyphSlot_Own_Bitmap</a></td><td><a href="ft2-base_interface.html#FT_Size_RequestRec">FT_Size_RequestRec</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_MALAYALAM</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_GlyphSlotRec">FT_GlyphSlotRec</a></td><td><a href="ft2-base_interface.html#FT_SizeRec">FT_SizeRec</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_MALDIVIAN</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_GX_VALIDATE_H">FT_GX_VALIDATE_H</a></td><td><a href="ft2-base_interface.html#FT_Slot_Internal">FT_Slot_Internal</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_MONGOLIAN</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_GZIP_H">FT_GZIP_H</a></td><td><a href="ft2-raster.html#FT_Span">FT_Span</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_ORIYA</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_HAS_FAST_GLYPHS">FT_HAS_FAST_GLYPHS</a></td><td><a href="ft2-raster.html#FT_SpanFunc">FT_SpanFunc</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_ROMAN</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_HAS_FIXED_SIZES">FT_HAS_FIXED_SIZES</a></td><td><a href="ft2-glyph_stroker.html#FT_StrokerBorder">FT_STROKER_BORDER_LEFT</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_RSYMBOL</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_HAS_GLYPH_NAMES">FT_HAS_GLYPH_NAMES</a></td><td><a href="ft2-glyph_stroker.html#FT_StrokerBorder">FT_STROKER_BORDER_RIGHT</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_RUSSIAN</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_HAS_HORIZONTAL">FT_HAS_HORIZONTAL</a></td><td><a href="ft2-header_file_macros.html#FT_STROKER_H">FT_STROKER_H</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_SIMPLIFIED_CHINESE</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_HAS_KERNING">FT_HAS_KERNING</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_LineCap">FT_STROKER_LINECAP_BUTT</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_SINDHI</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_HAS_MULTIPLE_MASTERS">FT_HAS_MULTIPLE_MASTERS</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_LineCap">FT_STROKER_LINECAP_ROUND</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_SINHALESE</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_HAS_VERTICAL">FT_HAS_VERTICAL</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_LineCap">FT_STROKER_LINECAP_SQUARE</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_SLAVIC</a></td></tr>
-<tr><td><a href="ft2-type1_tables.html#FT_Has_PS_Glyph_Names">FT_Has_PS_Glyph_Names</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_LineJoin">FT_STROKER_LINEJOIN_BEVEL</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_TAMIL</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_IMAGE_H">FT_IMAGE_H</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_LineJoin">FT_STROKER_LINEJOIN_MITER</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_TELUGU</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_IMAGE_TAG">FT_IMAGE_TAG</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_LineJoin">FT_STROKER_LINEJOIN_MITER_FIXED</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_THAI</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_INCREMENTAL_H">FT_INCREMENTAL_H</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_LineJoin">FT_STROKER_LINEJOIN_MITER_VARIABLE</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_TIBETAN</a></td></tr>
-<tr><td><a href="ft2-incremental.html#FT_Incremental">FT_Incremental</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_LineJoin">FT_STROKER_LINEJOIN_ROUND</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_TRADITIONAL_CHINESE</a></td></tr>
-<tr><td><a href="ft2-incremental.html#FT_Incremental_FreeGlyphDataFunc">FT_Incremental_FreeGlyphDataFunc</a></td><td><a href="ft2-base_interface.html#FT_STYLE_FLAG_XXX">FT_STYLE_FLAG_BOLD</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_UNINTERP</a></td></tr>
-<tr><td><a href="ft2-incremental.html#FT_Incremental_FuncsRec">FT_Incremental_FuncsRec</a></td><td><a href="ft2-base_interface.html#FT_STYLE_FLAG_XXX">FT_STYLE_FLAG_ITALIC</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_VIETNAMESE</a></td></tr>
-<tr><td><a href="ft2-incremental.html#FT_Incremental_GetGlyphDataFunc">FT_Incremental_GetGlyphDataFunc</a></td><td><a href="ft2-base_interface.html#FT_STYLE_FLAG_XXX">FT_STYLE_FLAG_XXX</a></td><td><a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_XXX</a></td></tr>
-<tr><td><a href="ft2-incremental.html#FT_Incremental_GetGlyphMetricsFunc">FT_Incremental_GetGlyphMetricsFunc</a></td><td><a href="ft2-system_interface.html#FT_Stream">FT_Stream</a></td><td><a href="ft2-truetype_tables.html#TT_MaxProfile">TT_MaxProfile</a></td></tr>
-<tr><td><a href="ft2-incremental.html#FT_Incremental_Interface">FT_Incremental_Interface</a></td><td><a href="ft2-system_interface.html#FT_Stream_CloseFunc">FT_Stream_CloseFunc</a></td><td><a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_BIG_5</a></td></tr>
-<tr><td><a href="ft2-incremental.html#FT_Incremental_InterfaceRec">FT_Incremental_InterfaceRec</a></td><td><a href="ft2-system_interface.html#FT_Stream_IoFunc">FT_Stream_IoFunc</a></td><td><a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_GB2312</a></td></tr>
-<tr><td><a href="ft2-incremental.html#FT_Incremental_Metrics">FT_Incremental_Metrics</a></td><td><a href="ft2-bzip2.html#FT_Stream_OpenBzip2">FT_Stream_OpenBzip2</a></td><td><a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_JOHAB</a></td></tr>
-<tr><td><a href="ft2-incremental.html#FT_Incremental_MetricsRec">FT_Incremental_MetricsRec</a></td><td><a href="ft2-gzip.html#FT_Stream_OpenGzip">FT_Stream_OpenGzip</a></td><td><a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_SJIS</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Init_FreeType">FT_Init_FreeType</a></td><td><a href="ft2-lzw.html#FT_Stream_OpenLZW">FT_Stream_OpenLZW</a></td><td><a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_SYMBOL_CS</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Int">FT_Int</a></td><td><a href="ft2-system_interface.html#FT_StreamDesc">FT_StreamDesc</a></td><td><a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_UCS_4</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Int16">FT_Int16</a></td><td><a href="ft2-system_interface.html#FT_StreamRec">FT_StreamRec</a></td><td><a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_UNICODE_CS</a></td></tr>
-<tr><td><a href="ft2-basic_types.html#FT_Int32">FT_Int32</a></td><td><a href="ft2-basic_types.html#FT_String">FT_String</a></td><td><a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_WANSUNG</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_IS_CID_KEYED">FT_IS_CID_KEYED</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker">FT_Stroker</a></td><td><a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_XXX</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_IS_FIXED_WIDTH">FT_IS_FIXED_WIDTH</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_BeginSubPath">FT_Stroker_BeginSubPath</a></td><td><a href="ft2-truetype_tables.html#TT_OS2">TT_OS2</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_IS_SCALABLE">FT_IS_SCALABLE</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_ConicTo">FT_Stroker_ConicTo</a></td><td><a href="ft2-truetype_tables.html#TT_PCLT">TT_PCLT</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_IS_SFNT">FT_IS_SFNT</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_CubicTo">FT_Stroker_CubicTo</a></td><td><a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_ADOBE</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_IS_TRICKY">FT_IS_TRICKY</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_Done">FT_Stroker_Done</a></td><td><a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_APPLE_UNICODE</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Kerning_Mode">FT_KERNING_DEFAULT</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_EndSubPath">FT_Stroker_EndSubPath</a></td><td><a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_CUSTOM</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Kerning_Mode">FT_KERNING_UNFITTED</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_Export">FT_Stroker_Export</a></td><td><a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_ISO</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Kerning_Mode">FT_KERNING_UNSCALED</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_ExportBorder">FT_Stroker_ExportBorder</a></td><td><a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_MACINTOSH</a></td></tr>
-<tr><td><a href="ft2-base_interface.html#FT_Kerning_Mode">FT_Kerning_Mode</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_GetBorderCounts">FT_Stroker_GetBorderCounts</a></td><td><a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_MICROSOFT</a></td></tr>
-<tr><td><a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_DEFAULT</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_GetCounts">FT_Stroker_GetCounts</a></td><td><a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_XXX</a></td></tr>
-<tr><td><a href="ft2-header_file_macros.html#FT_LCD_FILTER_H">FT_LCD_FILTER_H</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_LineCap">FT_Stroker_LineCap</a></td><td><a href="ft2-truetype_tables.html#TT_Postscript">TT_Postscript</a></td></tr>
-<tr><td><a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_LEGACY</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_LineJoin">FT_Stroker_LineJoin</a></td><td><a href="ft2-truetype_tables.html#TT_VertHeader">TT_VertHeader</a></td></tr>
-<tr><td><a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_LIGHT</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_LineTo">FT_Stroker_LineTo</a></td><td></td></tr>
-<tr><td><a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_NONE</a></td><td><a href="ft2-glyph_stroker.html#FT_Stroker_New">FT_Stroker_New</a></td><td></td></tr>
-</table>
-<hr>
-<table><tr><td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<center><font size=-2>generated on Thu Mar  8 21:09:06 2012</font></center></body>
-</html>
diff --git a/docs/reference/ft2-lcd_filtering.html b/docs/reference/ft2-lcd_filtering.html
deleted file mode 100644 (file)
index 3e88ceb..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-LCD Filtering
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_LcdFilter">FT_LcdFilter</a></td><td></td><td><a href="#FT_Library_SetLcdFilterWeights">FT_Library_SetLcdFilterWeights</a></td></tr>
-<tr><td></td><td><a href="#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>The <a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a> API can be used to specify a low-pass filter which is then applied to LCD-optimized bitmaps generated through <a href="ft2-base_interface.html#FT_Render_Glyph">FT_Render_Glyph</a>. This is useful to reduce color fringes which would occur with unfiltered rendering.</p>
-<p>Note that no filter is active by default, and that this function is <b>not</b> implemented in default builds of the library. You need to #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your &lsquo;ftoption.h&rsquo; file in order to activate it.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_LcdFilter">FT_LcdFilter</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_LcdFilter_
-  {
-    <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_NONE</a>    = 0,
-    <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_DEFAULT</a> = 1,
-    <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_LIGHT</a>   = 2,
-    <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_LEGACY</a>  = 16,
-
-    FT_LCD_FILTER_MAX   /* do not remove */
-
-  } <b>FT_LcdFilter</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of values to identify various types of LCD filters.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_LCD_FILTER_NONE</b></td><td>
-<p>Do not perform filtering. When used with subpixel rendering, this results in sometimes severe color fringes.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LCD_FILTER_DEFAULT</b></td><td>
-<p>The default filter reduces color fringes considerably, at the cost of a slight blurriness in the output.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LCD_FILTER_LIGHT</b></td><td>
-<p>The light filter is a variant that produces less blurriness at the cost of slightly more color fringes than the default one. It might be better, depending on taste, your monitor, or your personal vision.</p>
-</td></tr>
-<tr valign=top><td><b>FT_LCD_FILTER_LEGACY</b></td><td>
-<p>This filter corresponds to the original libXft color filter. It provides high contrast output but can exhibit really bad color fringes if glyphs are not extremely well hinted to the pixel grid. In other words, it only works well if the TrueType bytecode interpreter is enabled <b>and</b> high-quality hinted fonts are used.</p>
-<p>This filter is only provided for comparison purposes, and might be disabled or stay unsupported in the future.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.0</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Library_SetLcdFilter</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>    library,
-                           <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LcdFilter</a>  filter );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This function is used to apply color filtering to LCD decimated bitmaps, like the ones used when calling <a href="ft2-base_interface.html#FT_Render_Glyph">FT_Render_Glyph</a> with <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LCD</a> or <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LCD_V</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the target library instance.</p>
-</td></tr>
-<tr valign=top><td><b>filter</b></td><td>
-<p>The filter type.</p>
-<p>You can use <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_NONE</a> here to disable this feature, or <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_DEFAULT</a> to use a default filter that should work well on most LCD screens.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This feature is always disabled by default. Clients must make an explicit call to this function with a &lsquo;filter&rsquo; value other than <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_NONE</a> in order to enable it.</p>
-<p>Due to <b>PATENTS</b> covering subpixel rendering, this function doesn't do anything except returning &lsquo;FT_Err_Unimplemented_Feature&rsquo; if the configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not defined in your build of the library, which should correspond to all default builds of FreeType.</p>
-<p>The filter affects glyph bitmaps rendered through <a href="ft2-base_interface.html#FT_Render_Glyph">FT_Render_Glyph</a>, <a href="ft2-outline_processing.html#FT_Outline_Get_Bitmap">FT_Outline_Get_Bitmap</a>, <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a>, and <a href="ft2-base_interface.html#FT_Load_Char">FT_Load_Char</a>.</p>
-<p>It does <i>not</i> affect the output of <a href="ft2-outline_processing.html#FT_Outline_Render">FT_Outline_Render</a> and <a href="ft2-outline_processing.html#FT_Outline_Get_Bitmap">FT_Outline_Get_Bitmap</a>.</p>
-<p>If this feature is activated, the dimensions of LCD glyph bitmaps are either larger or taller than the dimensions of the corresponding outline with regards to the pixel grid. For example, for <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LCD</a>, the filter adds up to 3&nbsp;pixels to the left, and up to 3&nbsp;pixels to the right.</p>
-<p>The bitmap offset values are adjusted correctly, so clients shouldn't need to modify their layout and glyph positioning code when enabling the filter.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.0</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Library_SetLcdFilterWeights">FT_Library_SetLcdFilterWeights</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Library_SetLcdFilterWeights</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>      library,
-                                  <span class="keyword">unsigned</span> <span class="keyword">char</span>  *weights );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Use this function to override the filter weights selected by <a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a>. By default, FreeType uses the quintuple (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10, 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and FT_LCD_FILTER_LEGACY.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the target library instance.</p>
-</td></tr>
-<tr valign=top><td><b>weights</b></td><td>
-<p>A pointer to an array; the function copies the first five bytes and uses them to specify the filter weights.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Due to <b>PATENTS</b> covering subpixel rendering, this function doesn't do anything except returning &lsquo;FT_Err_Unimplemented_Feature&rsquo; if the configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not defined in your build of the library, which should correspond to all default builds of FreeType.</p>
-<p>This function must be called after <a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a> to have any effect.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.4.0</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-list_processing.html b/docs/reference/ft2-list_processing.html
deleted file mode 100644 (file)
index 6b4dc31..0000000
+++ /dev/null
@@ -1,486 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-List Processing
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_List">FT_List</a></td><td></td><td><a href="#FT_List_Add">FT_List_Add</a></td><td></td><td><a href="#FT_List_Iterate">FT_List_Iterate</a></td></tr>
-<tr><td></td><td><a href="#FT_ListNode">FT_ListNode</a></td><td></td><td><a href="#FT_List_Insert">FT_List_Insert</a></td><td></td><td><a href="#FT_List_Destructor">FT_List_Destructor</a></td></tr>
-<tr><td></td><td><a href="#FT_ListRec">FT_ListRec</a></td><td></td><td><a href="#FT_List_Remove">FT_List_Remove</a></td><td></td><td><a href="#FT_List_Finalize">FT_List_Finalize</a></td></tr>
-<tr><td></td><td><a href="#FT_ListNodeRec">FT_ListNodeRec</a></td><td></td><td><a href="#FT_List_Up">FT_List_Up</a></td><td></td><td></td></tr>
-<tr><td></td><td><a href="#FT_List_Find">FT_List_Find</a></td><td></td><td><a href="#FT_List_Iterator">FT_List_Iterator</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains various definitions related to list processing using doubly-linked nodes.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_List">FT_List</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_ListRec_*  <b>FT_List</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a list record (see <a href="ft2-list_processing.html#FT_ListRec">FT_ListRec</a>).</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_ListNode">FT_ListNode</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_ListNodeRec_*  <b>FT_ListNode</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Many elements and objects in FreeType are listed through an <a href="ft2-list_processing.html#FT_List">FT_List</a> record (see <a href="ft2-list_processing.html#FT_ListRec">FT_ListRec</a>). As its name suggests, an FT_ListNode is a handle to a single list element.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_ListRec">FT_ListRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_ListRec_
-  {
-    <a href="ft2-list_processing.html#FT_ListNode">FT_ListNode</a>  head;
-    <a href="ft2-list_processing.html#FT_ListNode">FT_ListNode</a>  tail;
-
-  } <b>FT_ListRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to hold a simple doubly-linked list. These are used in many parts of FreeType.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>head</b></td><td>
-<p>The head (first element) of doubly-linked list.</p>
-</td></tr>
-<tr valign=top><td><b>tail</b></td><td>
-<p>The tail (last element) of doubly-linked list.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_ListNodeRec">FT_ListNodeRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPES_H (freetype/fttypes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_ListNodeRec_
-  {
-    <a href="ft2-list_processing.html#FT_ListNode">FT_ListNode</a>  prev;
-    <a href="ft2-list_processing.html#FT_ListNode">FT_ListNode</a>  next;
-    <span class="keyword">void</span>*        data;
-
-  } <b>FT_ListNodeRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to hold a single list element.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>prev</b></td><td>
-<p>The previous element in the list. NULL if first.</p>
-</td></tr>
-<tr valign=top><td><b>next</b></td><td>
-<p>The next element in the list. NULL if last.</p>
-</td></tr>
-<tr valign=top><td><b>data</b></td><td>
-<p>A typeless pointer to the listed object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_List_Find">FT_List_Find</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LIST_H (freetype/ftlist.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-list_processing.html#FT_ListNode">FT_ListNode</a> )
-  <b>FT_List_Find</b>( <a href="ft2-list_processing.html#FT_List">FT_List</a>  list,
-                <span class="keyword">void</span>*    data );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Find the list node for a given listed object.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>list</b></td><td>
-<p>A pointer to the parent list.</p>
-</td></tr>
-<tr valign=top><td><b>data</b></td><td>
-<p>The address of the listed object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>List node. NULL if it wasn't found.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_List_Add">FT_List_Add</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LIST_H (freetype/ftlist.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_List_Add</b>( <a href="ft2-list_processing.html#FT_List">FT_List</a>      list,
-               <a href="ft2-list_processing.html#FT_ListNode">FT_ListNode</a>  node );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Append an element to the end of a list.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>list</b></td><td>
-<p>A pointer to the parent list.</p>
-</td></tr>
-<tr valign=top><td><b>node</b></td><td>
-<p>The node to append.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_List_Insert">FT_List_Insert</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LIST_H (freetype/ftlist.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_List_Insert</b>( <a href="ft2-list_processing.html#FT_List">FT_List</a>      list,
-                  <a href="ft2-list_processing.html#FT_ListNode">FT_ListNode</a>  node );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Insert an element at the head of a list.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>list</b></td><td>
-<p>A pointer to parent list.</p>
-</td></tr>
-<tr valign=top><td><b>node</b></td><td>
-<p>The node to insert.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_List_Remove">FT_List_Remove</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LIST_H (freetype/ftlist.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_List_Remove</b>( <a href="ft2-list_processing.html#FT_List">FT_List</a>      list,
-                  <a href="ft2-list_processing.html#FT_ListNode">FT_ListNode</a>  node );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Remove a node from a list. This function doesn't check whether the node is in the list!</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>node</b></td><td>
-<p>The node to remove.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>list</b></td><td>
-<p>A pointer to the parent list.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_List_Up">FT_List_Up</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LIST_H (freetype/ftlist.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_List_Up</b>( <a href="ft2-list_processing.html#FT_List">FT_List</a>      list,
-              <a href="ft2-list_processing.html#FT_ListNode">FT_ListNode</a>  node );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Move a node to the head/top of a list. Used to maintain LRU lists.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>list</b></td><td>
-<p>A pointer to the parent list.</p>
-</td></tr>
-<tr valign=top><td><b>node</b></td><td>
-<p>The node to move.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_List_Iterator">FT_List_Iterator</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LIST_H (freetype/ftlist.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_Error">FT_Error</a>
-  (*<b>FT_List_Iterator</b>)( <a href="ft2-list_processing.html#FT_ListNode">FT_ListNode</a>  node,
-                       <span class="keyword">void</span>*        user );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An FT_List iterator function which is called during a list parse by <a href="ft2-list_processing.html#FT_List_Iterate">FT_List_Iterate</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>node</b></td><td>
-<p>The current iteration list node.</p>
-</td></tr>
-<tr valign=top><td><b>user</b></td><td>
-<p>A typeless pointer passed to <a href="ft2-list_processing.html#FT_List_Iterate">FT_List_Iterate</a>. Can be used to point to the iteration's state.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_List_Iterate">FT_List_Iterate</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LIST_H (freetype/ftlist.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_List_Iterate</b>( <a href="ft2-list_processing.html#FT_List">FT_List</a>           list,
-                   <a href="ft2-list_processing.html#FT_List_Iterator">FT_List_Iterator</a>  iterator,
-                   <span class="keyword">void</span>*             user );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Parse a list and calls a given iterator function on each element. Note that parsing is stopped as soon as one of the iterator calls returns a non-zero value.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>list</b></td><td>
-<p>A handle to the list.</p>
-</td></tr>
-<tr valign=top><td><b>iterator</b></td><td>
-<p>An iterator function, called on each node of the list.</p>
-</td></tr>
-<tr valign=top><td><b>user</b></td><td>
-<p>A user-supplied field which is passed as the second argument to the iterator.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The result (a FreeType error code) of the last iterator call.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_List_Destructor">FT_List_Destructor</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LIST_H (freetype/ftlist.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">void</span>
-  (*<b>FT_List_Destructor</b>)( <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a>  memory,
-                         <span class="keyword">void</span>*      data,
-                         <span class="keyword">void</span>*      user );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An <a href="ft2-list_processing.html#FT_List">FT_List</a> iterator function which is called during a list finalization by <a href="ft2-list_processing.html#FT_List_Finalize">FT_List_Finalize</a> to destroy all elements in a given list.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>system</b></td><td>
-<p>The current system object.</p>
-</td></tr>
-<tr valign=top><td><b>data</b></td><td>
-<p>The current object to destroy.</p>
-</td></tr>
-<tr valign=top><td><b>user</b></td><td>
-<p>A typeless pointer passed to <a href="ft2-list_processing.html#FT_List_Iterate">FT_List_Iterate</a>. It can be used to point to the iteration's state.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_List_Finalize">FT_List_Finalize</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LIST_H (freetype/ftlist.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_List_Finalize</b>( <a href="ft2-list_processing.html#FT_List">FT_List</a>             list,
-                    <a href="ft2-list_processing.html#FT_List_Destructor">FT_List_Destructor</a>  destroy,
-                    <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a>           memory,
-                    <span class="keyword">void</span>*               user );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Destroy all elements in the list as well as the list itself.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>list</b></td><td>
-<p>A handle to the list.</p>
-</td></tr>
-<tr valign=top><td><b>destroy</b></td><td>
-<p>A list destructor that will be applied to each element of the list.</p>
-</td></tr>
-<tr valign=top><td><b>memory</b></td><td>
-<p>The current memory object which handles deallocation.</p>
-</td></tr>
-<tr valign=top><td><b>user</b></td><td>
-<p>A user-supplied field which is passed as the last argument to the destructor.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function expects that all nodes added by <a href="ft2-list_processing.html#FT_List_Add">FT_List_Add</a> or <a href="ft2-list_processing.html#FT_List_Insert">FT_List_Insert</a> have been dynamically allocated.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-lzw.html b/docs/reference/ft2-lzw.html
deleted file mode 100644 (file)
index 4300364..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-LZW Streams
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Stream_OpenLZW">FT_Stream_OpenLZW</a></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains the declaration of LZW-specific functions.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stream_OpenLZW">FT_Stream_OpenLZW</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LZW_H (freetype/ftlzw.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Stream_OpenLZW</b>( <a href="ft2-system_interface.html#FT_Stream">FT_Stream</a>  stream,
-                     <a href="ft2-system_interface.html#FT_Stream">FT_Stream</a>  source );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Open a new stream to parse LZW-compressed font files. This is mainly used to support the compressed &lsquo;*.pcf.Z&rsquo; fonts that come with XFree86.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stream</b></td><td>
-<p>The target embedding stream.</p>
-</td></tr>
-<tr valign=top><td><b>source</b></td><td>
-<p>The source stream.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The source stream must be opened <i>before</i> calling this function.</p>
-<p>Calling the internal function &lsquo;FT_Stream_Close&rsquo; on the new stream will <b>not</b> call &lsquo;FT_Stream_Close&rsquo; on the source stream. None of the stream objects will be released to the heap.</p>
-<p>The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream</p>
-<p>In certain builds of the library, LZW compression recognition is automatically handled when calling <a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a> or <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a>. This means that if no font driver is capable of handling the raw compressed file, the library will try to open a LZW stream from it and re-open the face with it.</p>
-<p>This function may return &lsquo;FT_Err_Unimplemented_Feature&rsquo; if your build of FreeType was not compiled with LZW support.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-mac_specific.html b/docs/reference/ft2-mac_specific.html
deleted file mode 100644 (file)
index 2b862ad..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Mac Specific Interface
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_New_Face_From_FOND">FT_New_Face_From_FOND</a></td><td></td><td><a href="#FT_GetFilePath_From_Mac_ATS_Name">FT_GetFilePath_From_Mac_ATS_Name</a></td></tr>
-<tr><td></td><td><a href="#FT_GetFile_From_Mac_Name">FT_GetFile_From_Mac_Name</a></td><td></td><td><a href="#FT_New_Face_From_FSSpec">FT_New_Face_From_FSSpec</a></td></tr>
-<tr><td></td><td><a href="#FT_GetFile_From_Mac_ATS_Name">FT_GetFile_From_Mac_ATS_Name</a></td><td></td><td><a href="#FT_New_Face_From_FSRef">FT_New_Face_From_FSRef</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>The following definitions are only available if FreeType is compiled on a Macintosh.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_New_Face_From_FOND">FT_New_Face_From_FOND</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MAC_H (freetype/ftmac.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_New_Face_From_FOND</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library,
-                         Handle      fond,
-                         <a href="ft2-basic_types.html#FT_Long">FT_Long</a>     face_index,
-                         <a href="ft2-base_interface.html#FT_Face">FT_Face</a>    *aface )
-                       FT_DEPRECATED_ATTRIBUTE;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Create a new face object from a FOND resource.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the library resource.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>fond</b></td><td>
-<p>A FOND resource.</p>
-</td></tr>
-<tr valign=top><td><b>face_index</b></td><td>
-<p>Only supported for the -1 &lsquo;sanity check&rsquo; special case.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aface</b></td><td>
-<p>A handle to a new face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>notes</b></em></td></tr><tr><td>
-<p>This function can be used to create <a href="ft2-base_interface.html#FT_Face">FT_Face</a> objects from fonts that are installed in the system as follows.</p>
-<pre class="colored">
-  fond = GetResource( 'FOND', fontName );                          
-  error = FT_New_Face_From_FOND( library, fond, 0, &amp;face );        
-</pre>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_GetFile_From_Mac_Name">FT_GetFile_From_Mac_Name</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MAC_H (freetype/ftmac.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_GetFile_From_Mac_Name</b>( <span class="keyword">const</span> <span class="keyword">char</span>*  fontName,
-                            FSSpec*      pathSpec,
-                            <a href="ft2-basic_types.html#FT_Long">FT_Long</a>*     face_index )
-                          FT_DEPRECATED_ATTRIBUTE;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return an FSSpec for the disk file containing the named font.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>fontName</b></td><td>
-<p>Mac OS name of the font (e.g., Times New Roman Bold).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>pathSpec</b></td><td>
-<p>FSSpec to the file. For passing to <a href="ft2-mac_specific.html#FT_New_Face_From_FSSpec">FT_New_Face_From_FSSpec</a>.</p>
-</td></tr>
-<tr valign=top><td><b>face_index</b></td><td>
-<p>Index of the face. For passing to <a href="ft2-mac_specific.html#FT_New_Face_From_FSSpec">FT_New_Face_From_FSSpec</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_GetFile_From_Mac_ATS_Name">FT_GetFile_From_Mac_ATS_Name</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MAC_H (freetype/ftmac.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_GetFile_From_Mac_ATS_Name</b>( <span class="keyword">const</span> <span class="keyword">char</span>*  fontName,
-                                FSSpec*      pathSpec,
-                                <a href="ft2-basic_types.html#FT_Long">FT_Long</a>*     face_index )
-                              FT_DEPRECATED_ATTRIBUTE;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return an FSSpec for the disk file containing the named font.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>fontName</b></td><td>
-<p>Mac OS name of the font in ATS framework.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>pathSpec</b></td><td>
-<p>FSSpec to the file. For passing to <a href="ft2-mac_specific.html#FT_New_Face_From_FSSpec">FT_New_Face_From_FSSpec</a>.</p>
-</td></tr>
-<tr valign=top><td><b>face_index</b></td><td>
-<p>Index of the face. For passing to <a href="ft2-mac_specific.html#FT_New_Face_From_FSSpec">FT_New_Face_From_FSSpec</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_GetFilePath_From_Mac_ATS_Name">FT_GetFilePath_From_Mac_ATS_Name</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MAC_H (freetype/ftmac.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_GetFilePath_From_Mac_ATS_Name</b>( <span class="keyword">const</span> <span class="keyword">char</span>*  fontName,
-                                    UInt8*       path,
-                                    UInt32       maxPathSize,
-                                    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>*     face_index )
-                                  FT_DEPRECATED_ATTRIBUTE;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return a pathname of the disk file and face index for given font name which is handled by ATS framework.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>fontName</b></td><td>
-<p>Mac OS name of the font in ATS framework.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>path</b></td><td>
-<p>Buffer to store pathname of the file. For passing to <a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a>. The client must allocate this buffer before calling this function.</p>
-</td></tr>
-<tr valign=top><td><b>maxPathSize</b></td><td>
-<p>Lengths of the buffer &lsquo;path&rsquo; that client allocated.</p>
-</td></tr>
-<tr valign=top><td><b>face_index</b></td><td>
-<p>Index of the face. For passing to <a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_New_Face_From_FSSpec">FT_New_Face_From_FSSpec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MAC_H (freetype/ftmac.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_New_Face_From_FSSpec</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>     library,
-                           <span class="keyword">const</span> FSSpec  *spec,
-                           <a href="ft2-basic_types.html#FT_Long">FT_Long</a>        face_index,
-                           <a href="ft2-base_interface.html#FT_Face">FT_Face</a>       *aface )
-                         FT_DEPRECATED_ATTRIBUTE;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Create a new face object from a given resource and typeface index using an FSSpec to the font file.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the library resource.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>spec</b></td><td>
-<p>FSSpec to the font file.</p>
-</td></tr>
-<tr valign=top><td><b>face_index</b></td><td>
-<p>The index of the face within the resource. The first face has index&nbsp;0.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aface</b></td><td>
-<p>A handle to a new face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p><a href="ft2-mac_specific.html#FT_New_Face_From_FSSpec">FT_New_Face_From_FSSpec</a> is identical to <a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a> except it accepts an FSSpec instead of a path.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_New_Face_From_FSRef">FT_New_Face_From_FSRef</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MAC_H (freetype/ftmac.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_New_Face_From_FSRef</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>    library,
-                          <span class="keyword">const</span> FSRef  *ref,
-                          <a href="ft2-basic_types.html#FT_Long">FT_Long</a>       face_index,
-                          <a href="ft2-base_interface.html#FT_Face">FT_Face</a>      *aface )
-                        FT_DEPRECATED_ATTRIBUTE;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Create a new face object from a given resource and typeface index using an FSRef to the font file.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the library resource.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>spec</b></td><td>
-<p>FSRef to the font file.</p>
-</td></tr>
-<tr valign=top><td><b>face_index</b></td><td>
-<p>The index of the face within the resource. The first face has index&nbsp;0.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aface</b></td><td>
-<p>A handle to a new face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p><a href="ft2-mac_specific.html#FT_New_Face_From_FSRef">FT_New_Face_From_FSRef</a> is identical to <a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a> except it accepts an FSRef instead of a path.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-module_management.html b/docs/reference/ft2-module_management.html
deleted file mode 100644 (file)
index da119b6..0000000
+++ /dev/null
@@ -1,667 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Module Management
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Module_Constructor">FT_Module_Constructor</a></td><td></td><td><a href="#FT_Get_Module">FT_Get_Module</a></td><td></td><td><a href="#FT_Set_Debug_Hook">FT_Set_Debug_Hook</a></td></tr>
-<tr><td></td><td><a href="#FT_Module_Destructor">FT_Module_Destructor</a></td><td></td><td><a href="#FT_Remove_Module">FT_Remove_Module</a></td><td></td><td><a href="#FT_Add_Default_Modules">FT_Add_Default_Modules</a></td></tr>
-<tr><td></td><td><a href="#FT_Module_Requester">FT_Module_Requester</a></td><td></td><td><a href="#FT_Reference_Library">FT_Reference_Library</a></td><td></td><td><a href="#FT_Renderer_Class">FT_Renderer_Class</a></td></tr>
-<tr><td></td><td><a href="#FT_Module_Class">FT_Module_Class</a></td><td></td><td><a href="#FT_New_Library">FT_New_Library</a></td><td></td><td><a href="#FT_Get_Renderer">FT_Get_Renderer</a></td></tr>
-<tr><td></td><td><a href="#FT_Add_Module">FT_Add_Module</a></td><td></td><td><a href="#FT_Done_Library">FT_Done_Library</a></td><td></td><td><a href="#FT_Set_Renderer">FT_Set_Renderer</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>The definitions below are used to manage modules within FreeType. Modules can be added, upgraded, and removed at runtime.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Module_Constructor">FT_Module_Constructor</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MODULE_H (freetype/ftmodapi.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_Error">FT_Error</a>
-  (*<b>FT_Module_Constructor</b>)( <a href="ft2-base_interface.html#FT_Module">FT_Module</a>  module );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to initialize (not create) a new module object.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>module</b></td><td>
-<p>The module to initialize.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Module_Destructor">FT_Module_Destructor</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MODULE_H (freetype/ftmodapi.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">void</span>
-  (*<b>FT_Module_Destructor</b>)( <a href="ft2-base_interface.html#FT_Module">FT_Module</a>  module );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to finalize (not destroy) a given module object.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>module</b></td><td>
-<p>The module to finalize.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Module_Requester">FT_Module_Requester</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MODULE_H (freetype/ftmodapi.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> FT_Module_Interface
-  (*<b>FT_Module_Requester</b>)( <a href="ft2-base_interface.html#FT_Module">FT_Module</a>    module,
-                          <span class="keyword">const</span> <span class="keyword">char</span>*  name );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to query a given module for a specific interface.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>module</b></td><td>
-<p>The module to finalize.</p>
-</td></tr>
-<tr valign=top><td><b>name</b></td><td>
-<p>The name of the interface in the module.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Module_Class">FT_Module_Class</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MODULE_H (freetype/ftmodapi.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Module_Class_
-  {
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>               module_flags;
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>                module_size;
-    <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_String">FT_String</a>*       module_name;
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>               module_version;
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>               module_requires;
-
-    <span class="keyword">const</span> <span class="keyword">void</span>*            module_interface;
-
-    <a href="ft2-module_management.html#FT_Module_Constructor">FT_Module_Constructor</a>  module_init;
-    <a href="ft2-module_management.html#FT_Module_Destructor">FT_Module_Destructor</a>   module_done;
-    <a href="ft2-module_management.html#FT_Module_Requester">FT_Module_Requester</a>    get_interface;
-
-  } <b>FT_Module_Class</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>The module class descriptor.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>module_flags</b></td><td>
-<p>Bit flags describing the module.</p>
-</td></tr>
-<tr valign=top><td><b>module_size</b></td><td>
-<p>The size of one module object/instance in bytes.</p>
-</td></tr>
-<tr valign=top><td><b>module_name</b></td><td>
-<p>The name of the module.</p>
-</td></tr>
-<tr valign=top><td><b>module_version</b></td><td>
-<p>The version, as a 16.16 fixed number (major.minor).</p>
-</td></tr>
-<tr valign=top><td><b>module_requires</b></td><td>
-<p>The version of FreeType this module requires, as a 16.16 fixed number (major.minor). Starts at version 2.0, i.e., 0x20000.</p>
-</td></tr>
-<tr valign=top><td><b>module_init</b></td><td>
-<p>The initializing function.</p>
-</td></tr>
-<tr valign=top><td><b>module_done</b></td><td>
-<p>The finalizing function.</p>
-</td></tr>
-<tr valign=top><td><b>get_interface</b></td><td>
-<p>The interface requesting function.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Add_Module">FT_Add_Module</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MODULE_H (freetype/ftmodapi.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Add_Module</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>              library,
-                 <span class="keyword">const</span> <a href="ft2-module_management.html#FT_Module_Class">FT_Module_Class</a>*  clazz );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Add a new module to a given library instance.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the library object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>clazz</b></td><td>
-<p>A pointer to class descriptor for the module.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>An error will be returned if a module already exists by that name, or if the module requires a version of FreeType that is too great.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Module">FT_Get_Module</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MODULE_H (freetype/ftmodapi.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-base_interface.html#FT_Module">FT_Module</a> )
-  <b>FT_Get_Module</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>   library,
-                 <span class="keyword">const</span> <span class="keyword">char</span>*  module_name );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Find a module by its name.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the library object.</p>
-</td></tr>
-<tr valign=top><td><b>module_name</b></td><td>
-<p>The module's name (as an ASCII string).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>A module handle. 0&nbsp;if none was found.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>FreeType's internal modules aren't documented very well, and you should look up the source code for details.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Remove_Module">FT_Remove_Module</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MODULE_H (freetype/ftmodapi.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Remove_Module</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library,
-                    <a href="ft2-base_interface.html#FT_Module">FT_Module</a>   module );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Remove a given module from a library instance.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to a library object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>module</b></td><td>
-<p>A handle to a module object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The module object is destroyed by the function in case of success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Reference_Library">FT_Reference_Library</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MODULE_H (freetype/ftmodapi.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Reference_Library</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A counter gets initialized to&nbsp;1 at the time an <a href="ft2-base_interface.html#FT_Library">FT_Library</a> structure is created. This function increments the counter. <a href="ft2-module_management.html#FT_Done_Library">FT_Done_Library</a> then only destroys a library if the counter is&nbsp;1, otherwise it simply decrements the counter.</p>
-<p>This function helps in managing life-cycles of structures which reference <a href="ft2-base_interface.html#FT_Library">FT_Library</a> objects.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to a target library object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.4.2</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_New_Library">FT_New_Library</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MODULE_H (freetype/ftmodapi.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_New_Library</b>( <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a>    memory,
-                  <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  *alibrary );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This function is used to create a new FreeType library instance from a given memory object. It is thus possible to use libraries with distinct memory allocators within the same program.</p>
-<p>Normally, you would call this function (followed by a call to <a href="ft2-module_management.html#FT_Add_Default_Modules">FT_Add_Default_Modules</a> or a series of calls to <a href="ft2-module_management.html#FT_Add_Module">FT_Add_Module</a>) instead of <a href="ft2-base_interface.html#FT_Init_FreeType">FT_Init_FreeType</a> to initialize the FreeType library.</p>
-<p>Don't use <a href="ft2-base_interface.html#FT_Done_FreeType">FT_Done_FreeType</a> but <a href="ft2-module_management.html#FT_Done_Library">FT_Done_Library</a> to destroy a library instance.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>memory</b></td><td>
-<p>A handle to the original memory object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>alibrary</b></td><td>
-<p>A pointer to handle of a new library object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>See the discussion of reference counters in the description of <a href="ft2-module_management.html#FT_Reference_Library">FT_Reference_Library</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Done_Library">FT_Done_Library</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MODULE_H (freetype/ftmodapi.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Done_Library</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Discard a given library object. This closes all drivers and discards all resource objects.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the target library.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>See the discussion of reference counters in the description of <a href="ft2-module_management.html#FT_Reference_Library">FT_Reference_Library</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Set_Debug_Hook">FT_Set_Debug_Hook</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MODULE_H (freetype/ftmodapi.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Set_Debug_Hook</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>         library,
-                     <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>            hook_index,
-                     FT_DebugHook_Func  debug_hook );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Set a debug hook function for debugging the interpreter of a font format.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the library object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>hook_index</b></td><td>
-<p>The index of the debug hook. You should use the values defined in &lsquo;ftobjs.h&rsquo;, e.g., &lsquo;FT_DEBUG_HOOK_TRUETYPE&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>debug_hook</b></td><td>
-<p>The function used to debug the interpreter.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Currently, four debug hook slots are available, but only two (for the TrueType and the Type&nbsp;1 interpreter) are defined.</p>
-<p>Since the internal headers of FreeType are no longer installed, the symbol &lsquo;FT_DEBUG_HOOK_TRUETYPE&rsquo; isn't available publicly. This is a bug and will be fixed in a forthcoming release.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Add_Default_Modules">FT_Add_Default_Modules</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MODULE_H (freetype/ftmodapi.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Add_Default_Modules</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Add the set of default drivers to a given library object. This is only useful when you create a library object with <a href="ft2-module_management.html#FT_New_Library">FT_New_Library</a> (usually to plug a custom memory manager).</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to a new library object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Renderer_Class">FT_Renderer_Class</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_RENDER_H (freetype/ftrender.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Renderer_Class_
-  {
-    <a href="ft2-module_management.html#FT_Module_Class">FT_Module_Class</a>            root;
-
-    <a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a>            glyph_format;
-
-    FT_Renderer_RenderFunc     render_glyph;
-    FT_Renderer_TransformFunc  transform_glyph;
-    FT_Renderer_GetCBoxFunc    get_glyph_cbox;
-    FT_Renderer_SetModeFunc    set_mode;
-
-    <a href="ft2-raster.html#FT_Raster_Funcs">FT_Raster_Funcs</a>*           raster_class;
-
-  } <b>FT_Renderer_Class</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>The renderer module class descriptor.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>root</b></td><td>
-<p>The root <a href="ft2-module_management.html#FT_Module_Class">FT_Module_Class</a> fields.</p>
-</td></tr>
-<tr valign=top><td><b>glyph_format</b></td><td>
-<p>The glyph image format this renderer handles.</p>
-</td></tr>
-<tr valign=top><td><b>render_glyph</b></td><td>
-<p>A method used to render the image that is in a given glyph slot into a bitmap.</p>
-</td></tr>
-<tr valign=top><td><b>transform_glyph</b></td><td>
-<p>A method used to transform the image that is in a given glyph slot.</p>
-</td></tr>
-<tr valign=top><td><b>get_glyph_cbox</b></td><td>
-<p>A method used to access the glyph's cbox.</p>
-</td></tr>
-<tr valign=top><td><b>set_mode</b></td><td>
-<p>A method used to pass additional parameters.</p>
-</td></tr>
-<tr valign=top><td><b>raster_class</b></td><td>
-<p>For <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_OUTLINE</a> renderers only. This is a pointer to its raster's class.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Renderer">FT_Get_Renderer</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_RENDER_H (freetype/ftrender.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-base_interface.html#FT_Renderer">FT_Renderer</a> )
-  <b>FT_Get_Renderer</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>       library,
-                   <a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a>  format );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the current renderer for a given glyph format.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the library object.</p>
-</td></tr>
-<tr valign=top><td><b>format</b></td><td>
-<p>The glyph format.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>A renderer handle. 0&nbsp;if none found.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>An error will be returned if a module already exists by that name, or if the module requires a version of FreeType that is too great.</p>
-<p>To add a new renderer, simply use <a href="ft2-module_management.html#FT_Add_Module">FT_Add_Module</a>. To retrieve a renderer by its name, use <a href="ft2-module_management.html#FT_Get_Module">FT_Get_Module</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Set_Renderer">FT_Set_Renderer</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_RENDER_H (freetype/ftrender.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Set_Renderer</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>     library,
-                   <a href="ft2-base_interface.html#FT_Renderer">FT_Renderer</a>    renderer,
-                   <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>        num_params,
-                   <a href="ft2-base_interface.html#FT_Parameter">FT_Parameter</a>*  parameters );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Set the current renderer to use, and set additional mode.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the library object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>renderer</b></td><td>
-<p>A handle to the renderer object.</p>
-</td></tr>
-<tr valign=top><td><b>num_params</b></td><td>
-<p>The number of additional parameters.</p>
-</td></tr>
-<tr valign=top><td><b>parameters</b></td><td>
-<p>Additional parameters.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>In case of success, the renderer will be used to convert glyph images in the renderer's known format into bitmaps.</p>
-<p>This doesn't change the current renderer for other formats.</p>
-<p>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 &lsquo;ftraster.c&rsquo; and is undefined by default) accepts a single tag &lsquo;pal5&rsquo; to set its gray palette as a character string with 5&nbsp;elements. Consequently, the third and fourth argument are zero normally.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-multiple_masters.html b/docs/reference/ft2-multiple_masters.html
deleted file mode 100644 (file)
index 3f3ad2e..0000000
+++ /dev/null
@@ -1,511 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Multiple Masters
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_MM_Axis">FT_MM_Axis</a></td><td></td><td><a href="#FT_Get_MM_Var">FT_Get_MM_Var</a></td></tr>
-<tr><td></td><td><a href="#FT_Multi_Master">FT_Multi_Master</a></td><td></td><td><a href="#FT_Set_MM_Design_Coordinates">FT_Set_MM_Design_Coordinates</a></td></tr>
-<tr><td></td><td><a href="#FT_Var_Axis">FT_Var_Axis</a></td><td></td><td><a href="#FT_Set_Var_Design_Coordinates">FT_Set_Var_Design_Coordinates</a></td></tr>
-<tr><td></td><td><a href="#FT_Var_Named_Style">FT_Var_Named_Style</a></td><td></td><td><a href="#FT_Set_MM_Blend_Coordinates">FT_Set_MM_Blend_Coordinates</a></td></tr>
-<tr><td></td><td><a href="#FT_MM_Var">FT_MM_Var</a></td><td></td><td><a href="#FT_Set_Var_Blend_Coordinates">FT_Set_Var_Blend_Coordinates</a></td></tr>
-<tr><td></td><td><a href="#FT_Get_Multi_Master">FT_Get_Multi_Master</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>The following types and functions are used to manage Multiple Master fonts, i.e., the selection of specific design instances by setting design axis coordinates.</p>
-<p>George Williams has extended this interface to make it work with both Type&nbsp;1 Multiple Masters fonts and GX distortable (var) fonts. Some of these routines only work with MM fonts, others will work with both types. They are similar enough that a consistent interface makes sense.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_MM_Axis">FT_MM_Axis</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_MM_Axis_
-  {
-    <a href="ft2-basic_types.html#FT_String">FT_String</a>*  name;
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>     minimum;
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>     maximum;
-
-  } <b>FT_MM_Axis</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A simple structure used to model a given axis in design space for Multiple Masters fonts.</p>
-<p>This structure can't be used for GX var fonts.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>name</b></td><td>
-<p>The axis's name.</p>
-</td></tr>
-<tr valign=top><td><b>minimum</b></td><td>
-<p>The axis's minimum design coordinate.</p>
-</td></tr>
-<tr valign=top><td><b>maximum</b></td><td>
-<p>The axis's maximum design coordinate.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Multi_Master">FT_Multi_Master</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Multi_Master_
-  {
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     num_axis;
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     num_designs;
-    <a href="ft2-multiple_masters.html#FT_MM_Axis">FT_MM_Axis</a>  axis[T1_MAX_MM_AXIS];
-
-  } <b>FT_Multi_Master</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model the axes and space of a Multiple Masters font.</p>
-<p>This structure can't be used for GX var fonts.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>num_axis</b></td><td>
-<p>Number of axes. Cannot exceed&nbsp;4.</p>
-</td></tr>
-<tr valign=top><td><b>num_designs</b></td><td>
-<p>Number of designs; should be normally 2^num_axis even though the Type&nbsp;1 specification strangely allows for intermediate designs to be present. This number cannot exceed&nbsp;16.</p>
-</td></tr>
-<tr valign=top><td><b>axis</b></td><td>
-<p>A table of axis descriptors.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Var_Axis">FT_Var_Axis</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Var_Axis_
-  {
-    <a href="ft2-basic_types.html#FT_String">FT_String</a>*  name;
-
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>    minimum;
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>    def;
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>    maximum;
-
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>    tag;
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     strid;
-
-  } <b>FT_Var_Axis</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A simple structure used to model a given axis in design space for Multiple Masters and GX var fonts.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>name</b></td><td>
-<p>The axis's name. Not always meaningful for GX.</p>
-</td></tr>
-<tr valign=top><td><b>minimum</b></td><td>
-<p>The axis's minimum design coordinate.</p>
-</td></tr>
-<tr valign=top><td><b>def</b></td><td>
-<p>The axis's default design coordinate. FreeType computes meaningful default values for MM; it is then an integer value, not in 16.16 format.</p>
-</td></tr>
-<tr valign=top><td><b>maximum</b></td><td>
-<p>The axis's maximum design coordinate.</p>
-</td></tr>
-<tr valign=top><td><b>tag</b></td><td>
-<p>The axis's tag (the GX equivalent to &lsquo;name&rsquo;). FreeType provides default values for MM if possible.</p>
-</td></tr>
-<tr valign=top><td><b>strid</b></td><td>
-<p>The entry in &lsquo;name&rsquo; table (another GX version of &lsquo;name&rsquo;). Not meaningful for MM.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Var_Named_Style">FT_Var_Named_Style</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Var_Named_Style_
-  {
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>*  coords;
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>    strid;
-
-  } <b>FT_Var_Named_Style</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A simple structure used to model a named style in a GX var font.</p>
-<p>This structure can't be used for MM fonts.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>coords</b></td><td>
-<p>The design coordinates for this style. This is an array with one entry for each axis.</p>
-</td></tr>
-<tr valign=top><td><b>strid</b></td><td>
-<p>The entry in &lsquo;name&rsquo; table identifying this style.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_MM_Var">FT_MM_Var</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_MM_Var_
-  {
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>              num_axis;
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>              num_designs;
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>              num_namedstyles;
-    <a href="ft2-multiple_masters.html#FT_Var_Axis">FT_Var_Axis</a>*         axis;
-    <a href="ft2-multiple_masters.html#FT_Var_Named_Style">FT_Var_Named_Style</a>*  namedstyle;
-
-  } <b>FT_MM_Var</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model the axes and space of a Multiple Masters or GX var distortable font.</p>
-<p>Some fields are specific to one format and not to the other.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>num_axis</b></td><td>
-<p>The number of axes. The maximum value is&nbsp;4 for MM; no limit in GX.</p>
-</td></tr>
-<tr valign=top><td><b>num_designs</b></td><td>
-<p>The number of designs; should be normally 2^num_axis for MM fonts. Not meaningful for GX (where every glyph could have a different number of designs).</p>
-</td></tr>
-<tr valign=top><td><b>num_namedstyles</b></td><td>
-<p>The number of named styles; only meaningful for GX which allows certain design coordinates to have a string ID (in the &lsquo;name&rsquo; table) associated with them. The font can tell the user that, for example, Weight=1.5 is &lsquo;Bold&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>axis</b></td><td>
-<p>A table of axis descriptors. GX fonts contain slightly more data than MM.</p>
-</td></tr>
-<tr valign=top><td><b>namedstyles</b></td><td>
-<p>A table of named styles. Only meaningful with GX.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Multi_Master">FT_Get_Multi_Master</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_Multi_Master</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>           face,
-                       <a href="ft2-multiple_masters.html#FT_Multi_Master">FT_Multi_Master</a>  *amaster );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the Multiple Master descriptor of a given font.</p>
-<p>This function can't be used with GX fonts.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>amaster</b></td><td>
-<p>The Multiple Masters descriptor.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_MM_Var">FT_Get_MM_Var</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_MM_Var</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>      face,
-                 <a href="ft2-multiple_masters.html#FT_MM_Var">FT_MM_Var</a>*  *amaster );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the Multiple Master/GX var descriptor of a given font.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>amaster</b></td><td>
-<p>The Multiple Masters/GX var descriptor. Allocates a data structure, which the user must free (a single call to FT_FREE will do it).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Set_MM_Design_Coordinates">FT_Set_MM_Design_Coordinates</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Set_MM_Design_Coordinates</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                                <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>   num_coords,
-                                <a href="ft2-basic_types.html#FT_Long">FT_Long</a>*  coords );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>For Multiple Masters fonts, choose an interpolated font design through design coordinates.</p>
-<p>This function can't be used with GX fonts.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>num_coords</b></td><td>
-<p>The number of design coordinates (must be equal to the number of axes in the font).</p>
-</td></tr>
-<tr valign=top><td><b>coords</b></td><td>
-<p>An array of design coordinates.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Set_Var_Design_Coordinates">FT_Set_Var_Design_Coordinates</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Set_Var_Design_Coordinates</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>    face,
-                                 <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>    num_coords,
-                                 <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>*  coords );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>For Multiple Master or GX Var fonts, choose an interpolated font design through design coordinates.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>num_coords</b></td><td>
-<p>The number of design coordinates (must be equal to the number of axes in the font).</p>
-</td></tr>
-<tr valign=top><td><b>coords</b></td><td>
-<p>An array of design coordinates.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Set_MM_Blend_Coordinates">FT_Set_MM_Blend_Coordinates</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Set_MM_Blend_Coordinates</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>    face,
-                               <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>    num_coords,
-                               <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>*  coords );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>For Multiple Masters and GX var fonts, choose an interpolated font design through normalized blend coordinates.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>num_coords</b></td><td>
-<p>The number of design coordinates (must be equal to the number of axes in the font).</p>
-</td></tr>
-<tr valign=top><td><b>coords</b></td><td>
-<p>The design coordinates array (each element must be between 0 and 1.0).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Set_Var_Blend_Coordinates">FT_Set_Var_Blend_Coordinates</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Set_Var_Blend_Coordinates</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>    face,
-                                <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>    num_coords,
-                                <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>*  coords );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This is another name of <a href="ft2-multiple_masters.html#FT_Set_MM_Blend_Coordinates">FT_Set_MM_Blend_Coordinates</a>.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-ot_validation.html b/docs/reference/ft2-ot_validation.html
deleted file mode 100644 (file)
index edc8f76..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-OpenType Validation
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_VALIDATE_OTXXX">FT_VALIDATE_OTXXX</a></td><td></td><td><a href="#FT_OpenType_Validate">FT_OpenType_Validate</a></td><td></td><td><a href="#FT_OpenType_Free">FT_OpenType_Free</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains the declaration of functions to validate some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_VALIDATE_OTXXX">FT_VALIDATE_OTXXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_BASE</a>  0x0100
-#define <a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_GDEF</a>  0x0200
-#define <a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_GPOS</a>  0x0400
-#define <a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_GSUB</a>  0x0800
-#define <a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_JSTF</a>  0x1000
-#define <a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_MATH</a>  0x2000
-
-#define <a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_OT</a>  <a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_BASE</a> | \
-                        <a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_GDEF</a> | \
-                        <a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_GPOS</a> | \
-                        <a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_GSUB</a> | \
-                        <a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_JSTF</a> | \
-                        <a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_MATH</a>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of bit-field constants used with <a href="ft2-ot_validation.html#FT_OpenType_Validate">FT_OpenType_Validate</a> to indicate which OpenType tables should be validated.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_VALIDATE_BASE</b></td><td>
-<p>Validate BASE table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_GDEF</b></td><td>
-<p>Validate GDEF table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_GPOS</b></td><td>
-<p>Validate GPOS table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_GSUB</b></td><td>
-<p>Validate GSUB table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_JSTF</b></td><td>
-<p>Validate JSTF table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_MATH</b></td><td>
-<p>Validate MATH table.</p>
-</td></tr>
-<tr valign=top><td><b>FT_VALIDATE_OT</b></td><td>
-<p>Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_OpenType_Validate">FT_OpenType_Validate</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_OpenType_Validate</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>    face,
-                        <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>    validation_flags,
-                        <a href="ft2-basic_types.html#FT_Bytes">FT_Bytes</a>  *BASE_table,
-                        <a href="ft2-basic_types.html#FT_Bytes">FT_Bytes</a>  *GDEF_table,
-                        <a href="ft2-basic_types.html#FT_Bytes">FT_Bytes</a>  *GPOS_table,
-                        <a href="ft2-basic_types.html#FT_Bytes">FT_Bytes</a>  *GSUB_table,
-                        <a href="ft2-basic_types.html#FT_Bytes">FT_Bytes</a>  *JSTF_table );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Validate various OpenType tables to assure that all offsets and indices are valid. The idea is that a higher-level library which actually does the text layout can access those tables without error checking (which can be quite time consuming).</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the input face.</p>
-</td></tr>
-<tr valign=top><td><b>validation_flags</b></td><td>
-<p>A bit field which specifies the tables to be validated. See <a href="ft2-ot_validation.html#FT_VALIDATE_OTXXX">FT_VALIDATE_OTXXX</a> for possible values.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>BASE_table</b></td><td>
-<p>A pointer to the BASE table.</p>
-</td></tr>
-<tr valign=top><td><b>GDEF_table</b></td><td>
-<p>A pointer to the GDEF table.</p>
-</td></tr>
-<tr valign=top><td><b>GPOS_table</b></td><td>
-<p>A pointer to the GPOS table.</p>
-</td></tr>
-<tr valign=top><td><b>GSUB_table</b></td><td>
-<p>A pointer to the GSUB table.</p>
-</td></tr>
-<tr valign=top><td><b>JSTF_table</b></td><td>
-<p>A pointer to the JSTF table.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function only works with OpenType fonts, returning an error otherwise.</p>
-<p>After use, the application should deallocate the five tables with <a href="ft2-ot_validation.html#FT_OpenType_Free">FT_OpenType_Free</a>. A NULL value indicates that the table either doesn't exist in the font, or the application hasn't asked for validation.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_OpenType_Free">FT_OpenType_Free</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_OpenType_Free</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                    <a href="ft2-basic_types.html#FT_Bytes">FT_Bytes</a>  table );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Free the buffer allocated by OpenType validator.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the input face.</p>
-</td></tr>
-<tr valign=top><td><b>table</b></td><td>
-<p>The pointer to the buffer that is allocated by <a href="ft2-ot_validation.html#FT_OpenType_Validate">FT_OpenType_Validate</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function must be used to free the buffer allocated by <a href="ft2-ot_validation.html#FT_OpenType_Validate">FT_OpenType_Validate</a> only.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-outline_processing.html b/docs/reference/ft2-outline_processing.html
deleted file mode 100644 (file)
index a36f136..0000000
+++ /dev/null
@@ -1,1125 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Outline Processing
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Outline">FT_Outline</a></td><td></td><td><a href="#FT_Outline_MoveToFunc">FT_Outline_MoveToFunc</a></td></tr>
-<tr><td></td><td><a href="#FT_OUTLINE_FLAGS">FT_OUTLINE_FLAGS</a></td><td></td><td><a href="#FT_Outline_LineToFunc">FT_Outline_LineToFunc</a></td></tr>
-<tr><td></td><td><a href="#FT_Outline_New">FT_Outline_New</a></td><td></td><td><a href="#FT_Outline_ConicToFunc">FT_Outline_ConicToFunc</a></td></tr>
-<tr><td></td><td><a href="#FT_Outline_Done">FT_Outline_Done</a></td><td></td><td><a href="#FT_Outline_CubicToFunc">FT_Outline_CubicToFunc</a></td></tr>
-<tr><td></td><td><a href="#FT_Outline_Copy">FT_Outline_Copy</a></td><td></td><td><a href="#FT_Outline_Funcs">FT_Outline_Funcs</a></td></tr>
-<tr><td></td><td><a href="#FT_Outline_Translate">FT_Outline_Translate</a></td><td></td><td><a href="#FT_Outline_Decompose">FT_Outline_Decompose</a></td></tr>
-<tr><td></td><td><a href="#FT_Outline_Transform">FT_Outline_Transform</a></td><td></td><td><a href="#FT_Outline_Get_CBox">FT_Outline_Get_CBox</a></td></tr>
-<tr><td></td><td><a href="#FT_Outline_Embolden">FT_Outline_Embolden</a></td><td></td><td><a href="#FT_Outline_Get_Bitmap">FT_Outline_Get_Bitmap</a></td></tr>
-<tr><td></td><td><a href="#FT_Outline_Reverse">FT_Outline_Reverse</a></td><td></td><td><a href="#FT_Outline_Render">FT_Outline_Render</a></td></tr>
-<tr><td></td><td><a href="#FT_Outline_Check">FT_Outline_Check</a></td><td></td><td><a href="#FT_Orientation">FT_Orientation</a></td></tr>
-<tr><td></td><td><a href="#FT_Outline_Get_BBox">FT_Outline_Get_BBox</a></td><td></td><td><a href="#FT_Outline_Get_Orientation">FT_Outline_Get_Orientation</a></td></tr>
-<tr><td></td><td><a href="#ft_outline_flags">ft_outline_flags</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains routines used to create and destroy scalable glyph images known as &lsquo;outlines&rsquo;. These can also be measured, transformed, and converted into bitmaps and pixmaps.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline">FT_Outline</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Outline_
-  {
-    <span class="keyword">short</span>       n_contours;      /* number of contours in glyph        */
-    <span class="keyword">short</span>       n_points;        /* number of points in the glyph      */
-
-    <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  points;          /* the outline's points               */
-    <span class="keyword">char</span>*       tags;            /* the points flags                   */
-    <span class="keyword">short</span>*      contours;        /* the contour end points             */
-
-    <span class="keyword">int</span>         flags;           /* outline masks                      */
-
-  } <b>FT_Outline</b>;
-
-  /* Following limits must be consistent with */
-  /* <b>FT_Outline</b>.{n_contours,n_points}         */
-#define FT_OUTLINE_CONTOURS_MAX  SHRT_MAX
-#define FT_OUTLINE_POINTS_MAX    SHRT_MAX
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This structure is used to describe an outline to the scan-line converter.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>n_contours</b></td><td>
-<p>The number of contours in the outline.</p>
-</td></tr>
-<tr valign=top><td><b>n_points</b></td><td>
-<p>The number of points in the outline.</p>
-</td></tr>
-<tr valign=top><td><b>points</b></td><td>
-<p>A pointer to an array of &lsquo;n_points&rsquo; <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a> elements, giving the outline's point coordinates.</p>
-</td></tr>
-<tr valign=top><td><b>tags</b></td><td>
-<p>A pointer to an array of &lsquo;n_points&rsquo; chars, giving each outline point's type.</p>
-<p>If bit&nbsp;0 is unset, the point is &lsquo;off&rsquo; the curve, i.e., a Bézier control point, while it is &lsquo;on&rsquo; if set.</p>
-<p>Bit&nbsp;1 is meaningful for &lsquo;off&rsquo; points only. If set, it indicates a third-order Bézier arc control point; and a second-order control point if unset.</p>
-<p>If bit&nbsp;2 is set, bits 5-7 contain the drop-out mode (as defined in the OpenType specification; the value is the same as the argument to the SCANMODE instruction).</p>
-<p>Bits 3 and&nbsp;4 are reserved for internal purposes.</p>
-</td></tr>
-<tr valign=top><td><b>contours</b></td><td>
-<p>An array of &lsquo;n_contours&rsquo; shorts, giving the end point of each contour within the outline. For example, the first contour is defined by the points &lsquo;0&rsquo; to &lsquo;contours[0]&rsquo;, the second one is defined by the points &lsquo;contours[0]+1&rsquo; to &lsquo;contours[1]&rsquo;, etc.</p>
-</td></tr>
-<tr valign=top><td><b>flags</b></td><td>
-<p>A set of bit flags used to characterize the outline and give hints to the scan-converter and hinter on how to convert/grid-fit it. See <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_FLAGS</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The B/W rasterizer only checks bit&nbsp;2 in the &lsquo;tags&rsquo; array for the first point of each contour. The drop-out mode as given with <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_IGNORE_DROPOUTS</a>, <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_SMART_DROPOUTS</a>, and <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_INCLUDE_STUBS</a> in &lsquo;flags&rsquo; is then overridden.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_OUTLINE_FLAGS">FT_OUTLINE_FLAGS</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_NONE</a>             0x0
-#define <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_OWNER</a>            0x1
-#define <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_EVEN_ODD_FILL</a>    0x2
-#define <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_REVERSE_FILL</a>     0x4
-#define <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_IGNORE_DROPOUTS</a>  0x8
-#define <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_SMART_DROPOUTS</a>   0x10
-#define <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_INCLUDE_STUBS</a>    0x20
-
-#define <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_HIGH_PRECISION</a>   0x100
-#define <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_SINGLE_PASS</a>      0x200
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of bit-field constants use for the flags in an outline's &lsquo;flags&rsquo; field.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_OUTLINE_NONE</b></td><td>
-<p>Value&nbsp;0 is reserved.</p>
-</td></tr>
-<tr valign=top><td><b>FT_OUTLINE_OWNER</b></td><td>
-<p>If set, this flag indicates that the outline's field arrays (i.e., &lsquo;points&rsquo;, &lsquo;flags&rsquo;, and &lsquo;contours&rsquo;) are &lsquo;owned&rsquo; by the outline object, and should thus be freed when it is destroyed.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_OUTLINE_EVEN_ODD_FILL</b></td></tr>
-<tr valign=top><td></td><td>
-<p>By default, outlines are filled using the non-zero winding rule. If set to 1, the outline will be filled using the even-odd fill rule (only works with the smooth rasterizer).</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_OUTLINE_REVERSE_FILL</b></td></tr>
-<tr valign=top><td></td><td>
-<p>By default, outside contours of an outline are oriented in clock-wise direction, as defined in the TrueType specification. This flag is set if the outline uses the opposite direction (typically for Type&nbsp;1 fonts). This flag is ignored by the scan converter.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_OUTLINE_IGNORE_DROPOUTS</b></td></tr>
-<tr valign=top><td></td><td>
-<p>By default, the scan converter will try to detect drop-outs in an outline and correct the glyph bitmap to ensure consistent shape continuity. If set, this flag hints the scan-line converter to ignore such cases. See below for more information.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_OUTLINE_SMART_DROPOUTS</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Select smart dropout control. If unset, use simple dropout control. Ignored if <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_IGNORE_DROPOUTS</a> is set. See below for more information.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_OUTLINE_INCLUDE_STUBS</b></td></tr>
-<tr valign=top><td></td><td>
-<p>If set, turn pixels on for &lsquo;stubs&rsquo;, otherwise exclude them. Ignored if <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_IGNORE_DROPOUTS</a> is set. See below for more information.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_OUTLINE_HIGH_PRECISION</b></td></tr>
-<tr valign=top><td></td><td>
-<p>This flag indicates that the scan-line converter should try to convert this outline to bitmaps with the highest possible quality. It is typically set for small character sizes. Note that this is only a hint that might be completely ignored by a given scan-converter.</p>
-</td></tr>
-<tr valign=top><td><b>FT_OUTLINE_SINGLE_PASS</b></td><td>
-<p>This flag is set to force a given scan-converter to only use a single pass over the outline to render a bitmap glyph image. Normally, it is set for very large character sizes. It is only a hint that might be completely ignored by a given scan-converter.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The flags <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_IGNORE_DROPOUTS</a>, <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_SMART_DROPOUTS</a>, and <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_INCLUDE_STUBS</a> are ignored by the smooth rasterizer.</p>
-<p>There exists a second mechanism to pass the drop-out mode to the B/W rasterizer; see the &lsquo;tags&rsquo; field in <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>.</p>
-<p>Please refer to the description of the &lsquo;SCANTYPE&rsquo; instruction in the OpenType specification (in file &lsquo;ttinst1.doc&rsquo;) how simple drop-outs, smart drop-outs, and stubs are defined.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_New">FT_Outline_New</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OUTLINE_H (freetype/ftoutln.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Outline_New</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>   library,
-                  <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>      numPoints,
-                  <a href="ft2-basic_types.html#FT_Int">FT_Int</a>       numContours,
-                  <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>  *anoutline );
-
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  FT_Outline_New_Internal( <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a>    memory,
-                           <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>      numPoints,
-                           <a href="ft2-basic_types.html#FT_Int">FT_Int</a>       numContours,
-                           <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>  *anoutline );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Create a new outline of a given size.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to the library object from where the outline is allocated. Note however that the new outline will <b>not</b> necessarily be <b>freed</b>, when destroying the library, by <a href="ft2-base_interface.html#FT_Done_FreeType">FT_Done_FreeType</a>.</p>
-</td></tr>
-<tr valign=top><td><b>numPoints</b></td><td>
-<p>The maximal number of points within the outline.</p>
-</td></tr>
-<tr valign=top><td><b>numContours</b></td><td>
-<p>The maximal number of contours within the outline.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>anoutline</b></td><td>
-<p>A handle to the new outline.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The reason why this function takes a &lsquo;library&rsquo; parameter is simply to use the library's memory allocator.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_Done">FT_Outline_Done</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OUTLINE_H (freetype/ftoutln.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Outline_Done</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>   library,
-                   <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  outline );
-
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  FT_Outline_Done_Internal( <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a>    memory,
-                            <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  outline );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Destroy an outline created with <a href="ft2-outline_processing.html#FT_Outline_New">FT_Outline_New</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle of the library object used to allocate the outline.</p>
-</td></tr>
-<tr valign=top><td><b>outline</b></td><td>
-<p>A pointer to the outline object to be discarded.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>If the outline's &lsquo;owner&rsquo; field is not set, only the outline descriptor will be released.</p>
-<p>The reason why this function takes an &lsquo;library&rsquo; parameter is simply to use ft_mem_free().</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_Copy">FT_Outline_Copy</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OUTLINE_H (freetype/ftoutln.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Outline_Copy</b>( <span class="keyword">const</span> <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  source,
-                   <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>        *target );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Copy an outline into another one. Both objects must have the same sizes (number of points &amp; number of contours) when this function is called.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>source</b></td><td>
-<p>A handle to the source outline.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>target</b></td><td>
-<p>A handle to the target outline.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_Translate">FT_Outline_Translate</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OUTLINE_H (freetype/ftoutln.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Outline_Translate</b>( <span class="keyword">const</span> <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  outline,
-                        <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>             xOffset,
-                        <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>             yOffset );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Apply a simple translation to the points of an outline.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>outline</b></td><td>
-<p>A pointer to the target outline descriptor.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>xOffset</b></td><td>
-<p>The horizontal offset.</p>
-</td></tr>
-<tr valign=top><td><b>yOffset</b></td><td>
-<p>The vertical offset.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_Transform">FT_Outline_Transform</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OUTLINE_H (freetype/ftoutln.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Outline_Transform</b>( <span class="keyword">const</span> <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  outline,
-                        <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>*   matrix );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Apply a simple 2x2 matrix to all of an outline's points. Useful for applying rotations, slanting, flipping, etc.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>outline</b></td><td>
-<p>A pointer to the target outline descriptor.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>matrix</b></td><td>
-<p>A pointer to the transformation matrix.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>You can use <a href="ft2-outline_processing.html#FT_Outline_Translate">FT_Outline_Translate</a> if you need to translate the outline's points.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_Embolden">FT_Outline_Embolden</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OUTLINE_H (freetype/ftoutln.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Outline_Embolden</b>( <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  outline,
-                       <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>       strength );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Embolden an outline. The new outline will be at most 4&nbsp;times &lsquo;strength&rsquo; pixels wider and higher. You may think of the left and bottom borders as unchanged.</p>
-<p>Negative &lsquo;strength&rsquo; values to reduce the outline thickness are possible also.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>outline</b></td><td>
-<p>A handle to the target outline.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>strength</b></td><td>
-<p>How strong the glyph is emboldened. Expressed in 26.6 pixel format.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The used algorithm to increase or decrease the thickness of the glyph doesn't change the number of points; this means that certain situations like acute angles or intersections are sometimes handled incorrectly.</p>
-<p>If you need &lsquo;better&rsquo; metrics values you should call <a href="ft2-outline_processing.html#FT_Outline_Get_CBox">FT_Outline_Get_CBox</a> or <a href="ft2-outline_processing.html#FT_Outline_Get_BBox">FT_Outline_Get_BBox</a>.</p>
-<p>Example call:</p>
-<pre class="colored">
-  FT_Load_Glyph( face, index, FT_LOAD_DEFAULT );                   
-  if ( face-&gt;slot-&gt;format == FT_GLYPH_FORMAT_OUTLINE )             
-    FT_Outline_Embolden( &amp;face-&gt;slot-&gt;outline, strength );         
-</pre>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_Reverse">FT_Outline_Reverse</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OUTLINE_H (freetype/ftoutln.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Outline_Reverse</b>( <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  outline );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Reverse the drawing direction of an outline. This is used to ensure consistent fill conventions for mirrored glyphs.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>outline</b></td><td>
-<p>A pointer to the target outline descriptor.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function toggles the bit flag <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_REVERSE_FILL</a> in the outline's &lsquo;flags&rsquo; field.</p>
-<p>It shouldn't be used by a normal client application, unless it knows what it is doing.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_Check">FT_Outline_Check</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OUTLINE_H (freetype/ftoutln.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Outline_Check</b>( <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  outline );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Check the contents of an outline descriptor.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>outline</b></td><td>
-<p>A handle to a source outline.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_Get_BBox">FT_Outline_Get_BBox</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_BBOX_H (freetype/ftbbox.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Outline_Get_BBox</b>( <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  outline,
-                       <a href="ft2-basic_types.html#FT_BBox">FT_BBox</a>     *abbox );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Compute the exact bounding box of an outline. This is slower than computing the control box. However, it uses an advanced algorithm which returns <i>very</i> quickly when the two boxes coincide. Otherwise, the outline Bézier arcs are traversed to extract their extrema.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>outline</b></td><td>
-<p>A pointer to the source outline.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>abbox</b></td><td>
-<p>The outline's exact bounding box.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>If the font is tricky and the glyph has been loaded with <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a>, 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.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="ft_outline_flags">ft_outline_flags</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_none</a>             <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_NONE</a>
-#define <a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_owner</a>            <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_OWNER</a>
-#define <a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_even_odd_fill</a>    <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_EVEN_ODD_FILL</a>
-#define <a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_reverse_fill</a>     <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_REVERSE_FILL</a>
-#define <a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_ignore_dropouts</a>  <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_IGNORE_DROPOUTS</a>
-#define <a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_high_precision</a>   <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_HIGH_PRECISION</a>
-#define <a href="ft2-outline_processing.html#ft_outline_flags">ft_outline_single_pass</a>      <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_SINGLE_PASS</a>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>These constants are deprecated. Please use the corresponding <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_FLAGS</a> values.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>ft_outline_none</b></td><td>
-<p>See <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_NONE</a>.</p>
-</td></tr>
-<tr valign=top><td><b>ft_outline_owner</b></td><td>
-<p>See <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_OWNER</a>.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>ft_outline_even_odd_fill</b></td></tr>
-<tr valign=top><td></td><td>
-<p>See <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_EVEN_ODD_FILL</a>.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>ft_outline_reverse_fill</b></td></tr>
-<tr valign=top><td></td><td>
-<p>See <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_REVERSE_FILL</a>.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>ft_outline_ignore_dropouts</b></td></tr>
-<tr valign=top><td></td><td>
-<p>See <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_IGNORE_DROPOUTS</a>.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>ft_outline_high_precision</b></td></tr>
-<tr valign=top><td></td><td>
-<p>See <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_HIGH_PRECISION</a>.</p>
-</td></tr>
-<tr valign=top><td><b>ft_outline_single_pass</b></td><td>
-<p>See <a href="ft2-outline_processing.html#FT_OUTLINE_FLAGS">FT_OUTLINE_SINGLE_PASS</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_MoveToFunc">FT_Outline_MoveToFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">int</span>
-  (*<b>FT_Outline_MoveToFunc</b>)( <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  to,
-                            <span class="keyword">void</span>*             user );
-
-#define FT_Outline_MoveTo_Func  <b>FT_Outline_MoveToFunc</b>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function pointer type used to describe the signature of a &lsquo;move to&rsquo; function during outline walking/decomposition.</p>
-<p>A &lsquo;move to&rsquo; is emitted to start a new contour in an outline.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>to</b></td><td>
-<p>A pointer to the target point of the &lsquo;move to&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>user</b></td><td>
-<p>A typeless pointer which is passed from the caller of the decomposition function.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>Error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_LineToFunc">FT_Outline_LineToFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">int</span>
-  (*<b>FT_Outline_LineToFunc</b>)( <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  to,
-                            <span class="keyword">void</span>*             user );
-
-#define FT_Outline_LineTo_Func  <b>FT_Outline_LineToFunc</b>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function pointer type used to describe the signature of a &lsquo;line to&rsquo; function during outline walking/decomposition.</p>
-<p>A &lsquo;line to&rsquo; is emitted to indicate a segment in the outline.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>to</b></td><td>
-<p>A pointer to the target point of the &lsquo;line to&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>user</b></td><td>
-<p>A typeless pointer which is passed from the caller of the decomposition function.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>Error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_ConicToFunc">FT_Outline_ConicToFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">int</span>
-  (*<b>FT_Outline_ConicToFunc</b>)( <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  control,
-                             <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  to,
-                             <span class="keyword">void</span>*             user );
-
-#define FT_Outline_ConicTo_Func  <b>FT_Outline_ConicToFunc</b>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function pointer type used to describe the signature of a &lsquo;conic to&rsquo; function during outline walking or decomposition.</p>
-<p>A &lsquo;conic to&rsquo; is emitted to indicate a second-order Bézier arc in the outline.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>control</b></td><td>
-<p>An intermediate control point between the last position and the new target in &lsquo;to&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>to</b></td><td>
-<p>A pointer to the target end point of the conic arc.</p>
-</td></tr>
-<tr valign=top><td><b>user</b></td><td>
-<p>A typeless pointer which is passed from the caller of the decomposition function.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>Error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_CubicToFunc">FT_Outline_CubicToFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">int</span>
-  (*<b>FT_Outline_CubicToFunc</b>)( <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  control1,
-                             <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  control2,
-                             <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  to,
-                             <span class="keyword">void</span>*             user );
-
-#define FT_Outline_CubicTo_Func  <b>FT_Outline_CubicToFunc</b>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function pointer type used to describe the signature of a &lsquo;cubic to&rsquo; function during outline walking or decomposition.</p>
-<p>A &lsquo;cubic to&rsquo; is emitted to indicate a third-order Bézier arc.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>control1</b></td><td>
-<p>A pointer to the first Bézier control point.</p>
-</td></tr>
-<tr valign=top><td><b>control2</b></td><td>
-<p>A pointer to the second Bézier control point.</p>
-</td></tr>
-<tr valign=top><td><b>to</b></td><td>
-<p>A pointer to the target end point.</p>
-</td></tr>
-<tr valign=top><td><b>user</b></td><td>
-<p>A typeless pointer which is passed from the caller of the decomposition function.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>Error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_Funcs">FT_Outline_Funcs</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Outline_Funcs_
-  {
-    <a href="ft2-outline_processing.html#FT_Outline_MoveToFunc">FT_Outline_MoveToFunc</a>   move_to;
-    <a href="ft2-outline_processing.html#FT_Outline_LineToFunc">FT_Outline_LineToFunc</a>   line_to;
-    <a href="ft2-outline_processing.html#FT_Outline_ConicToFunc">FT_Outline_ConicToFunc</a>  conic_to;
-    <a href="ft2-outline_processing.html#FT_Outline_CubicToFunc">FT_Outline_CubicToFunc</a>  cubic_to;
-
-    <span class="keyword">int</span>                     shift;
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>                  delta;
-
-  } <b>FT_Outline_Funcs</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure to hold various function pointers used during outline decomposition in order to emit segments, conic, and cubic Béziers.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>move_to</b></td><td>
-<p>The &lsquo;move to&rsquo; emitter.</p>
-</td></tr>
-<tr valign=top><td><b>line_to</b></td><td>
-<p>The segment emitter.</p>
-</td></tr>
-<tr valign=top><td><b>conic_to</b></td><td>
-<p>The second-order Bézier arc emitter.</p>
-</td></tr>
-<tr valign=top><td><b>cubic_to</b></td><td>
-<p>The third-order Bézier arc emitter.</p>
-</td></tr>
-<tr valign=top><td><b>shift</b></td><td>
-<p>The shift that is applied to coordinates before they are sent to the emitter.</p>
-</td></tr>
-<tr valign=top><td><b>delta</b></td><td>
-<p>The delta that is applied to coordinates before they are sent to the emitter, but after the shift.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The point coordinates sent to the emitters are the transformed version of the original coordinates (this is important for high accuracy during scan-conversion). The transformation is simple:</p>
-<pre class="colored">
-  x' = (x &lt;&lt; shift) - delta                                        
-  y' = (x &lt;&lt; shift) - delta                                        
-</pre>
-<p>Set the values of &lsquo;shift&rsquo; and &lsquo;delta&rsquo; to&nbsp;0 to get the original point coordinates.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_Decompose">FT_Outline_Decompose</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OUTLINE_H (freetype/ftoutln.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Outline_Decompose</b>( <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*              outline,
-                        <span class="keyword">const</span> <a href="ft2-outline_processing.html#FT_Outline_Funcs">FT_Outline_Funcs</a>*  func_interface,
-                        <span class="keyword">void</span>*                    user );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Walk over an outline's structure to decompose it into individual segments and Bézier arcs. This function also emits &lsquo;move to&rsquo; operations to indicate the start of new contours in the outline.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>outline</b></td><td>
-<p>A pointer to the source target.</p>
-</td></tr>
-<tr valign=top><td><b>func_interface</b></td><td>
-<p>A table of &lsquo;emitters&rsquo;, i.e., function pointers called during decomposition to indicate path operations.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>user</b></td><td>
-<p>A typeless pointer which is passed to each emitter during the decomposition. It can be used to store the state during the decomposition.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_Get_CBox">FT_Outline_Get_CBox</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OUTLINE_H (freetype/ftoutln.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Outline_Get_CBox</b>( <span class="keyword">const</span> <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  outline,
-                       <a href="ft2-basic_types.html#FT_BBox">FT_BBox</a>           *acbox );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return an outline's &lsquo;control box&rsquo;. The control box encloses all the outline's points, including Bézier control points. Though it coincides with the exact bounding box for most glyphs, it can be slightly larger in some situations (like when rotating an outline which contains Bézier outside arcs).</p>
-<p>Computing the control box is very fast, while getting the bounding box can take much more time as it needs to walk over all segments and arcs in the outline. To get the latter, you can use the &lsquo;ftbbox&rsquo; component which is dedicated to this single task.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>outline</b></td><td>
-<p>A pointer to the source outline descriptor.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>acbox</b></td><td>
-<p>The outline's control box.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>See <a href="ft2-glyph_management.html#FT_Glyph_Get_CBox">FT_Glyph_Get_CBox</a> for a discussion of tricky fonts.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_Get_Bitmap">FT_Outline_Get_Bitmap</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OUTLINE_H (freetype/ftoutln.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Outline_Get_Bitmap</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>        library,
-                         <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*       outline,
-                         <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>  *abitmap );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Render an outline within a bitmap. The outline's image is simply OR-ed to the target bitmap.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to a FreeType library object.</p>
-</td></tr>
-<tr valign=top><td><b>outline</b></td><td>
-<p>A pointer to the source outline descriptor.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>abitmap</b></td><td>
-<p>A pointer to the target bitmap descriptor.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function does NOT CREATE the bitmap, it only renders an outline image within the one you pass to it! Consequently, the various fields in &lsquo;abitmap&rsquo; should be set accordingly.</p>
-<p>It will use the raster corresponding to the default glyph format.</p>
-<p>The value of the &lsquo;num_grays&rsquo; field in &lsquo;abitmap&rsquo; is ignored. If you select the gray-level rasterizer, and you want less than 256 gray levels, you have to use <a href="ft2-outline_processing.html#FT_Outline_Render">FT_Outline_Render</a> directly.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_Render">FT_Outline_Render</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OUTLINE_H (freetype/ftoutln.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Outline_Render</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>         library,
-                     <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*        outline,
-                     <a href="ft2-raster.html#FT_Raster_Params">FT_Raster_Params</a>*  params );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Render an outline within a bitmap using the current scan-convert. This function uses an <a href="ft2-raster.html#FT_Raster_Params">FT_Raster_Params</a> structure as an argument, allowing advanced features like direct composition, translucency, etc.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A handle to a FreeType library object.</p>
-</td></tr>
-<tr valign=top><td><b>outline</b></td><td>
-<p>A pointer to the source outline descriptor.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>params</b></td><td>
-<p>A pointer to an <a href="ft2-raster.html#FT_Raster_Params">FT_Raster_Params</a> structure used to describe the rendering operation.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>You should know what you are doing and how <a href="ft2-raster.html#FT_Raster_Params">FT_Raster_Params</a> works to use this function.</p>
-<p>The field &lsquo;params.source&rsquo; will be set to &lsquo;outline&rsquo; before the scan converter is called, which means that the value you give to it is actually ignored.</p>
-<p>The gray-level rasterizer always uses 256 gray levels. If you want less gray levels, you have to provide your own span callback. See the <a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_DIRECT</a> value of the &lsquo;flags&rsquo; field in the <a href="ft2-raster.html#FT_Raster_Params">FT_Raster_Params</a> structure for more details.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Orientation">FT_Orientation</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OUTLINE_H (freetype/ftoutln.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_Orientation_
-  {
-    <a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_TRUETYPE</a>   = 0,
-    <a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_POSTSCRIPT</a> = 1,
-    <a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_FILL_RIGHT</a> = <a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_TRUETYPE</a>,
-    <a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_FILL_LEFT</a>  = <a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_POSTSCRIPT</a>,
-    <a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_NONE</a>
-
-  } <b>FT_Orientation</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of values used to describe an outline's contour orientation.</p>
-<p>The TrueType and PostScript specifications use different conventions to determine whether outline contours should be filled or unfilled.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td colspan=0><b>FT_ORIENTATION_TRUETYPE</b></td></tr>
-<tr valign=top><td></td><td>
-<p>According to the TrueType specification, clockwise contours must be filled, and counter-clockwise ones must be unfilled.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_ORIENTATION_POSTSCRIPT</b></td></tr>
-<tr valign=top><td></td><td>
-<p>According to the PostScript specification, counter-clockwise contours must be filled, and clockwise ones must be unfilled.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_ORIENTATION_FILL_RIGHT</b></td></tr>
-<tr valign=top><td></td><td>
-<p>This is identical to <a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_TRUETYPE</a>, but is used to remember that in TrueType, everything that is to the right of the drawing direction of a contour must be filled.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_ORIENTATION_FILL_LEFT</b></td></tr>
-<tr valign=top><td></td><td>
-<p>This is identical to <a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_POSTSCRIPT</a>, but is used to remember that in PostScript, everything that is to the left of the drawing direction of a contour must be filled.</p>
-</td></tr>
-<tr valign=top><td><b>FT_ORIENTATION_NONE</b></td><td>
-<p>The orientation cannot be determined. That is, different parts of the glyph have different orientation.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Outline_Get_Orientation">FT_Outline_Get_Orientation</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_OUTLINE_H (freetype/ftoutln.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-outline_processing.html#FT_Orientation">FT_Orientation</a> )
-  <b>FT_Outline_Get_Orientation</b>( <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>*  outline );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This function analyzes a glyph outline and tries to compute its fill orientation (see <a href="ft2-outline_processing.html#FT_Orientation">FT_Orientation</a>). This is done by computing the direction of each global horizontal and/or vertical extrema within the outline.</p>
-<p>Note that this will return <a href="ft2-outline_processing.html#FT_Orientation">FT_ORIENTATION_TRUETYPE</a> for empty outlines.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>outline</b></td><td>
-<p>A handle to the source outline.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The orientation.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-pfr_fonts.html b/docs/reference/ft2-pfr_fonts.html
deleted file mode 100644 (file)
index 6a968f3..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-PFR Fonts
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Get_PFR_Metrics">FT_Get_PFR_Metrics</a></td><td></td><td><a href="#FT_Get_PFR_Kerning">FT_Get_PFR_Kerning</a></td><td></td><td><a href="#FT_Get_PFR_Advance">FT_Get_PFR_Advance</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains the declaration of PFR-specific functions.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_PFR_Metrics">FT_Get_PFR_Metrics</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_PFR_H (freetype/ftpfr.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_PFR_Metrics</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>    face,
-                      <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>   *aoutline_resolution,
-                      <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>   *ametrics_resolution,
-                      <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>  *ametrics_x_scale,
-                      <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>  *ametrics_y_scale );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the outline and metrics resolutions of a given PFR face.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>Handle to the input face. It can be a non-PFR face.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aoutline_resolution</b></td><td>
-<p>Outline resolution. This is equivalent to &lsquo;face-&gt;units_per_EM&rsquo; for non-PFR fonts. Optional (parameter can be NULL).</p>
-</td></tr>
-<tr valign=top><td><b>ametrics_resolution</b></td><td>
-<p>Metrics resolution. This is equivalent to &lsquo;outline_resolution&rsquo; for non-PFR fonts. Optional (parameter can be NULL).</p>
-</td></tr>
-<tr valign=top><td><b>ametrics_x_scale</b></td><td>
-<p>A 16.16 fixed-point number used to scale distance expressed in metrics units to device sub-pixels. This is equivalent to &lsquo;face-&gt;size-&gt;x_scale&rsquo;, but for metrics only. Optional (parameter can be NULL).</p>
-</td></tr>
-<tr valign=top><td><b>ametrics_y_scale</b></td><td>
-<p>Same as &lsquo;ametrics_x_scale&rsquo; but for the vertical direction. optional (parameter can be NULL).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>If the input face is not a PFR, this function will return an error. However, in all cases, it will return valid values.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_PFR_Kerning">FT_Get_PFR_Kerning</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_PFR_H (freetype/ftpfr.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_PFR_Kerning</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>     face,
-                      <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     left,
-                      <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>     right,
-                      <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>  *avector );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the kerning pair corresponding to two glyphs in a PFR face. The distance is expressed in metrics units, unlike the result of <a href="ft2-base_interface.html#FT_Get_Kerning">FT_Get_Kerning</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the input face.</p>
-</td></tr>
-<tr valign=top><td><b>left</b></td><td>
-<p>Index of the left glyph.</p>
-</td></tr>
-<tr valign=top><td><b>right</b></td><td>
-<p>Index of the right glyph.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>avector</b></td><td>
-<p>A kerning vector.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function always return distances in original PFR metrics units. This is unlike <a href="ft2-base_interface.html#FT_Get_Kerning">FT_Get_Kerning</a> with the <a href="ft2-base_interface.html#FT_Kerning_Mode">FT_KERNING_UNSCALED</a> mode, which always returns distances converted to outline units.</p>
-<p>You can use the value of the &lsquo;x_scale&rsquo; and &lsquo;y_scale&rsquo; parameters returned by <a href="ft2-pfr_fonts.html#FT_Get_PFR_Metrics">FT_Get_PFR_Metrics</a> to scale these to device sub-pixels.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_PFR_Advance">FT_Get_PFR_Advance</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_PFR_H (freetype/ftpfr.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_PFR_Advance</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-                      <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>   gindex,
-                      <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>   *aadvance );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return a given glyph advance, expressed in original metrics units, from a PFR font.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the input face.</p>
-</td></tr>
-<tr valign=top><td><b>gindex</b></td><td>
-<p>The glyph index.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aadvance</b></td><td>
-<p>The glyph advance in metrics units.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>You can use the &lsquo;x_scale&rsquo; or &lsquo;y_scale&rsquo; results of <a href="ft2-pfr_fonts.html#FT_Get_PFR_Metrics">FT_Get_PFR_Metrics</a> to convert the advance to device sub-pixels (i.e., 1/64th of pixels).</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-quick_advance.html b/docs/reference/ft2-quick_advance.html
deleted file mode 100644 (file)
index 80efee1..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Quick retrieval of advance values
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_ADVANCE_FLAG_FAST_ONLY">FT_ADVANCE_FLAG_FAST_ONLY</a></td><td></td><td><a href="#FT_Get_Advances">FT_Get_Advances</a></td></tr>
-<tr><td></td><td><a href="#FT_Get_Advance">FT_Get_Advance</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains functions to quickly extract advance values without handling glyph outlines, if possible.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_ADVANCE_FLAG_FAST_ONLY">FT_ADVANCE_FLAG_FAST_ONLY</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_ADVANCES_H (freetype/ftadvanc.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_ADVANCE_FLAG_FAST_ONLY</b>  0x20000000UL
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A bit-flag to be OR-ed with the &lsquo;flags&rsquo; parameter of the <a href="ft2-quick_advance.html#FT_Get_Advance">FT_Get_Advance</a> and <a href="ft2-quick_advance.html#FT_Get_Advances">FT_Get_Advances</a> functions.</p>
-<p>If set, it indicates that you want these functions to fail if the corresponding hinting mode or font driver doesn't allow for very quick advance computation.</p>
-<p>Typically, glyphs which are either unscaled, unhinted, bitmapped, or light-hinted can have their advance width computed very quickly.</p>
-<p>Normal and bytecode hinted modes, which require loading, scaling, and hinting of the glyph outline, are extremely slow by comparison.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Advance">FT_Get_Advance</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_ADVANCES_H (freetype/ftadvanc.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_Advance</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>    face,
-                  <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>    gindex,
-                  <a href="ft2-basic_types.html#FT_Int32">FT_Int32</a>   load_flags,
-                  <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>  *padvance );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the advance value of a given glyph outline in an <a href="ft2-base_interface.html#FT_Face">FT_Face</a>. By default, the unhinted advance is returned in font units.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>The source <a href="ft2-base_interface.html#FT_Face">FT_Face</a> handle.</p>
-</td></tr>
-<tr valign=top><td><b>gindex</b></td><td>
-<p>The glyph index.</p>
-</td></tr>
-<tr valign=top><td><b>load_flags</b></td><td>
-<p>A set of bit flags similar to those used when calling <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a>, used to determine what kind of advances you need.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>padvance</b></td><td>
-<p>The advance value, in either font units or 16.16 format.</p>
-<p>If <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_VERTICAL_LAYOUT</a> is set, this is the vertical advance corresponding to a vertical layout. Otherwise, it is the horizontal advance in a horizontal layout.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0 means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function may fail if you use <a href="ft2-quick_advance.html#FT_ADVANCE_FLAG_FAST_ONLY">FT_ADVANCE_FLAG_FAST_ONLY</a> and if the corresponding font backend doesn't have a quick way to retrieve the advances.</p>
-<p>A scaled advance is returned in 16.16 format but isn't transformed by the affine transformation specified by <a href="ft2-base_interface.html#FT_Set_Transform">FT_Set_Transform</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Advances">FT_Get_Advances</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_ADVANCES_H (freetype/ftadvanc.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_Advances</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>    face,
-                   <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>    start,
-                   <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>    count,
-                   <a href="ft2-basic_types.html#FT_Int32">FT_Int32</a>   load_flags,
-                   <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>  *padvances );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the advance values of several glyph outlines in an <a href="ft2-base_interface.html#FT_Face">FT_Face</a>. By default, the unhinted advances are returned in font units.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>The source <a href="ft2-base_interface.html#FT_Face">FT_Face</a> handle.</p>
-</td></tr>
-<tr valign=top><td><b>start</b></td><td>
-<p>The first glyph index.</p>
-</td></tr>
-<tr valign=top><td><b>count</b></td><td>
-<p>The number of advance values you want to retrieve.</p>
-</td></tr>
-<tr valign=top><td><b>load_flags</b></td><td>
-<p>A set of bit flags similar to those used when calling <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>padvance</b></td><td>
-<p>The advances, in either font units or 16.16 format. This array must contain at least &lsquo;count&rsquo; elements.</p>
-<p>If <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_VERTICAL_LAYOUT</a> is set, these are the vertical advances corresponding to a vertical layout. Otherwise, they are the horizontal advances in a horizontal layout.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0 means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function may fail if you use <a href="ft2-quick_advance.html#FT_ADVANCE_FLAG_FAST_ONLY">FT_ADVANCE_FLAG_FAST_ONLY</a> and if the corresponding font backend doesn't have a quick way to retrieve the advances.</p>
-<p>Scaled advances are returned in 16.16 format but aren't transformed by the affine transformation specified by <a href="ft2-base_interface.html#FT_Set_Transform">FT_Set_Transform</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-raster.html b/docs/reference/ft2-raster.html
deleted file mode 100644 (file)
index 34f2078..0000000
+++ /dev/null
@@ -1,606 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Scanline Converter
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Raster">FT_Raster</a></td><td></td><td><a href="#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_XXX</a></td><td></td><td><a href="#FT_Raster_SetModeFunc">FT_Raster_SetModeFunc</a></td></tr>
-<tr><td></td><td><a href="#FT_Span">FT_Span</a></td><td></td><td><a href="#FT_Raster_Params">FT_Raster_Params</a></td><td></td><td><a href="#FT_Raster_RenderFunc">FT_Raster_RenderFunc</a></td></tr>
-<tr><td></td><td><a href="#FT_SpanFunc">FT_SpanFunc</a></td><td></td><td><a href="#FT_Raster_NewFunc">FT_Raster_NewFunc</a></td><td></td><td><a href="#FT_Raster_Funcs">FT_Raster_Funcs</a></td></tr>
-<tr><td></td><td><a href="#FT_Raster_BitTest_Func">FT_Raster_BitTest_Func</a></td><td></td><td><a href="#FT_Raster_DoneFunc">FT_Raster_DoneFunc</a></td><td></td><td></td></tr>
-<tr><td></td><td><a href="#FT_Raster_BitSet_Func">FT_Raster_BitSet_Func</a></td><td></td><td><a href="#FT_Raster_ResetFunc">FT_Raster_ResetFunc</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains technical definitions.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Raster">FT_Raster</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_RasterRec_*  <b>FT_Raster</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle (pointer) to a raster object. Each object can be used independently to convert an outline into a bitmap or pixmap.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Span">FT_Span</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Span_
-  {
-    <span class="keyword">short</span>           x;
-    <span class="keyword">unsigned</span> <span class="keyword">short</span>  len;
-    <span class="keyword">unsigned</span> <span class="keyword">char</span>   coverage;
-
-  } <b>FT_Span</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model a single span of gray (or black) pixels when rendering a monochrome or anti-aliased bitmap.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>x</b></td><td>
-<p>The span's horizontal start position.</p>
-</td></tr>
-<tr valign=top><td><b>len</b></td><td>
-<p>The span's length in pixels.</p>
-</td></tr>
-<tr valign=top><td><b>coverage</b></td><td>
-<p>The span color/coverage, ranging from 0 (background) to 255 (foreground). Only used for anti-aliased rendering.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This structure is used by the span drawing callback type named <a href="ft2-raster.html#FT_SpanFunc">FT_SpanFunc</a> which takes the y&nbsp;coordinate of the span as a a parameter.</p>
-<p>The coverage value is always between 0 and 255. If you want less gray values, the callback function has to reduce them.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_SpanFunc">FT_SpanFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">void</span>
-  (*<b>FT_SpanFunc</b>)( <span class="keyword">int</span>             y,
-                  <span class="keyword">int</span>             count,
-                  <span class="keyword">const</span> <a href="ft2-raster.html#FT_Span">FT_Span</a>*  spans,
-                  <span class="keyword">void</span>*           user );
-
-#define FT_Raster_Span_Func  <b>FT_SpanFunc</b>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used as a call-back by the anti-aliased renderer in order to let client applications draw themselves the gray pixel spans on each scan line.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>y</b></td><td>
-<p>The scanline's y&nbsp;coordinate.</p>
-</td></tr>
-<tr valign=top><td><b>count</b></td><td>
-<p>The number of spans to draw on this scanline.</p>
-</td></tr>
-<tr valign=top><td><b>spans</b></td><td>
-<p>A table of &lsquo;count&rsquo; spans to draw on the scanline.</p>
-</td></tr>
-<tr valign=top><td><b>user</b></td><td>
-<p>User-supplied data that is passed to the callback.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This callback allows client applications to directly render the gray spans of the anti-aliased bitmap to any kind of surfaces.</p>
-<p>This can be used to write anti-aliased outlines directly to a given background bitmap, and even perform translucency.</p>
-<p>Note that the &lsquo;count&rsquo; field cannot be greater than a fixed value defined by the &lsquo;FT_MAX_GRAY_SPANS&rsquo; configuration macro in &lsquo;ftoption.h&rsquo;. By default, this value is set to&nbsp;32, which means that if there are more than 32&nbsp;spans on a given scanline, the callback is called several times with the same &lsquo;y&rsquo; parameter in order to draw all callbacks.</p>
-<p>Otherwise, the callback is only called once per scan-line, and only for those scanlines that do have &lsquo;gray&rsquo; pixels on them.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Raster_BitTest_Func">FT_Raster_BitTest_Func</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">int</span>
-  (*<b>FT_Raster_BitTest_Func</b>)( <span class="keyword">int</span>    y,
-                             <span class="keyword">int</span>    x,
-                             <span class="keyword">void</span>*  user );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>THIS TYPE IS DEPRECATED. DO NOT USE IT.</p>
-<p>A function used as a call-back by the monochrome scan-converter to test whether a given target pixel is already set to the drawing &lsquo;color&rsquo;. These tests are crucial to implement drop-out control per-se the TrueType spec.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>y</b></td><td>
-<p>The pixel's y&nbsp;coordinate.</p>
-</td></tr>
-<tr valign=top><td><b>x</b></td><td>
-<p>The pixel's x&nbsp;coordinate.</p>
-</td></tr>
-<tr valign=top><td><b>user</b></td><td>
-<p>User-supplied data that is passed to the callback.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>1&nbsp;if the pixel is &lsquo;set&rsquo;, 0&nbsp;otherwise.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Raster_BitSet_Func">FT_Raster_BitSet_Func</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">void</span>
-  (*<b>FT_Raster_BitSet_Func</b>)( <span class="keyword">int</span>    y,
-                            <span class="keyword">int</span>    x,
-                            <span class="keyword">void</span>*  user );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>THIS TYPE IS DEPRECATED. DO NOT USE IT.</p>
-<p>A function used as a call-back by the monochrome scan-converter to set an individual target pixel. This is crucial to implement drop-out control according to the TrueType specification.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>y</b></td><td>
-<p>The pixel's y&nbsp;coordinate.</p>
-</td></tr>
-<tr valign=top><td><b>x</b></td><td>
-<p>The pixel's x&nbsp;coordinate.</p>
-</td></tr>
-<tr valign=top><td><b>user</b></td><td>
-<p>User-supplied data that is passed to the callback.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>1&nbsp;if the pixel is &lsquo;set&rsquo;, 0&nbsp;otherwise.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_DEFAULT</a>  0x0
-#define <a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_AA</a>       0x1
-#define <a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_DIRECT</a>   0x2
-#define <a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_CLIP</a>     0x4
-
-  /* deprecated */
-#define ft_raster_flag_default  <a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_DEFAULT</a>
-#define ft_raster_flag_aa       <a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_AA</a>
-#define ft_raster_flag_direct   <a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_DIRECT</a>
-#define ft_raster_flag_clip     <a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_CLIP</a>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of bit flag constants as used in the &lsquo;flags&rsquo; field of a <a href="ft2-raster.html#FT_Raster_Params">FT_Raster_Params</a> structure.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_RASTER_FLAG_DEFAULT</b></td><td>
-<p>This value is 0.</p>
-</td></tr>
-<tr valign=top><td><b>FT_RASTER_FLAG_AA</b></td><td>
-<p>This flag is set to indicate that an anti-aliased glyph image should be generated. Otherwise, it will be monochrome (1-bit).</p>
-</td></tr>
-<tr valign=top><td><b>FT_RASTER_FLAG_DIRECT</b></td><td>
-<p>This flag is set to indicate direct rendering. In this mode, client applications must provide their own span callback. This lets them directly draw or compose over an existing bitmap. If this bit is not set, the target pixmap's buffer <i>must</i> be zeroed before rendering.</p>
-<p>Note that for now, direct rendering is only possible with anti-aliased glyphs.</p>
-</td></tr>
-<tr valign=top><td><b>FT_RASTER_FLAG_CLIP</b></td><td>
-<p>This flag is only used in direct rendering mode. If set, the output will be clipped to a box specified in the &lsquo;clip_box&rsquo; field of the <a href="ft2-raster.html#FT_Raster_Params">FT_Raster_Params</a> structure.</p>
-<p>Note that by default, the glyph bitmap is clipped to the target pixmap, except in direct rendering mode where all spans are generated if no clipping box is set.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Raster_Params">FT_Raster_Params</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Raster_Params_
-  {
-    <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>*        target;
-    <span class="keyword">const</span> <span class="keyword">void</span>*             source;
-    <span class="keyword">int</span>                     flags;
-    <a href="ft2-raster.html#FT_SpanFunc">FT_SpanFunc</a>             gray_spans;
-    <a href="ft2-raster.html#FT_SpanFunc">FT_SpanFunc</a>             black_spans;  /* doesn't work! */
-    <a href="ft2-raster.html#FT_Raster_BitTest_Func">FT_Raster_BitTest_Func</a>  bit_test;     /* doesn't work! */
-    <a href="ft2-raster.html#FT_Raster_BitSet_Func">FT_Raster_BitSet_Func</a>   bit_set;      /* doesn't work! */
-    <span class="keyword">void</span>*                   user;
-    <a href="ft2-basic_types.html#FT_BBox">FT_BBox</a>                 clip_box;
-
-  } <b>FT_Raster_Params</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure to hold the arguments used by a raster's render function.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>target</b></td><td>
-<p>The target bitmap.</p>
-</td></tr>
-<tr valign=top><td><b>source</b></td><td>
-<p>A pointer to the source glyph image (e.g., an <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>).</p>
-</td></tr>
-<tr valign=top><td><b>flags</b></td><td>
-<p>The rendering flags.</p>
-</td></tr>
-<tr valign=top><td><b>gray_spans</b></td><td>
-<p>The gray span drawing callback.</p>
-</td></tr>
-<tr valign=top><td><b>black_spans</b></td><td>
-<p>The black span drawing callback. UNIMPLEMENTED!</p>
-</td></tr>
-<tr valign=top><td><b>bit_test</b></td><td>
-<p>The bit test callback. UNIMPLEMENTED!</p>
-</td></tr>
-<tr valign=top><td><b>bit_set</b></td><td>
-<p>The bit set callback. UNIMPLEMENTED!</p>
-</td></tr>
-<tr valign=top><td><b>user</b></td><td>
-<p>User-supplied data that is passed to each drawing callback.</p>
-</td></tr>
-<tr valign=top><td><b>clip_box</b></td><td>
-<p>An optional clipping box. It is only used in direct rendering mode. Note that coordinates here should be expressed in <i>integer</i> pixels (and not in 26.6 fixed-point units).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>An anti-aliased glyph bitmap is drawn if the <a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_AA</a> bit flag is set in the &lsquo;flags&rsquo; field, otherwise a monochrome bitmap is generated.</p>
-<p>If the <a href="ft2-raster.html#FT_RASTER_FLAG_XXX">FT_RASTER_FLAG_DIRECT</a> bit flag is set in &lsquo;flags&rsquo;, the raster will call the &lsquo;gray_spans&rsquo; callback to draw gray pixel spans, in the case of an aa glyph bitmap, it will call &lsquo;black_spans&rsquo;, and &lsquo;bit_test&rsquo; and &lsquo;bit_set&rsquo; in the case of a monochrome bitmap. This allows direct composition over a pre-existing bitmap through user-provided callbacks to perform the span drawing/composition.</p>
-<p>Note that the &lsquo;bit_test&rsquo; and &lsquo;bit_set&rsquo; callbacks are required when rendering a monochrome bitmap, as they are crucial to implement correct drop-out control as defined in the TrueType specification.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Raster_NewFunc">FT_Raster_NewFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">int</span>
-  (*<b>FT_Raster_NewFunc</b>)( <span class="keyword">void</span>*       memory,
-                        <a href="ft2-raster.html#FT_Raster">FT_Raster</a>*  raster );
-
-#define FT_Raster_New_Func  <b>FT_Raster_NewFunc</b>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to create a new raster object.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>memory</b></td><td>
-<p>A handle to the memory allocator.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>raster</b></td><td>
-<p>A handle to the new raster object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>Error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The &lsquo;memory&rsquo; parameter is a typeless pointer in order to avoid un-wanted dependencies on the rest of the FreeType code. In practice, it is an <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a> object, i.e., a handle to the standard FreeType memory allocator. However, this field can be completely ignored by a given raster implementation.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Raster_DoneFunc">FT_Raster_DoneFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">void</span>
-  (*<b>FT_Raster_DoneFunc</b>)( <a href="ft2-raster.html#FT_Raster">FT_Raster</a>  raster );
-
-#define FT_Raster_Done_Func  <b>FT_Raster_DoneFunc</b>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to destroy a given raster object.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>raster</b></td><td>
-<p>A handle to the raster object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Raster_ResetFunc">FT_Raster_ResetFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">void</span>
-  (*<b>FT_Raster_ResetFunc</b>)( <a href="ft2-raster.html#FT_Raster">FT_Raster</a>       raster,
-                          <span class="keyword">unsigned</span> <span class="keyword">char</span>*  pool_base,
-                          <span class="keyword">unsigned</span> <span class="keyword">long</span>   pool_size );
-
-#define FT_Raster_Reset_Func  <b>FT_Raster_ResetFunc</b>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>FreeType provides an area of memory called the &lsquo;render pool&rsquo;, available to all registered rasters. This pool can be freely used during a given scan-conversion but is shared by all rasters. Its content is thus transient.</p>
-<p>This function is called each time the render pool changes, or just after a new raster object is created.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>raster</b></td><td>
-<p>A handle to the new raster object.</p>
-</td></tr>
-<tr valign=top><td><b>pool_base</b></td><td>
-<p>The address in memory of the render pool.</p>
-</td></tr>
-<tr valign=top><td><b>pool_size</b></td><td>
-<p>The size in bytes of the render pool.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Rasters can ignore the render pool and rely on dynamic memory allocation if they want to (a handle to the memory allocator is passed to the raster constructor). However, this is not recommended for efficiency purposes.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Raster_SetModeFunc">FT_Raster_SetModeFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">int</span>
-  (*<b>FT_Raster_SetModeFunc</b>)( <a href="ft2-raster.html#FT_Raster">FT_Raster</a>      raster,
-                            <span class="keyword">unsigned</span> <span class="keyword">long</span>  mode,
-                            <span class="keyword">void</span>*          args );
-
-#define FT_Raster_Set_Mode_Func  <b>FT_Raster_SetModeFunc</b>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This function is a generic facility to change modes or attributes in a given raster. This can be used for debugging purposes, or simply to allow implementation-specific &lsquo;features&rsquo; in a given raster module.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>raster</b></td><td>
-<p>A handle to the new raster object.</p>
-</td></tr>
-<tr valign=top><td><b>mode</b></td><td>
-<p>A 4-byte tag used to name the mode or property.</p>
-</td></tr>
-<tr valign=top><td><b>args</b></td><td>
-<p>A pointer to the new mode/property to use.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Raster_RenderFunc">FT_Raster_RenderFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">int</span>
-  (*<b>FT_Raster_RenderFunc</b>)( <a href="ft2-raster.html#FT_Raster">FT_Raster</a>                raster,
-                           <span class="keyword">const</span> <a href="ft2-raster.html#FT_Raster_Params">FT_Raster_Params</a>*  params );
-
-#define FT_Raster_Render_Func  <b>FT_Raster_RenderFunc</b>
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Invoke a given raster to scan-convert a given glyph image into a target bitmap.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>raster</b></td><td>
-<p>A handle to the raster object.</p>
-</td></tr>
-<tr valign=top><td><b>params</b></td><td>
-<p>A pointer to an <a href="ft2-raster.html#FT_Raster_Params">FT_Raster_Params</a> structure used to store the rendering parameters.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>Error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The exact format of the source image depends on the raster's glyph format defined in its <a href="ft2-raster.html#FT_Raster_Funcs">FT_Raster_Funcs</a> structure. It can be an <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a> or anything else in order to support a large array of glyph formats.</p>
-<p>Note also that the render function can fail and return a &lsquo;FT_Err_Unimplemented_Feature&rsquo; error code if the raster used does not support direct composition.</p>
-<p>XXX: For now, the standard raster doesn't support direct composition but this should change for the final release (see the files &lsquo;demos/src/ftgrays.c&rsquo; and &lsquo;demos/src/ftgrays2.c&rsquo; for examples of distinct implementations which support direct composition).</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Raster_Funcs">FT_Raster_Funcs</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_IMAGE_H (freetype/ftimage.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Raster_Funcs_
-  {
-    <a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a>        glyph_format;
-    <a href="ft2-raster.html#FT_Raster_NewFunc">FT_Raster_NewFunc</a>      raster_new;
-    <a href="ft2-raster.html#FT_Raster_ResetFunc">FT_Raster_ResetFunc</a>    raster_reset;
-    <a href="ft2-raster.html#FT_Raster_SetModeFunc">FT_Raster_SetModeFunc</a>  raster_set_mode;
-    <a href="ft2-raster.html#FT_Raster_RenderFunc">FT_Raster_RenderFunc</a>   raster_render;
-    <a href="ft2-raster.html#FT_Raster_DoneFunc">FT_Raster_DoneFunc</a>     raster_done;
-
-  } <b>FT_Raster_Funcs</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to describe a given raster class to the library.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>glyph_format</b></td><td>
-<p>The supported glyph format for this raster.</p>
-</td></tr>
-<tr valign=top><td><b>raster_new</b></td><td>
-<p>The raster constructor.</p>
-</td></tr>
-<tr valign=top><td><b>raster_reset</b></td><td>
-<p>Used to reset the render pool within the raster.</p>
-</td></tr>
-<tr valign=top><td><b>raster_render</b></td><td>
-<p>A function to render a glyph into a given bitmap.</p>
-</td></tr>
-<tr valign=top><td><b>raster_done</b></td><td>
-<p>The raster destructor.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-sfnt_names.html b/docs/reference/ft2-sfnt_names.html
deleted file mode 100644 (file)
index ab1312a..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-SFNT Names
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_SfntName">FT_SfntName</a></td></tr>
-<tr><td></td><td><a href="#FT_Get_Sfnt_Name_Count">FT_Get_Sfnt_Name_Count</a></td></tr>
-<tr><td></td><td><a href="#FT_Get_Sfnt_Name">FT_Get_Sfnt_Name</a></td></tr>
-<tr><td></td><td><a href="#FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY">FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY</a></td></tr>
-<tr><td></td><td><a href="#FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY">FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>The TrueType and OpenType specifications allow the inclusion of a special &lsquo;names table&rsquo; in font files. This table contains textual (and internationalized) information regarding the font, like family name, copyright, version, etc.</p>
-<p>The definitions below are used to access them if available.</p>
-<p>Note that this has nothing to do with glyph names!</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_SfntName">FT_SfntName</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_SfntName_
-  {
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  platform_id;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  encoding_id;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  language_id;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  name_id;
-
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>*   string;      /* this string is *not* null-terminated! */
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>    string_len;  /* in bytes */
-
-  } <b>FT_SfntName</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model an SFNT &lsquo;name&rsquo; table entry.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>platform_id</b></td><td>
-<p>The platform ID for &lsquo;string&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>encoding_id</b></td><td>
-<p>The encoding ID for &lsquo;string&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>language_id</b></td><td>
-<p>The language ID for &lsquo;string&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>name_id</b></td><td>
-<p>An identifier for &lsquo;string&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>string</b></td><td>
-<p>The &lsquo;name&rsquo; string. Note that its format differs depending on the (platform,encoding) pair. It can be a Pascal String, a UTF-16 one, etc.</p>
-<p>Generally speaking, the string is not zero-terminated. Please refer to the TrueType specification for details.</p>
-</td></tr>
-<tr valign=top><td><b>string_len</b></td><td>
-<p>The length of &lsquo;string&rsquo; in bytes.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Possible values for &lsquo;platform_id&rsquo;, &lsquo;encoding_id&rsquo;, &lsquo;language_id&rsquo;, and &lsquo;name_id&rsquo; are given in the file &lsquo;ttnameid.h&rsquo;. For details please refer to the TrueType or OpenType specification.</p>
-<p>See also <a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_XXX</a>, <a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_XXX</a>, <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_XXX</a>, <a href="ft2-truetype_tables.html#TT_ISO_ID_XXX">TT_ISO_ID_XXX</a>, and <a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_XXX</a>.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Sfnt_Name_Count">FT_Get_Sfnt_Name_Count</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> )
-  <b>FT_Get_Sfnt_Name_Count</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>  face );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the number of name strings in the SFNT &lsquo;name&rsquo; table.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The number of strings in the &lsquo;name&rsquo; table.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Sfnt_Name">FT_Get_Sfnt_Name</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_Sfnt_Name</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>       face,
-                    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>       idx,
-                    <a href="ft2-sfnt_names.html#FT_SfntName">FT_SfntName</a>  *aname );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve a string of the SFNT &lsquo;name&rsquo; table for a given index.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face.</p>
-</td></tr>
-<tr valign=top><td><b>idx</b></td><td>
-<p>The index of the &lsquo;name&rsquo; string.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aname</b></td><td>
-<p>The indexed <a href="ft2-sfnt_names.html#FT_SfntName">FT_SfntName</a> structure.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The &lsquo;string&rsquo; array returned in the &lsquo;aname&rsquo; structure is not null-terminated. The application should deallocate it if it is no longer in use.</p>
-<p>Use <a href="ft2-sfnt_names.html#FT_Get_Sfnt_Name_Count">FT_Get_Sfnt_Name_Count</a> to get the total number of available &lsquo;name&rsquo; table entries, then do a loop until you get the right platform, encoding, and name ID.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY">FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY</b>  <a href="ft2-basic_types.html#FT_MAKE_TAG">FT_MAKE_TAG</a>( 'i', 'g', 'p', 'f' )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A constant used as the tag of <a href="ft2-base_interface.html#FT_Parameter">FT_Parameter</a> structures to make FT_Open_Face() ignore preferred family subfamily names in &lsquo;name&rsquo; table since OpenType version 1.4. For backwards compatibility with legacy systems which has 4-face-per-family restriction.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY">FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY</b>  <a href="ft2-basic_types.html#FT_MAKE_TAG">FT_MAKE_TAG</a>( 'i', 'g', 'p', 's' )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A constant used as the tag of <a href="ft2-base_interface.html#FT_Parameter">FT_Parameter</a> structures to make FT_Open_Face() ignore preferred subfamily names in &lsquo;name&rsquo; table since OpenType version 1.4. For backwards compatibility with legacy systems which has 4-face-per-family restriction.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-sizes_management.html b/docs/reference/ft2-sizes_management.html
deleted file mode 100644 (file)
index 104957b..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Size Management
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_New_Size">FT_New_Size</a></td><td></td><td><a href="#FT_Done_Size">FT_Done_Size</a></td><td></td><td><a href="#FT_Activate_Size">FT_Activate_Size</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>When creating a new face object (e.g., with <a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a>), an <a href="ft2-base_interface.html#FT_Size">FT_Size</a> object is automatically created and used to store all pixel-size dependent information, available in the &lsquo;face-&gt;size&rsquo; field.</p>
-<p>It is however possible to create more sizes for a given face, mostly in order to manage several character pixel sizes of the same font family and style. See <a href="ft2-sizes_management.html#FT_New_Size">FT_New_Size</a> and <a href="ft2-sizes_management.html#FT_Done_Size">FT_Done_Size</a>.</p>
-<p>Note that <a href="ft2-base_interface.html#FT_Set_Pixel_Sizes">FT_Set_Pixel_Sizes</a> and <a href="ft2-base_interface.html#FT_Set_Char_Size">FT_Set_Char_Size</a> only modify the contents of the current &lsquo;active&rsquo; size; you thus need to use <a href="ft2-sizes_management.html#FT_Activate_Size">FT_Activate_Size</a> to change it.</p>
-<p>99% of applications won't need the functions provided here, especially if they use the caching sub-system, so be cautious when using these.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_New_Size">FT_New_Size</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SIZES_H (freetype/ftsizes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_New_Size</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face,
-               <a href="ft2-base_interface.html#FT_Size">FT_Size</a>*  size );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Create a new size object from a given face object.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to a parent face object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>asize</b></td><td>
-<p>A handle to a new size object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>You need to call <a href="ft2-sizes_management.html#FT_Activate_Size">FT_Activate_Size</a> in order to select the new size for upcoming calls to <a href="ft2-base_interface.html#FT_Set_Pixel_Sizes">FT_Set_Pixel_Sizes</a>, <a href="ft2-base_interface.html#FT_Set_Char_Size">FT_Set_Char_Size</a>, <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a>, <a href="ft2-base_interface.html#FT_Load_Char">FT_Load_Char</a>, etc.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Done_Size">FT_Done_Size</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SIZES_H (freetype/ftsizes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Done_Size</b>( <a href="ft2-base_interface.html#FT_Size">FT_Size</a>  size );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Discard a given size object. Note that <a href="ft2-base_interface.html#FT_Done_Face">FT_Done_Face</a> automatically discards all size objects allocated with <a href="ft2-sizes_management.html#FT_New_Size">FT_New_Size</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>size</b></td><td>
-<p>A handle to a target size object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Activate_Size">FT_Activate_Size</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SIZES_H (freetype/ftsizes.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Activate_Size</b>( <a href="ft2-base_interface.html#FT_Size">FT_Size</a>  size );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Even though it is possible to create several size objects for a given face (see <a href="ft2-sizes_management.html#FT_New_Size">FT_New_Size</a> for details), functions like <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a> or <a href="ft2-base_interface.html#FT_Load_Char">FT_Load_Char</a> only use the one which has been activated last to determine the &lsquo;current character pixel size&rsquo;.</p>
-<p>This function can be used to &lsquo;activate&rsquo; a previously created size object.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>size</b></td><td>
-<p>A handle to a target size object.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>If &lsquo;face&rsquo; is the size's parent face object, this function changes the value of &lsquo;face-&gt;size&rsquo; to the input size handle.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-system_interface.html b/docs/reference/ft2-system_interface.html
deleted file mode 100644 (file)
index 63b55b3..0000000
+++ /dev/null
@@ -1,415 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-System Interface
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_Memory">FT_Memory</a></td><td></td><td><a href="#FT_MemoryRec">FT_MemoryRec</a></td><td></td><td><a href="#FT_Stream_CloseFunc">FT_Stream_CloseFunc</a></td></tr>
-<tr><td></td><td><a href="#FT_Alloc_Func">FT_Alloc_Func</a></td><td></td><td><a href="#FT_Stream">FT_Stream</a></td><td></td><td><a href="#FT_StreamRec">FT_StreamRec</a></td></tr>
-<tr><td></td><td><a href="#FT_Free_Func">FT_Free_Func</a></td><td></td><td><a href="#FT_StreamDesc">FT_StreamDesc</a></td><td></td><td></td></tr>
-<tr><td></td><td><a href="#FT_Realloc_Func">FT_Realloc_Func</a></td><td></td><td><a href="#FT_Stream_IoFunc">FT_Stream_IoFunc</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains various definitions related to memory management and i/o access. You need to understand this information if you want to use a custom memory manager or you own i/o streams.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Memory">FT_Memory</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SYSTEM_H (freetype/ftsystem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_MemoryRec_*  <b>FT_Memory</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a given memory manager object, defined with an <a href="ft2-system_interface.html#FT_MemoryRec">FT_MemoryRec</a> structure.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Alloc_Func">FT_Alloc_Func</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SYSTEM_H (freetype/ftsystem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">void</span>*
-  (*<b>FT_Alloc_Func</b>)( <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a>  memory,
-                    <span class="keyword">long</span>       size );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to allocate &lsquo;size&rsquo; bytes from &lsquo;memory&rsquo;.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>memory</b></td><td>
-<p>A handle to the source memory manager.</p>
-</td></tr>
-<tr valign=top><td><b>size</b></td><td>
-<p>The size in bytes to allocate.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>Address of new memory block. 0&nbsp;in case of failure.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Free_Func">FT_Free_Func</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SYSTEM_H (freetype/ftsystem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">void</span>
-  (*<b>FT_Free_Func</b>)( <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a>  memory,
-                   <span class="keyword">void</span>*      block );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to release a given block of memory.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>memory</b></td><td>
-<p>A handle to the source memory manager.</p>
-</td></tr>
-<tr valign=top><td><b>block</b></td><td>
-<p>The address of the target memory block.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Realloc_Func">FT_Realloc_Func</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SYSTEM_H (freetype/ftsystem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">void</span>*
-  (*<b>FT_Realloc_Func</b>)( <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a>  memory,
-                      <span class="keyword">long</span>       cur_size,
-                      <span class="keyword">long</span>       new_size,
-                      <span class="keyword">void</span>*      block );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to re-allocate a given block of memory.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>memory</b></td><td>
-<p>A handle to the source memory manager.</p>
-</td></tr>
-<tr valign=top><td><b>cur_size</b></td><td>
-<p>The block's current size in bytes.</p>
-</td></tr>
-<tr valign=top><td><b>new_size</b></td><td>
-<p>The block's requested new size.</p>
-</td></tr>
-<tr valign=top><td><b>block</b></td><td>
-<p>The block's current address.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>New block address. 0&nbsp;in case of memory shortage.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>In case of error, the old block must still be available.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_MemoryRec">FT_MemoryRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SYSTEM_H (freetype/ftsystem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">struct</span>  FT_MemoryRec_
-  {
-    <span class="keyword">void</span>*            user;
-    <a href="ft2-system_interface.html#FT_Alloc_Func">FT_Alloc_Func</a>    alloc;
-    <a href="ft2-system_interface.html#FT_Free_Func">FT_Free_Func</a>     free;
-    <a href="ft2-system_interface.html#FT_Realloc_Func">FT_Realloc_Func</a>  realloc;
-  };
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to describe a given memory manager to FreeType&nbsp;2.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>user</b></td><td>
-<p>A generic typeless pointer for user data.</p>
-</td></tr>
-<tr valign=top><td><b>alloc</b></td><td>
-<p>A pointer type to an allocation function.</p>
-</td></tr>
-<tr valign=top><td><b>free</b></td><td>
-<p>A pointer type to an memory freeing function.</p>
-</td></tr>
-<tr valign=top><td><b>realloc</b></td><td>
-<p>A pointer type to a reallocation function.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stream">FT_Stream</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SYSTEM_H (freetype/ftsystem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_StreamRec_*  <b>FT_Stream</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to an input stream.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_StreamDesc">FT_StreamDesc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SYSTEM_H (freetype/ftsystem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">union</span>  FT_StreamDesc_
-  {
-    <span class="keyword">long</span>   value;
-    <span class="keyword">void</span>*  pointer;
-
-  } <b>FT_StreamDesc</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A union type used to store either a long or a pointer. This is used to store a file descriptor or a &lsquo;FILE*&rsquo; in an input stream.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stream_IoFunc">FT_Stream_IoFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SYSTEM_H (freetype/ftsystem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">long</span>
-  (*<b>FT_Stream_IoFunc</b>)( <a href="ft2-system_interface.html#FT_Stream">FT_Stream</a>       stream,
-                       <span class="keyword">unsigned</span> <span class="keyword">long</span>   offset,
-                       <span class="keyword">unsigned</span> <span class="keyword">char</span>*  buffer,
-                       <span class="keyword">unsigned</span> <span class="keyword">long</span>   count );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to seek and read data from a given input stream.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stream</b></td><td>
-<p>A handle to the source stream.</p>
-</td></tr>
-<tr valign=top><td><b>offset</b></td><td>
-<p>The offset of read in stream (always from start).</p>
-</td></tr>
-<tr valign=top><td><b>buffer</b></td><td>
-<p>The address of the read buffer.</p>
-</td></tr>
-<tr valign=top><td><b>count</b></td><td>
-<p>The number of bytes to read from the stream.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The number of bytes effectively read by the stream.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function might be called to perform a seek or skip operation with a &lsquo;count&rsquo; of&nbsp;0. A non-zero return value then indicates an error.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Stream_CloseFunc">FT_Stream_CloseFunc</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SYSTEM_H (freetype/ftsystem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">void</span>
-  (*<b>FT_Stream_CloseFunc</b>)( <a href="ft2-system_interface.html#FT_Stream">FT_Stream</a>  stream );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A function used to close a given input stream.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>stream</b></td><td>
-<p>A handle to the target stream.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_StreamRec">FT_StreamRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_SYSTEM_H (freetype/ftsystem.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_StreamRec_
-  {
-    <span class="keyword">unsigned</span> <span class="keyword">char</span>*       base;
-    <span class="keyword">unsigned</span> <span class="keyword">long</span>        size;
-    <span class="keyword">unsigned</span> <span class="keyword">long</span>        pos;
-
-    <a href="ft2-system_interface.html#FT_StreamDesc">FT_StreamDesc</a>        descriptor;
-    <a href="ft2-system_interface.html#FT_StreamDesc">FT_StreamDesc</a>        pathname;
-    <a href="ft2-system_interface.html#FT_Stream_IoFunc">FT_Stream_IoFunc</a>     read;
-    <a href="ft2-system_interface.html#FT_Stream_CloseFunc">FT_Stream_CloseFunc</a>  close;
-
-    <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a>            memory;
-    <span class="keyword">unsigned</span> <span class="keyword">char</span>*       cursor;
-    <span class="keyword">unsigned</span> <span class="keyword">char</span>*       limit;
-
-  } <b>FT_StreamRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to describe an input stream.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>base</b></td><td>
-<p>For memory-based streams, this is the address of the first stream byte in memory. This field should always be set to NULL for disk-based streams.</p>
-</td></tr>
-<tr valign=top><td><b>size</b></td><td>
-<p>The stream size in bytes.</p>
-</td></tr>
-<tr valign=top><td><b>pos</b></td><td>
-<p>The current position within the stream.</p>
-</td></tr>
-<tr valign=top><td><b>descriptor</b></td><td>
-<p>This field is a union that can hold an integer or a pointer. It is used by stream implementations to store file descriptors or &lsquo;FILE*&rsquo; pointers.</p>
-</td></tr>
-<tr valign=top><td><b>pathname</b></td><td>
-<p>This field is completely ignored by FreeType. However, it is often useful during debugging to use it to store the stream's filename (where available).</p>
-</td></tr>
-<tr valign=top><td><b>read</b></td><td>
-<p>The stream's input function.</p>
-</td></tr>
-<tr valign=top><td><b>close</b></td><td>
-<p>The stream's close function.</p>
-</td></tr>
-<tr valign=top><td><b>memory</b></td><td>
-<p>The memory manager to use to preload frames. This is set internally by FreeType and shouldn't be touched by stream implementations.</p>
-</td></tr>
-<tr valign=top><td><b>cursor</b></td><td>
-<p>This field is set and used internally by FreeType when parsing frames.</p>
-</td></tr>
-<tr valign=top><td><b>limit</b></td><td>
-<p>This field is set and used internally by FreeType when parsing frames.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-toc.html b/docs/reference/ft2-toc.html
deleted file mode 100644 (file)
index 9410b9e..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>Table of Contents</h1></center>
-<br><table align=center width="75%"><tr><td><h2>General Remarks</h2><ul class="empty"><li>
-<table cellpadding=5>
-<tr valign=top><td class="left">
-<a href="ft2-user_allocation.html">User allocation</a></td><td>
-<p>How client applications should allocate FreeType data structures.</p>
-</td></tr>
-</table>
-</li></ul></td></tr></table>
-<br><table align=center width="75%"><tr><td><h2>Core API</h2><ul class="empty"><li>
-<table cellpadding=5>
-<tr valign=top><td class="left">
-<a href="ft2-version.html">FreeType Version</a></td><td>
-<p>Functions and macros related to FreeType versions.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-basic_types.html">Basic Data Types</a></td><td>
-<p>The basic data types defined by the library.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-base_interface.html">Base Interface</a></td><td>
-<p>The FreeType&nbsp;2 base font interface.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-glyph_variants.html">Glyph Variants</a></td><td>
-<p>The FreeType&nbsp;2 interface to Unicode Ideographic Variation Sequences (IVS), using the SFNT cmap format&nbsp;14.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-glyph_management.html">Glyph Management</a></td><td>
-<p>Generic interface to manage individual glyph data.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-mac_specific.html">Mac Specific Interface</a></td><td>
-<p>Only available on the Macintosh.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-sizes_management.html">Size Management</a></td><td>
-<p>Managing multiple sizes per face.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-header_file_macros.html">Header File Macros</a></td><td>
-<p>Macro definitions used to #include specific header files.</p>
-</td></tr>
-</table>
-</li></ul></td></tr></table>
-<br><table align=center width="75%"><tr><td><h2>Format-Specific API</h2><ul class="empty"><li>
-<table cellpadding=5>
-<tr valign=top><td class="left">
-<a href="ft2-multiple_masters.html">Multiple Masters</a></td><td>
-<p>How to manage Multiple Masters fonts.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-truetype_tables.html">TrueType Tables</a></td><td>
-<p>TrueType specific table types and functions.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-type1_tables.html">Type 1 Tables</a></td><td>
-<p>Type&nbsp;1 (PostScript) specific font tables.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-sfnt_names.html">SFNT Names</a></td><td>
-<p>Access the names embedded in TrueType and OpenType files.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-bdf_fonts.html">BDF and PCF Files</a></td><td>
-<p>BDF and PCF specific API.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-cid_fonts.html">CID Fonts</a></td><td>
-<p>CID-keyed font specific API.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-pfr_fonts.html">PFR Fonts</a></td><td>
-<p>PFR/TrueDoc specific API.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-winfnt_fonts.html">Window FNT Files</a></td><td>
-<p>Windows FNT specific API.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-font_formats.html">Font Formats</a></td><td>
-<p>Getting the font format.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-gasp_table.html">Gasp Table</a></td><td>
-<p>Retrieving TrueType &lsquo;gasp&rsquo; table entries.</p>
-</td></tr>
-</table>
-</li></ul></td></tr></table>
-<br><table align=center width="75%"><tr><td><h2>Cache Sub-System</h2><ul class="empty"><li>
-<table cellpadding=5>
-<tr valign=top><td class="left">
-<a href="ft2-cache_subsystem.html">Cache Sub-System</a></td><td>
-<p>How to cache face, size, and glyph data with FreeType&nbsp;2.</p>
-</td></tr>
-</table>
-</li></ul></td></tr></table>
-<br><table align=center width="75%"><tr><td><h2>Support API</h2><ul class="empty"><li>
-<table cellpadding=5>
-<tr valign=top><td class="left">
-<a href="ft2-computations.html">Computations</a></td><td>
-<p>Crunching fixed numbers and vectors.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-list_processing.html">List Processing</a></td><td>
-<p>Simple management of lists.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-outline_processing.html">Outline Processing</a></td><td>
-<p>Functions to create, transform, and render vectorial glyph images.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-quick_advance.html">Quick retrieval of advance values</a></td><td>
-<p>Retrieve horizontal and vertical advance values without processing glyph outlines, if possible.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-bitmap_handling.html">Bitmap Handling</a></td><td>
-<p>Handling FT_Bitmap objects.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-raster.html">Scanline Converter</a></td><td>
-<p>How vectorial outlines are converted into bitmaps and pixmaps.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-glyph_stroker.html">Glyph Stroker</a></td><td>
-<p>Generating bordered and stroked glyphs.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-system_interface.html">System Interface</a></td><td>
-<p>How FreeType manages memory and i/o.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-module_management.html">Module Management</a></td><td>
-<p>How to add, upgrade, and remove modules from FreeType.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-gzip.html">GZIP Streams</a></td><td>
-<p>Using gzip-compressed font files.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-lzw.html">LZW Streams</a></td><td>
-<p>Using LZW-compressed font files.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-bzip2.html">BZIP2 Streams</a></td><td>
-<p>Using bzip2-compressed font files.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-lcd_filtering.html">LCD Filtering</a></td><td>
-<p>Reduce color fringes of LCD-optimized bitmaps.</p>
-</td></tr>
-</table>
-</li></ul></td></tr></table>
-<br><table align=center width="75%"><tr><td><h2>Miscellaneous</h2><ul class="empty"><li>
-<table cellpadding=5>
-<tr valign=top><td class="left">
-<a href="ft2-ot_validation.html">OpenType Validation</a></td><td>
-<p>An API to validate OpenType tables.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-incremental.html">Incremental Loading</a></td><td>
-<p>Custom Glyph Loading.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-truetype_engine.html">The TrueType Engine</a></td><td>
-<p>TrueType bytecode support.</p>
-</td></tr>
-<tr valign=top><td class="left">
-<a href="ft2-gx_validation.html">TrueTypeGX/AAT Validation</a></td><td>
-<p>An API to validate TrueTypeGX/AAT tables.</p>
-</td></tr>
-</table>
-</li></ul></td></tr></table>
-<br><table align=center width="75%"><tr><td><h2><a href="ft2-index.html">Global Index</a></h2><ul class="empty"><li></li></ul></td></tr></table>
-<hr>
-<table><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-</tr></table>
-
-<center><font size=-2>generated on Thu Mar  8 21:09:06 2012</font></center></body>
-</html>
diff --git a/docs/reference/ft2-truetype_engine.html b/docs/reference/ft2-truetype_engine.html
deleted file mode 100644 (file)
index 02c67e9..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-The TrueType Engine
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_TrueTypeEngineType">FT_TrueTypeEngineType</a></td><td></td><td><a href="#FT_Get_TrueType_Engine_Type">FT_Get_TrueType_Engine_Type</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains a function used to query the level of TrueType bytecode support compiled in this version of the library.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_TrueTypeEngineType">FT_TrueTypeEngineType</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MODULE_H (freetype/ftmodapi.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_TrueTypeEngineType_
-  {
-    <a href="ft2-truetype_engine.html#FT_TrueTypeEngineType">FT_TRUETYPE_ENGINE_TYPE_NONE</a> = 0,
-    <a href="ft2-truetype_engine.html#FT_TrueTypeEngineType">FT_TRUETYPE_ENGINE_TYPE_UNPATENTED</a>,
-    <a href="ft2-truetype_engine.html#FT_TrueTypeEngineType">FT_TRUETYPE_ENGINE_TYPE_PATENTED</a>
-
-  } <b>FT_TrueTypeEngineType</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of values describing which kind of TrueType bytecode engine is implemented in a given FT_Library instance. It is used by the <a href="ft2-truetype_engine.html#FT_Get_TrueType_Engine_Type">FT_Get_TrueType_Engine_Type</a> function.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td colspan=0><b>FT_TRUETYPE_ENGINE_TYPE_NONE</b></td></tr>
-<tr valign=top><td></td><td>
-<p>The library doesn't implement any kind of bytecode interpreter.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_TRUETYPE_ENGINE_TYPE_UNPATENTED</b></td></tr>
-<tr valign=top><td></td><td>
-<p>The library implements a bytecode interpreter that doesn't support the patented operations of the TrueType virtual machine.</p>
-<p>Its main use is to load certain Asian fonts which position and scale glyph components with bytecode instructions. It produces bad output for most other fonts.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>FT_TRUETYPE_ENGINE_TYPE_PATENTED</b></td></tr>
-<tr valign=top><td></td><td>
-<p>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).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.2</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_TrueType_Engine_Type">FT_Get_TrueType_Engine_Type</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_MODULE_H (freetype/ftmodapi.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-truetype_engine.html#FT_TrueTypeEngineType">FT_TrueTypeEngineType</a> )
-  <b>FT_Get_TrueType_Engine_Type</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return an <a href="ft2-truetype_engine.html#FT_TrueTypeEngineType">FT_TrueTypeEngineType</a> value to indicate which level of the TrueType virtual machine a given library instance supports.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A library instance.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>A value indicating which level is supported.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.2</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-truetype_tables.html b/docs/reference/ft2-truetype_tables.html
deleted file mode 100644 (file)
index a57ba4f..0000000
+++ /dev/null
@@ -1,1223 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-TrueType Tables
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#TT_PLATFORM_XXX">TT_PLATFORM_XXX</a></td><td></td><td><a href="#TT_Postscript">TT_Postscript</a></td></tr>
-<tr><td></td><td><a href="#TT_APPLE_ID_XXX">TT_APPLE_ID_XXX</a></td><td></td><td><a href="#TT_PCLT">TT_PCLT</a></td></tr>
-<tr><td></td><td><a href="#TT_MAC_ID_XXX">TT_MAC_ID_XXX</a></td><td></td><td><a href="#TT_MaxProfile">TT_MaxProfile</a></td></tr>
-<tr><td></td><td><a href="#TT_ISO_ID_XXX">TT_ISO_ID_XXX</a></td><td></td><td><a href="#FT_Sfnt_Tag">FT_Sfnt_Tag</a></td></tr>
-<tr><td></td><td><a href="#TT_MS_ID_XXX">TT_MS_ID_XXX</a></td><td></td><td><a href="#FT_Get_Sfnt_Table">FT_Get_Sfnt_Table</a></td></tr>
-<tr><td></td><td><a href="#TT_ADOBE_ID_XXX">TT_ADOBE_ID_XXX</a></td><td></td><td><a href="#FT_Load_Sfnt_Table">FT_Load_Sfnt_Table</a></td></tr>
-<tr><td></td><td><a href="#TT_Header">TT_Header</a></td><td></td><td><a href="#FT_Sfnt_Table_Info">FT_Sfnt_Table_Info</a></td></tr>
-<tr><td></td><td><a href="#TT_HoriHeader">TT_HoriHeader</a></td><td></td><td><a href="#FT_Get_CMap_Language_ID">FT_Get_CMap_Language_ID</a></td></tr>
-<tr><td></td><td><a href="#TT_VertHeader">TT_VertHeader</a></td><td></td><td><a href="#FT_Get_CMap_Format">FT_Get_CMap_Format</a></td></tr>
-<tr><td></td><td><a href="#TT_OS2">TT_OS2</a></td><td></td><td><a href="#FT_PARAM_TAG_UNPATENTED_HINTING">FT_PARAM_TAG_UNPATENTED_HINTING</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains the definition of TrueType-specific tables as well as some routines used to access and process them.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="TT_PLATFORM_XXX">TT_PLATFORM_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_APPLE_UNICODE</a>  0
-#define <a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_MACINTOSH</a>      1
-#define <a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_ISO</a>            2 /* deprecated */
-#define <a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_MICROSOFT</a>      3
-#define <a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_CUSTOM</a>         4
-#define <a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_ADOBE</a>          7 /* artificial */
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of valid values for the &lsquo;platform_id&rsquo; identifier code in <a href="ft2-base_interface.html#FT_CharMapRec">FT_CharMapRec</a> and <a href="ft2-sfnt_names.html#FT_SfntName">FT_SfntName</a> structures.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td colspan=0><b>TT_PLATFORM_APPLE_UNICODE</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Used by Apple to indicate a Unicode character map and/or name entry. See <a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_XXX</a> for corresponding &lsquo;encoding_id&rsquo; values. Note that name entries in this format are coded as big-endian UCS-2 character codes <i>only</i>.</p>
-</td></tr>
-<tr valign=top><td><b>TT_PLATFORM_MACINTOSH</b></td><td>
-<p>Used by Apple to indicate a MacOS-specific charmap and/or name entry. See <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_XXX</a> for corresponding &lsquo;encoding_id&rsquo; values. Note that most TrueType fonts contain an Apple roman charmap to be usable on MacOS systems (even if they contain a Microsoft charmap as well).</p>
-</td></tr>
-<tr valign=top><td><b>TT_PLATFORM_ISO</b></td><td>
-<p>This value was used to specify ISO/IEC 10646 charmaps. It is however now deprecated. See <a href="ft2-truetype_tables.html#TT_ISO_ID_XXX">TT_ISO_ID_XXX</a> for a list of corresponding &lsquo;encoding_id&rsquo; values.</p>
-</td></tr>
-<tr valign=top><td><b>TT_PLATFORM_MICROSOFT</b></td><td>
-<p>Used by Microsoft to indicate Windows-specific charmaps. See <a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_XXX</a> for a list of corresponding &lsquo;encoding_id&rsquo; values. Note that most fonts contain a Unicode charmap using (TT_PLATFORM_MICROSOFT, <a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_UNICODE_CS</a>).</p>
-</td></tr>
-<tr valign=top><td><b>TT_PLATFORM_CUSTOM</b></td><td>
-<p>Used to indicate application-specific charmaps.</p>
-</td></tr>
-<tr valign=top><td><b>TT_PLATFORM_ADOBE</b></td><td>
-<p>This value isn't part of any font format specification, but is used by FreeType to report Adobe-specific charmaps in an <a href="ft2-base_interface.html#FT_CharMapRec">FT_CharMapRec</a> structure. See <a href="ft2-truetype_tables.html#TT_ADOBE_ID_XXX">TT_ADOBE_ID_XXX</a>.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="TT_APPLE_ID_XXX">TT_APPLE_ID_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_DEFAULT</a>           0 /* Unicode 1.0 */
-#define <a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_UNICODE_1_1</a>       1 /* specify Hangul at U+34xx */
-#define <a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_ISO_10646</a>         2 /* deprecated */
-#define <a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_UNICODE_2_0</a>       3 /* or later */
-#define <a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_UNICODE_32</a>        4 /* 2.0 or later, full repertoire */
-#define <a href="ft2-truetype_tables.html#TT_APPLE_ID_XXX">TT_APPLE_ID_VARIANT_SELECTOR</a>  5 /* variation selector data */
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of valid values for the &lsquo;encoding_id&rsquo; for <a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_APPLE_UNICODE</a> charmaps and name entries.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>TT_APPLE_ID_DEFAULT</b></td><td>
-<p>Unicode version 1.0.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>TT_APPLE_ID_UNICODE_1_1</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Unicode 1.1; specifies Hangul characters starting at U+34xx.</p>
-</td></tr>
-<tr valign=top><td><b>TT_APPLE_ID_ISO_10646</b></td><td>
-<p>Deprecated (identical to preceding).</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>TT_APPLE_ID_UNICODE_2_0</b></td></tr>
-<tr valign=top><td></td><td>
-<p>Unicode 2.0 and beyond (UTF-16 BMP only).</p>
-</td></tr>
-<tr valign=top><td><b>TT_APPLE_ID_UNICODE_32</b></td><td>
-<p>Unicode 3.1 and beyond, using UTF-32.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>TT_APPLE_ID_VARIANT_SELECTOR</b></td></tr>
-<tr valign=top><td></td><td>
-<p>From Adobe, not Apple. Not a normal cmap. Specifies variations on a real cmap.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="TT_MAC_ID_XXX">TT_MAC_ID_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_ROMAN</a>                 0
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_JAPANESE</a>              1
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_TRADITIONAL_CHINESE</a>   2
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_KOREAN</a>                3
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_ARABIC</a>                4
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_HEBREW</a>                5
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_GREEK</a>                 6
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_RUSSIAN</a>               7
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_RSYMBOL</a>               8
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_DEVANAGARI</a>            9
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_GURMUKHI</a>             10
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_GUJARATI</a>             11
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_ORIYA</a>                12
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_BENGALI</a>              13
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_TAMIL</a>                14
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_TELUGU</a>               15
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_KANNADA</a>              16
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_MALAYALAM</a>            17
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_SINHALESE</a>            18
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_BURMESE</a>              19
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_KHMER</a>                20
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_THAI</a>                 21
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_LAOTIAN</a>              22
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_GEORGIAN</a>             23
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_ARMENIAN</a>             24
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_MALDIVIAN</a>            25
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_SIMPLIFIED_CHINESE</a>   25
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_TIBETAN</a>              26
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_MONGOLIAN</a>            27
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_GEEZ</a>                 28
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_SLAVIC</a>               29
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_VIETNAMESE</a>           30
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_SINDHI</a>               31
-#define <a href="ft2-truetype_tables.html#TT_MAC_ID_XXX">TT_MAC_ID_UNINTERP</a>             32
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of valid values for the &lsquo;encoding_id&rsquo; for <a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_MACINTOSH</a> charmaps and name entries.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>TT_MAC_ID_ROMAN</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_JAPANESE</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td colspan=0><b>TT_MAC_ID_TRADITIONAL_CHINESE</b></td></tr>
-<tr valign=top><td></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_KOREAN</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_ARABIC</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_HEBREW</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_GREEK</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_RUSSIAN</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_RSYMBOL</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_DEVANAGARI</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_GURMUKHI</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_GUJARATI</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_ORIYA</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_BENGALI</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_TAMIL</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_TELUGU</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_KANNADA</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_MALAYALAM</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_SINHALESE</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_BURMESE</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_KHMER</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_THAI</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_LAOTIAN</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_GEORGIAN</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_ARMENIAN</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_MALDIVIAN</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td colspan=0><b>TT_MAC_ID_SIMPLIFIED_CHINESE</b></td></tr>
-<tr valign=top><td></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_TIBETAN</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_MONGOLIAN</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_GEEZ</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_SLAVIC</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_VIETNAMESE</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_SINDHI</b></td><td>
-<p></p>
-</td></tr>
-<tr valign=top><td><b>TT_MAC_ID_UNINTERP</b></td><td>
-<p></p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="TT_ISO_ID_XXX">TT_ISO_ID_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-truetype_tables.html#TT_ISO_ID_XXX">TT_ISO_ID_7BIT_ASCII</a>  0
-#define <a href="ft2-truetype_tables.html#TT_ISO_ID_XXX">TT_ISO_ID_10646</a>       1
-#define <a href="ft2-truetype_tables.html#TT_ISO_ID_XXX">TT_ISO_ID_8859_1</a>      2
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of valid values for the &lsquo;encoding_id&rsquo; for <a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_ISO</a> charmaps and name entries.</p>
-<p>Their use is now deprecated.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>TT_ISO_ID_7BIT_ASCII</b></td><td>
-<p>ASCII.</p>
-</td></tr>
-<tr valign=top><td><b>TT_ISO_ID_10646</b></td><td>
-<p>ISO/10646.</p>
-</td></tr>
-<tr valign=top><td><b>TT_ISO_ID_8859_1</b></td><td>
-<p>Also known as Latin-1.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="TT_MS_ID_XXX">TT_MS_ID_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_SYMBOL_CS</a>    0
-#define <a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_UNICODE_CS</a>   1
-#define <a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_SJIS</a>         2
-#define <a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_GB2312</a>       3
-#define <a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_BIG_5</a>        4
-#define <a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_WANSUNG</a>      5
-#define <a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_JOHAB</a>        6
-#define <a href="ft2-truetype_tables.html#TT_MS_ID_XXX">TT_MS_ID_UCS_4</a>       10
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of valid values for the &lsquo;encoding_id&rsquo; for <a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_MICROSOFT</a> charmaps and name entries.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>TT_MS_ID_SYMBOL_CS</b></td><td>
-<p>Corresponds to Microsoft symbol encoding. See <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_SYMBOL</a>.</p>
-</td></tr>
-<tr valign=top><td><b>TT_MS_ID_UNICODE_CS</b></td><td>
-<p>Corresponds to a Microsoft WGL4 charmap, matching Unicode. See <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_UNICODE</a>.</p>
-</td></tr>
-<tr valign=top><td><b>TT_MS_ID_SJIS</b></td><td>
-<p>Corresponds to SJIS Japanese encoding. See <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_SJIS</a>.</p>
-</td></tr>
-<tr valign=top><td><b>TT_MS_ID_GB2312</b></td><td>
-<p>Corresponds to Simplified Chinese as used in Mainland China. See <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_GB2312</a>.</p>
-</td></tr>
-<tr valign=top><td><b>TT_MS_ID_BIG_5</b></td><td>
-<p>Corresponds to Traditional Chinese as used in Taiwan and Hong Kong. See <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_BIG5</a>.</p>
-</td></tr>
-<tr valign=top><td><b>TT_MS_ID_WANSUNG</b></td><td>
-<p>Corresponds to Korean Wansung encoding. See <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_WANSUNG</a>.</p>
-</td></tr>
-<tr valign=top><td><b>TT_MS_ID_JOHAB</b></td><td>
-<p>Corresponds to Johab encoding. See <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_JOHAB</a>.</p>
-</td></tr>
-<tr valign=top><td><b>TT_MS_ID_UCS_4</b></td><td>
-<p>Corresponds to UCS-4 or UTF-32 charmaps. This has been added to the OpenType specification version 1.4 (mid-2001.)</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="TT_ADOBE_ID_XXX">TT_ADOBE_ID_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-truetype_tables.html#TT_ADOBE_ID_XXX">TT_ADOBE_ID_STANDARD</a>  0
-#define <a href="ft2-truetype_tables.html#TT_ADOBE_ID_XXX">TT_ADOBE_ID_EXPERT</a>    1
-#define <a href="ft2-truetype_tables.html#TT_ADOBE_ID_XXX">TT_ADOBE_ID_CUSTOM</a>    2
-#define <a href="ft2-truetype_tables.html#TT_ADOBE_ID_XXX">TT_ADOBE_ID_LATIN_1</a>   3
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of valid values for the &lsquo;encoding_id&rsquo; for <a href="ft2-truetype_tables.html#TT_PLATFORM_XXX">TT_PLATFORM_ADOBE</a> charmaps. This is a FreeType-specific extension!</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>TT_ADOBE_ID_STANDARD</b></td><td>
-<p>Adobe standard encoding.</p>
-</td></tr>
-<tr valign=top><td><b>TT_ADOBE_ID_EXPERT</b></td><td>
-<p>Adobe expert encoding.</p>
-</td></tr>
-<tr valign=top><td><b>TT_ADOBE_ID_CUSTOM</b></td><td>
-<p>Adobe custom encoding.</p>
-</td></tr>
-<tr valign=top><td><b>TT_ADOBE_ID_LATIN_1</b></td><td>
-<p>Adobe Latin&nbsp;1 encoding.</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="TT_Header">TT_Header</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  TT_Header_
-  {
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>   Table_Version;
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>   Font_Revision;
-
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>    CheckSum_Adjust;
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>    Magic_Number;
-
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  Flags;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  Units_Per_EM;
-
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>    Created [2];
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>    Modified[2];
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   xMin;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   yMin;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   xMax;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   yMax;
-
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  Mac_Style;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  Lowest_Rec_PPEM;
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   Font_Direction;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   Index_To_Loc_Format;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   Glyph_Data_Format;
-
-  } <b>TT_Header</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model a TrueType font header table. All fields follow the TrueType specification.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="TT_HoriHeader">TT_HoriHeader</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  TT_HoriHeader_
-  {
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>   Version;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   Ascender;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   Descender;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   Line_Gap;
-
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  advance_Width_Max;      /* advance width maximum */
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   min_Left_Side_Bearing;  /* minimum left-sb       */
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   min_Right_Side_Bearing; /* minimum right-sb      */
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   xMax_Extent;            /* xmax extents          */
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   caret_Slope_Rise;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   caret_Slope_Run;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   caret_Offset;
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   Reserved[4];
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   metric_Data_Format;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  number_Of_HMetrics;
-
-    /* The following fields are not defined by the TrueType specification */
-    /* but they are used to connect the metrics header to the relevant    */
-    /* `HMTX' table.                                                      */
-
-    <span class="keyword">void</span>*      long_metrics;
-    <span class="keyword">void</span>*      short_metrics;
-
-  } <b>TT_HoriHeader</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model a TrueType horizontal header, the &lsquo;hhea&rsquo; table, as well as the corresponding horizontal metrics table, i.e., the &lsquo;hmtx&rsquo; table.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>Version</b></td><td>
-<p>The table version.</p>
-</td></tr>
-<tr valign=top><td><b>Ascender</b></td><td>
-<p>The font's ascender, i.e., the distance from the baseline to the top-most of all glyph points found in the font.</p>
-<p>This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII).</p>
-<p>You should use the &lsquo;sTypoAscender&rsquo; field of the OS/2 table instead if you want the correct one.</p>
-</td></tr>
-<tr valign=top><td><b>Descender</b></td><td>
-<p>The font's descender, i.e., the distance from the baseline to the bottom-most of all glyph points found in the font. It is negative.</p>
-<p>This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII).</p>
-<p>You should use the &lsquo;sTypoDescender&rsquo; field of the OS/2 table instead if you want the correct one.</p>
-</td></tr>
-<tr valign=top><td><b>Line_Gap</b></td><td>
-<p>The font's line gap, i.e., the distance to add to the ascender and descender to get the BTB, i.e., the baseline-to-baseline distance for the font.</p>
-</td></tr>
-<tr valign=top><td><b>advance_Width_Max</b></td><td>
-<p>This field is the maximum of all advance widths found in the font. It can be used to compute the maximum width of an arbitrary string of text.</p>
-</td></tr>
-<tr valign=top><td><b>min_Left_Side_Bearing</b></td><td>
-<p>The minimum left side bearing of all glyphs within the font.</p>
-</td></tr>
-<tr valign=top><td><b>min_Right_Side_Bearing</b></td><td>
-<p>The minimum right side bearing of all glyphs within the font.</p>
-</td></tr>
-<tr valign=top><td><b>xMax_Extent</b></td><td>
-<p>The maximum horizontal extent (i.e., the &lsquo;width&rsquo; of a glyph's bounding box) for all glyphs in the font.</p>
-</td></tr>
-<tr valign=top><td><b>caret_Slope_Rise</b></td><td>
-<p>The rise coefficient of the cursor's slope of the cursor (slope=rise/run).</p>
-</td></tr>
-<tr valign=top><td><b>caret_Slope_Run</b></td><td>
-<p>The run coefficient of the cursor's slope.</p>
-</td></tr>
-<tr valign=top><td><b>Reserved</b></td><td>
-<p>8&nbsp;reserved bytes.</p>
-</td></tr>
-<tr valign=top><td><b>metric_Data_Format</b></td><td>
-<p>Always&nbsp;0.</p>
-</td></tr>
-<tr valign=top><td><b>number_Of_HMetrics</b></td><td>
-<p>Number of HMetrics entries in the &lsquo;hmtx&rsquo; table -- this value can be smaller than the total number of glyphs in the font.</p>
-</td></tr>
-<tr valign=top><td><b>long_metrics</b></td><td>
-<p>A pointer into the &lsquo;hmtx&rsquo; table.</p>
-</td></tr>
-<tr valign=top><td><b>short_metrics</b></td><td>
-<p>A pointer into the &lsquo;hmtx&rsquo; table.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should be identical except for the names of their fields which are different.</p>
-<p>This ensures that a single function in the &lsquo;ttload&rsquo; module is able to read both the horizontal and vertical headers.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="TT_VertHeader">TT_VertHeader</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  TT_VertHeader_
-  {
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>   Version;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   Ascender;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   Descender;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   Line_Gap;
-
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  advance_Height_Max;      /* advance height maximum */
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   min_Top_Side_Bearing;    /* minimum left-sb or top-sb       */
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb   */
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   yMax_Extent;             /* xmax or ymax extents            */
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   caret_Slope_Rise;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   caret_Slope_Run;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   caret_Offset;
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   Reserved[4];
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   metric_Data_Format;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  number_Of_VMetrics;
-
-    /* The following fields are not defined by the TrueType specification */
-    /* but they're used to connect the metrics header to the relevant     */
-    /* `HMTX' or `VMTX' table.                                            */
-
-    <span class="keyword">void</span>*      long_metrics;
-    <span class="keyword">void</span>*      short_metrics;
-
-  } <b>TT_VertHeader</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model a TrueType vertical header, the &lsquo;vhea&rsquo; table, as well as the corresponding vertical metrics table, i.e., the &lsquo;vmtx&rsquo; table.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>Version</b></td><td>
-<p>The table version.</p>
-</td></tr>
-<tr valign=top><td><b>Ascender</b></td><td>
-<p>The font's ascender, i.e., the distance from the baseline to the top-most of all glyph points found in the font.</p>
-<p>This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII).</p>
-<p>You should use the &lsquo;sTypoAscender&rsquo; field of the OS/2 table instead if you want the correct one.</p>
-</td></tr>
-<tr valign=top><td><b>Descender</b></td><td>
-<p>The font's descender, i.e., the distance from the baseline to the bottom-most of all glyph points found in the font. It is negative.</p>
-<p>This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII).</p>
-<p>You should use the &lsquo;sTypoDescender&rsquo; field of the OS/2 table instead if you want the correct one.</p>
-</td></tr>
-<tr valign=top><td><b>Line_Gap</b></td><td>
-<p>The font's line gap, i.e., the distance to add to the ascender and descender to get the BTB, i.e., the baseline-to-baseline distance for the font.</p>
-</td></tr>
-<tr valign=top><td><b>advance_Height_Max</b></td><td>
-<p>This field is the maximum of all advance heights found in the font. It can be used to compute the maximum height of an arbitrary string of text.</p>
-</td></tr>
-<tr valign=top><td><b>min_Top_Side_Bearing</b></td><td>
-<p>The minimum top side bearing of all glyphs within the font.</p>
-</td></tr>
-<tr valign=top><td colspan=0><b>min_Bottom_Side_Bearing</b></td></tr>
-<tr valign=top><td></td><td>
-<p>The minimum bottom side bearing of all glyphs within the font.</p>
-</td></tr>
-<tr valign=top><td><b>yMax_Extent</b></td><td>
-<p>The maximum vertical extent (i.e., the &lsquo;height&rsquo; of a glyph's bounding box) for all glyphs in the font.</p>
-</td></tr>
-<tr valign=top><td><b>caret_Slope_Rise</b></td><td>
-<p>The rise coefficient of the cursor's slope of the cursor (slope=rise/run).</p>
-</td></tr>
-<tr valign=top><td><b>caret_Slope_Run</b></td><td>
-<p>The run coefficient of the cursor's slope.</p>
-</td></tr>
-<tr valign=top><td><b>caret_Offset</b></td><td>
-<p>The cursor's offset for slanted fonts. This value is &lsquo;reserved&rsquo; in vmtx version 1.0.</p>
-</td></tr>
-<tr valign=top><td><b>Reserved</b></td><td>
-<p>8&nbsp;reserved bytes.</p>
-</td></tr>
-<tr valign=top><td><b>metric_Data_Format</b></td><td>
-<p>Always&nbsp;0.</p>
-</td></tr>
-<tr valign=top><td><b>number_Of_HMetrics</b></td><td>
-<p>Number of VMetrics entries in the &lsquo;vmtx&rsquo; table -- this value can be smaller than the total number of glyphs in the font.</p>
-</td></tr>
-<tr valign=top><td><b>long_metrics</b></td><td>
-<p>A pointer into the &lsquo;vmtx&rsquo; table.</p>
-</td></tr>
-<tr valign=top><td><b>short_metrics</b></td><td>
-<p>A pointer into the &lsquo;vmtx&rsquo; table.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should be identical except for the names of their fields which are different.</p>
-<p>This ensures that a single function in the &lsquo;ttload&rsquo; module is able to read both the horizontal and vertical headers.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="TT_OS2">TT_OS2</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  TT_OS2_
-  {
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  version;                /* 0x0001 - more or 0xFFFF */
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   xAvgCharWidth;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  usWeightClass;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  usWidthClass;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   fsType;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   ySubscriptXSize;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   ySubscriptYSize;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   ySubscriptXOffset;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   ySubscriptYOffset;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   ySuperscriptXSize;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   ySuperscriptYSize;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   ySuperscriptXOffset;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   ySuperscriptYOffset;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   yStrikeoutSize;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   yStrikeoutPosition;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   sFamilyClass;
-
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    panose[10];
-
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   ulUnicodeRange1;        /* Bits 0-31   */
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   ulUnicodeRange2;        /* Bits 32-63  */
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   ulUnicodeRange3;        /* Bits 64-95  */
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   ulUnicodeRange4;        /* Bits 96-127 */
-
-    <a href="ft2-basic_types.html#FT_Char">FT_Char</a>    achVendID[4];
-
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  fsSelection;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  usFirstCharIndex;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  usLastCharIndex;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   sTypoAscender;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   sTypoDescender;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   sTypoLineGap;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  usWinAscent;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  usWinDescent;
-
-    /* only version 1 tables: */
-
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   ulCodePageRange1;       /* Bits 0-31   */
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   ulCodePageRange2;       /* Bits 32-63  */
-
-    /* only version 2 tables: */
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   sxHeight;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   sCapHeight;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  usDefaultChar;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  usBreakChar;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  usMaxContext;
-
-  } <b>TT_OS2</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model a TrueType OS/2 table. This is the long table version. All fields comply to the TrueType specification.</p>
-<p>Note that we now support old Mac fonts which do not include an OS/2 table. In this case, the &lsquo;version&rsquo; field is always set to 0xFFFF.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="TT_Postscript">TT_Postscript</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  TT_Postscript_
-  {
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>  FormatType;
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>  italicAngle;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>  underlinePosition;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>  underlineThickness;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  isFixedPitch;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  minMemType42;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  maxMemType42;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  minMemType1;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  maxMemType1;
-
-    /* Glyph names follow in the file, but we don't   */
-    /* load them by default.  See the ttpost.c file.  */
-
-  } <b>TT_Postscript</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model a TrueType PostScript table. All fields comply to the TrueType specification. This structure does not reference the PostScript glyph names, which can be nevertheless accessed with the &lsquo;ttpost&rsquo; module.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="TT_PCLT">TT_PCLT</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  TT_PCLT_
-  {
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>   Version;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   FontNumber;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  Pitch;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  xHeight;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  Style;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  TypeFamily;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  CapHeight;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  SymbolSet;
-    <a href="ft2-basic_types.html#FT_Char">FT_Char</a>    TypeFace[16];
-    <a href="ft2-basic_types.html#FT_Char">FT_Char</a>    CharacterComplement[8];
-    <a href="ft2-basic_types.html#FT_Char">FT_Char</a>    FileName[6];
-    <a href="ft2-basic_types.html#FT_Char">FT_Char</a>    StrokeWeight;
-    <a href="ft2-basic_types.html#FT_Char">FT_Char</a>    WidthType;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    SerifStyle;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    Reserved;
-
-  } <b>TT_PCLT</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model a TrueType PCLT table. All fields comply to the TrueType specification.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="TT_MaxProfile">TT_MaxProfile</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  TT_MaxProfile_
-  {
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>   version;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  numGlyphs;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  maxPoints;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  maxContours;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  maxCompositePoints;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  maxCompositeContours;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  maxZones;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  maxTwilightPoints;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  maxStorage;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  maxFunctionDefs;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  maxInstructionDefs;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  maxStackElements;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  maxSizeOfInstructions;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  maxComponentElements;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  maxComponentDepth;
-
-  } <b>TT_MaxProfile</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>The maximum profile is a table containing many max values which can be used to pre-allocate arrays. This ensures that no memory allocation occurs during a glyph load.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>version</b></td><td>
-<p>The version number.</p>
-</td></tr>
-<tr valign=top><td><b>numGlyphs</b></td><td>
-<p>The number of glyphs in this TrueType font.</p>
-</td></tr>
-<tr valign=top><td><b>maxPoints</b></td><td>
-<p>The maximum number of points in a non-composite TrueType glyph. See also the structure element &lsquo;maxCompositePoints&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>maxContours</b></td><td>
-<p>The maximum number of contours in a non-composite TrueType glyph. See also the structure element &lsquo;maxCompositeContours&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>maxCompositePoints</b></td><td>
-<p>The maximum number of points in a composite TrueType glyph. See also the structure element &lsquo;maxPoints&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>maxCompositeContours</b></td><td>
-<p>The maximum number of contours in a composite TrueType glyph. See also the structure element &lsquo;maxContours&rsquo;.</p>
-</td></tr>
-<tr valign=top><td><b>maxZones</b></td><td>
-<p>The maximum number of zones used for glyph hinting.</p>
-</td></tr>
-<tr valign=top><td><b>maxTwilightPoints</b></td><td>
-<p>The maximum number of points in the twilight zone used for glyph hinting.</p>
-</td></tr>
-<tr valign=top><td><b>maxStorage</b></td><td>
-<p>The maximum number of elements in the storage area used for glyph hinting.</p>
-</td></tr>
-<tr valign=top><td><b>maxFunctionDefs</b></td><td>
-<p>The maximum number of function definitions in the TrueType bytecode for this font.</p>
-</td></tr>
-<tr valign=top><td><b>maxInstructionDefs</b></td><td>
-<p>The maximum number of instruction definitions in the TrueType bytecode for this font.</p>
-</td></tr>
-<tr valign=top><td><b>maxStackElements</b></td><td>
-<p>The maximum number of stack elements used during bytecode interpretation.</p>
-</td></tr>
-<tr valign=top><td><b>maxSizeOfInstructions</b></td><td>
-<p>The maximum number of TrueType opcodes used for glyph hinting.</p>
-</td></tr>
-<tr valign=top><td><b>maxComponentElements</b></td><td>
-<p>The maximum number of simple (i.e., non- composite) glyphs in a composite glyph.</p>
-</td></tr>
-<tr valign=top><td><b>maxComponentDepth</b></td><td>
-<p>The maximum nesting depth of composite glyphs.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This structure is only used during font loading.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Sfnt_Tag">FT_Sfnt_Tag</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_Sfnt_Tag_
-  {
-    ft_sfnt_head = 0,    /* <a href="ft2-truetype_tables.html#TT_Header">TT_Header</a>     */
-    ft_sfnt_maxp = 1,    /* <a href="ft2-truetype_tables.html#TT_MaxProfile">TT_MaxProfile</a> */
-    ft_sfnt_os2  = 2,    /* <a href="ft2-truetype_tables.html#TT_OS2">TT_OS2</a>        */
-    ft_sfnt_hhea = 3,    /* <a href="ft2-truetype_tables.html#TT_HoriHeader">TT_HoriHeader</a> */
-    ft_sfnt_vhea = 4,    /* <a href="ft2-truetype_tables.html#TT_VertHeader">TT_VertHeader</a> */
-    ft_sfnt_post = 5,    /* <a href="ft2-truetype_tables.html#TT_Postscript">TT_Postscript</a> */
-    ft_sfnt_pclt = 6,    /* <a href="ft2-truetype_tables.html#TT_PCLT">TT_PCLT</a>       */
-
-    sfnt_max   /* internal end mark */
-
-  } <b>FT_Sfnt_Tag</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An enumeration used to specify the index of an SFNT table. Used in the <a href="ft2-truetype_tables.html#FT_Get_Sfnt_Table">FT_Get_Sfnt_Table</a> API function.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_Sfnt_Table">FT_Get_Sfnt_Table</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span>* )
-  <b>FT_Get_Sfnt_Table</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>      face,
-                     <a href="ft2-truetype_tables.html#FT_Sfnt_Tag">FT_Sfnt_Tag</a>  tag );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return a pointer to a given SFNT table within a face.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source.</p>
-</td></tr>
-<tr valign=top><td><b>tag</b></td><td>
-<p>The index of the SFNT table.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>A type-less pointer to the table. This will be&nbsp;0 in case of error, or if the corresponding table was not found <b>OR</b> loaded from the file.</p>
-<p>Use a typecast according to &lsquo;tag&rsquo; to access the structure elements.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The table is owned by the face object and disappears with it.</p>
-<p>This function is only useful to access SFNT tables that are loaded by the sfnt, truetype, and opentype drivers. See <a href="ft2-truetype_tables.html#FT_Sfnt_Tag">FT_Sfnt_Tag</a> for a list.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Load_Sfnt_Table">FT_Load_Sfnt_Table</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Load_Sfnt_Table</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>    face,
-                      <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   tag,
-                      <a href="ft2-basic_types.html#FT_Long">FT_Long</a>    offset,
-                      <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>*   buffer,
-                      <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>*  length );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Load any font table into client memory.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face.</p>
-</td></tr>
-<tr valign=top><td><b>tag</b></td><td>
-<p>The four-byte tag of the table to load. Use the value&nbsp;0 if you want to access the whole font file. Otherwise, you can use one of the definitions found in the <a href="ft2-header_file_macros.html#FT_TRUETYPE_TAGS_H">FT_TRUETYPE_TAGS_H</a> file, or forge a new one with <a href="ft2-basic_types.html#FT_MAKE_TAG">FT_MAKE_TAG</a>.</p>
-</td></tr>
-<tr valign=top><td><b>offset</b></td><td>
-<p>The starting offset in the table (or file if tag == 0).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>buffer</b></td><td>
-<p>The target buffer address. The client must ensure that the memory array is big enough to hold the data.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>length</b></td><td>
-<p>If the &lsquo;length&rsquo; parameter is NULL, then try to load the whole table. Return an error code if it fails.</p>
-<p>Else, if &lsquo;*length&rsquo; is&nbsp;0, exit immediately while returning the table's (or file) full size in it.</p>
-<p>Else the number of bytes to read from the table or file, from the starting offset.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>If you need to determine the table's length you should first call this function with &lsquo;*length&rsquo; set to&nbsp;0, as in the following example:</p>
-<pre class="colored">
-  FT_ULong  length = 0;
-
-
-  error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &amp;length );
-  if ( error ) { ... table does not exist ... }
-
-  buffer = malloc( length );
-  if ( buffer == NULL ) { ... not enough memory ... }
-
-  error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &amp;length );
-  if ( error ) { ... could not load table ... }
-</pre>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Sfnt_Table_Info">FT_Sfnt_Table_Info</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Sfnt_Table_Info</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>    face,
-                      <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>    table_index,
-                      <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  *tag,
-                      <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>  *length );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return information on an SFNT table.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the source face.</p>
-</td></tr>
-<tr valign=top><td><b>table_index</b></td><td>
-<p>The index of an SFNT table. The function returns FT_Err_Table_Missing for an invalid value.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>tag</b></td><td>
-<p>The name tag of the SFNT table. If the value is NULL, &lsquo;table_index&rsquo; is ignored, and &lsquo;length&rsquo; returns the number of SFNT tables in the font.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>length</b></td><td>
-<p>The length of the SFNT table (or the number of SFNT tables, depending on &lsquo;tag&rsquo;).</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>SFNT tables with length zero are treated as missing.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_CMap_Language_ID">FT_Get_CMap_Language_ID</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a> )
-  <b>FT_Get_CMap_Language_ID</b>( <a href="ft2-base_interface.html#FT_CharMap">FT_CharMap</a>  charmap );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return TrueType/sfnt specific cmap language ID. Definitions of language ID values are in &lsquo;freetype/ttnameid.h&rsquo;.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>charmap</b></td><td>
-<p>The target charmap.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The language ID of &lsquo;charmap&rsquo;. If &lsquo;charmap&rsquo; doesn't belong to a TrueType/sfnt face, just return&nbsp;0 as the default value.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_CMap_Format">FT_Get_CMap_Format</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> )
-  <b>FT_Get_CMap_Format</b>( <a href="ft2-base_interface.html#FT_CharMap">FT_CharMap</a>  charmap );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return TrueType/sfnt specific cmap format.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>charmap</b></td><td>
-<p>The target charmap.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The format of &lsquo;charmap&rsquo;. If &lsquo;charmap&rsquo; doesn't belong to a TrueType/sfnt face, return -1.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_PARAM_TAG_UNPATENTED_HINTING">FT_PARAM_TAG_UNPATENTED_HINTING</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_UNPATENTED_HINTING_H (freetype/ttunpat.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <b>FT_PARAM_TAG_UNPATENTED_HINTING</b>  <a href="ft2-basic_types.html#FT_MAKE_TAG">FT_MAKE_TAG</a>( 'u', 'n', 'p', 'a' )
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A constant used as the tag of an <a href="ft2-base_interface.html#FT_Parameter">FT_Parameter</a> structure to indicate that unpatented methods only should be used by the TrueType bytecode interpreter for a typeface opened by <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a>.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-type1_tables.html b/docs/reference/ft2-type1_tables.html
deleted file mode 100644 (file)
index a7d1197..0000000
+++ /dev/null
@@ -1,689 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Type 1 Tables
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#PS_FontInfoRec">PS_FontInfoRec</a></td><td></td><td><a href="#T1_Blend_Flags">T1_Blend_Flags</a></td><td></td><td><a href="#FT_Has_PS_Glyph_Names">FT_Has_PS_Glyph_Names</a></td></tr>
-<tr><td></td><td><a href="#PS_FontInfo">PS_FontInfo</a></td><td></td><td><a href="#CID_FaceDictRec">CID_FaceDictRec</a></td><td></td><td><a href="#FT_Get_PS_Font_Info">FT_Get_PS_Font_Info</a></td></tr>
-<tr><td></td><td><a href="#T1_FontInfo">T1_FontInfo</a></td><td></td><td><a href="#CID_FaceDict">CID_FaceDict</a></td><td></td><td><a href="#FT_Get_PS_Font_Private">FT_Get_PS_Font_Private</a></td></tr>
-<tr><td></td><td><a href="#PS_PrivateRec">PS_PrivateRec</a></td><td></td><td><a href="#CID_FaceInfoRec">CID_FaceInfoRec</a></td><td></td><td><a href="#T1_EncodingType">T1_EncodingType</a></td></tr>
-<tr><td></td><td><a href="#PS_Private">PS_Private</a></td><td></td><td><a href="#CID_FaceInfo">CID_FaceInfo</a></td><td></td><td><a href="#PS_Dict_Keys">PS_Dict_Keys</a></td></tr>
-<tr><td></td><td><a href="#T1_Private">T1_Private</a></td><td></td><td><a href="#CID_Info">CID_Info</a></td><td></td><td><a href="#FT_Get_PS_Font_Value">FT_Get_PS_Font_Value</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains the definition of Type 1-specific tables, including structures related to other PostScript font formats.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="PS_FontInfoRec">PS_FontInfoRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  PS_FontInfoRec_
-  {
-    <a href="ft2-basic_types.html#FT_String">FT_String</a>*  version;
-    <a href="ft2-basic_types.html#FT_String">FT_String</a>*  notice;
-    <a href="ft2-basic_types.html#FT_String">FT_String</a>*  full_name;
-    <a href="ft2-basic_types.html#FT_String">FT_String</a>*  family_name;
-    <a href="ft2-basic_types.html#FT_String">FT_String</a>*  weight;
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>     italic_angle;
-    <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>     is_fixed_pitch;
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>    underline_position;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>   underline_thickness;
-
-  } <b>PS_FontInfoRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model a Type&nbsp;1 or Type&nbsp;2 FontInfo dictionary. Note that for Multiple Master fonts, each instance has its own FontInfo dictionary.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="PS_FontInfo">PS_FontInfo</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> PS_FontInfoRec_*  <b>PS_FontInfo</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a <a href="ft2-type1_tables.html#PS_FontInfoRec">PS_FontInfoRec</a> structure.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="T1_FontInfo">T1_FontInfo</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <a href="ft2-type1_tables.html#PS_FontInfoRec">PS_FontInfoRec</a>  <b>T1_FontInfo</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This type is equivalent to <a href="ft2-type1_tables.html#PS_FontInfoRec">PS_FontInfoRec</a>. It is deprecated but kept to maintain source compatibility between various versions of FreeType.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="PS_PrivateRec">PS_PrivateRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  PS_PrivateRec_
-  {
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>     unique_id;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>     lenIV;
-
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    num_blue_values;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    num_other_blues;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    num_family_blues;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    num_family_other_blues;
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   blue_values[14];
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   other_blues[10];
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   family_blues      [14];
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   family_other_blues[10];
-
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>   blue_scale;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>     blue_shift;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>     blue_fuzz;
-
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  standard_width[1];
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  standard_height[1];
-
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    num_snap_widths;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    num_snap_heights;
-    <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>    force_bold;
-    <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>    round_stem_up;
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   snap_widths [13];  /* including std width  */
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   snap_heights[13];  /* including std height */
-
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>   expansion_factor;
-
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>    language_group;
-    <a href="ft2-basic_types.html#FT_Long">FT_Long</a>    password;
-
-    <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   min_feature[2];
-
-  } <b>PS_PrivateRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to model a Type&nbsp;1 or Type&nbsp;2 private dictionary. Note that for Multiple Master fonts, each instance has its own Private dictionary.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="PS_Private">PS_Private</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> PS_PrivateRec_*  <b>PS_Private</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a <a href="ft2-type1_tables.html#PS_PrivateRec">PS_PrivateRec</a> structure.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="T1_Private">T1_Private</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <a href="ft2-type1_tables.html#PS_PrivateRec">PS_PrivateRec</a>  <b>T1_Private</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This type is equivalent to <a href="ft2-type1_tables.html#PS_PrivateRec">PS_PrivateRec</a>. It is deprecated but kept to maintain source compatibility between various versions of FreeType.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="T1_Blend_Flags">T1_Blend_Flags</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  T1_Blend_Flags_
-  {
-    /*# required fields in a FontInfo blend dictionary */
-    T1_BLEND_UNDERLINE_POSITION = 0,
-    T1_BLEND_UNDERLINE_THICKNESS,
-    T1_BLEND_ITALIC_ANGLE,
-
-    /*# required fields in a Private blend dictionary */
-    T1_BLEND_BLUE_VALUES,
-    T1_BLEND_OTHER_BLUES,
-    T1_BLEND_STANDARD_WIDTH,
-    T1_BLEND_STANDARD_HEIGHT,
-    T1_BLEND_STEM_SNAP_WIDTHS,
-    T1_BLEND_STEM_SNAP_HEIGHTS,
-    T1_BLEND_BLUE_SCALE,
-    T1_BLEND_BLUE_SHIFT,
-    T1_BLEND_FAMILY_BLUES,
-    T1_BLEND_FAMILY_OTHER_BLUES,
-    T1_BLEND_FORCE_BOLD,
-
-    /*# never remove */
-    T1_BLEND_MAX
-
-  } <b>T1_Blend_Flags</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A set of flags used to indicate which fields are present in a given blend dictionary (font info or private). Used to support Multiple Masters fonts.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="CID_FaceDictRec">CID_FaceDictRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  CID_FaceDictRec_
-  {
-    <a href="ft2-type1_tables.html#PS_PrivateRec">PS_PrivateRec</a>  private_dict;
-
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>        len_buildchar;
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>       forcebold_threshold;
-    <a href="ft2-basic_types.html#FT_Pos">FT_Pos</a>         stroke_width;
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>       expansion_factor;
-
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>        paint_type;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>        font_type;
-    <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>      font_matrix;
-    <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>      font_offset;
-
-    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>        num_subrs;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>       subrmap_offset;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>         sd_bytes;
-
-  } <b>CID_FaceDictRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to represent data in a CID top-level dictionary.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="CID_FaceDict">CID_FaceDict</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> CID_FaceDictRec_*  <b>CID_FaceDict</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a <a href="ft2-type1_tables.html#CID_FaceDictRec">CID_FaceDictRec</a> structure.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="CID_FaceInfoRec">CID_FaceInfoRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  CID_FaceInfoRec_
-  {
-    <a href="ft2-basic_types.html#FT_String">FT_String</a>*      cid_font_name;
-    <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>        cid_version;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>          cid_font_type;
-
-    <a href="ft2-basic_types.html#FT_String">FT_String</a>*      registry;
-    <a href="ft2-basic_types.html#FT_String">FT_String</a>*      ordering;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>          supplement;
-
-    <a href="ft2-type1_tables.html#PS_FontInfoRec">PS_FontInfoRec</a>  font_info;
-    <a href="ft2-basic_types.html#FT_BBox">FT_BBox</a>         font_bbox;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>        uid_base;
-
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>          num_xuid;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>        xuid[16];
-
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>        cidmap_offset;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>          fd_bytes;
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>          gd_bytes;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>        cid_count;
-
-    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>          num_dicts;
-    <a href="ft2-type1_tables.html#CID_FaceDict">CID_FaceDict</a>    font_dicts;
-
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>        data_offset;
-
-  } <b>CID_FaceInfoRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A structure used to represent CID Face information.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="CID_FaceInfo">CID_FaceInfo</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> CID_FaceInfoRec_*  <b>CID_FaceInfo</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to a <a href="ft2-type1_tables.html#CID_FaceInfoRec">CID_FaceInfoRec</a> structure.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="CID_Info">CID_Info</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <a href="ft2-type1_tables.html#CID_FaceInfoRec">CID_FaceInfoRec</a>  <b>CID_Info</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>This type is equivalent to <a href="ft2-type1_tables.html#CID_FaceInfoRec">CID_FaceInfoRec</a>. It is deprecated but kept to maintain source compatibility between various versions of FreeType.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Has_PS_Glyph_Names">FT_Has_PS_Glyph_Names</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Int">FT_Int</a> )
-  <b>FT_Has_PS_Glyph_Names</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>  face );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return true if a given face provides reliable PostScript glyph names. This is similar to using the <a href="ft2-base_interface.html#FT_HAS_GLYPH_NAMES">FT_HAS_GLYPH_NAMES</a> macro, except that certain fonts (mostly TrueType) contain incorrect glyph name tables.</p>
-<p>When this function returns true, the caller is sure that the glyph names returned by <a href="ft2-base_interface.html#FT_Get_Glyph_Name">FT_Get_Glyph_Name</a> are reliable.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>face handle</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>Boolean. True if glyph names are reliable.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_PS_Font_Info">FT_Get_PS_Font_Info</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_PS_Font_Info</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>      face,
-                       <a href="ft2-type1_tables.html#PS_FontInfo">PS_FontInfo</a>  afont_info );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the <a href="ft2-type1_tables.html#PS_FontInfoRec">PS_FontInfoRec</a> structure corresponding to a given PostScript font.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>PostScript face handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>afont_info</b></td><td>
-<p>Output font info structure pointer.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The string pointers within the font info structure are owned by the face and don't need to be freed by the caller.</p>
-<p>If the font's format is not PostScript-based, this function will return the &lsquo;FT_Err_Invalid_Argument&rsquo; error code.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_PS_Font_Private">FT_Get_PS_Font_Private</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_PS_Font_Private</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>     face,
-                          <a href="ft2-type1_tables.html#PS_Private">PS_Private</a>  afont_private );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the <a href="ft2-type1_tables.html#PS_PrivateRec">PS_PrivateRec</a> structure corresponding to a given PostScript font.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>PostScript face handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>afont_private</b></td><td>
-<p>Output private dictionary structure pointer.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The string pointers within the <a href="ft2-type1_tables.html#PS_PrivateRec">PS_PrivateRec</a> structure are owned by the face and don't need to be freed by the caller.</p>
-<p>If the font's format is not PostScript-based, this function returns the &lsquo;FT_Err_Invalid_Argument&rsquo; error code.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="T1_EncodingType">T1_EncodingType</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  T1_EncodingType_
-  {
-    T1_ENCODING_TYPE_NONE = 0,
-    T1_ENCODING_TYPE_ARRAY,
-    T1_ENCODING_TYPE_STANDARD,
-    T1_ENCODING_TYPE_ISOLATIN1,
-    T1_ENCODING_TYPE_EXPERT
-
-  } <b>T1_EncodingType</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An enumeration describing the &lsquo;Encoding&rsquo; entry in a Type 1 dictionary.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="PS_Dict_Keys">PS_Dict_Keys</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">enum</span>  PS_Dict_Keys_
-  {
-    /* conventionally in the font dictionary */
-    PS_DICT_FONT_TYPE,              /* <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>         */
-    PS_DICT_FONT_MATRIX,            /* <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>        */
-    PS_DICT_FONT_BBOX,              /* <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>        */
-    PS_DICT_PAINT_TYPE,             /* <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>         */
-    PS_DICT_FONT_NAME,              /* <a href="ft2-basic_types.html#FT_String">FT_String</a>*      */
-    PS_DICT_UNIQUE_ID,              /* <a href="ft2-basic_types.html#FT_Int">FT_Int</a>          */
-    PS_DICT_NUM_CHAR_STRINGS,       /* <a href="ft2-basic_types.html#FT_Int">FT_Int</a>          */
-    PS_DICT_CHAR_STRING_KEY,        /* <a href="ft2-basic_types.html#FT_String">FT_String</a>*      */
-    PS_DICT_CHAR_STRING,            /* <a href="ft2-basic_types.html#FT_String">FT_String</a>*      */
-    PS_DICT_ENCODING_TYPE,          /* <a href="ft2-type1_tables.html#T1_EncodingType">T1_EncodingType</a> */
-    PS_DICT_ENCODING_ENTRY,         /* <a href="ft2-basic_types.html#FT_String">FT_String</a>*      */
-
-    /* conventionally in the font Private dictionary */
-    PS_DICT_NUM_SUBRS,              /* <a href="ft2-basic_types.html#FT_Int">FT_Int</a>     */
-    PS_DICT_SUBR,                   /* <a href="ft2-basic_types.html#FT_String">FT_String</a>* */
-    PS_DICT_STD_HW,                 /* <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  */
-    PS_DICT_STD_VW,                 /* <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  */
-    PS_DICT_NUM_BLUE_VALUES,        /* <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    */
-    PS_DICT_BLUE_VALUE,             /* <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   */
-    PS_DICT_BLUE_FUZZ,              /* <a href="ft2-basic_types.html#FT_Int">FT_Int</a>     */
-    PS_DICT_NUM_OTHER_BLUES,        /* <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    */
-    PS_DICT_OTHER_BLUE,             /* <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   */
-    PS_DICT_NUM_FAMILY_BLUES,       /* <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    */
-    PS_DICT_FAMILY_BLUE,            /* <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   */
-    PS_DICT_NUM_FAMILY_OTHER_BLUES, /* <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    */
-    PS_DICT_FAMILY_OTHER_BLUE,      /* <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   */
-    PS_DICT_BLUE_SCALE,             /* <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>   */
-    PS_DICT_BLUE_SHIFT,             /* <a href="ft2-basic_types.html#FT_Int">FT_Int</a>     */
-    PS_DICT_NUM_STEM_SNAP_H,        /* <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    */
-    PS_DICT_STEM_SNAP_H,            /* <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   */
-    PS_DICT_NUM_STEM_SNAP_V,        /* <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    */
-    PS_DICT_STEM_SNAP_V,            /* <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   */
-    PS_DICT_FORCE_BOLD,             /* <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>    */
-    PS_DICT_RND_STEM_UP,            /* <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>    */
-    PS_DICT_MIN_FEATURE,            /* <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   */
-    PS_DICT_LEN_IV,                 /* <a href="ft2-basic_types.html#FT_Int">FT_Int</a>     */
-    PS_DICT_PASSWORD,               /* <a href="ft2-basic_types.html#FT_Long">FT_Long</a>    */
-    PS_DICT_LANGUAGE_GROUP,         /* <a href="ft2-basic_types.html#FT_Long">FT_Long</a>    */
-
-    /* conventionally in the font FontInfo dictionary */
-    PS_DICT_VERSION,                /* <a href="ft2-basic_types.html#FT_String">FT_String</a>* */
-    PS_DICT_NOTICE,                 /* <a href="ft2-basic_types.html#FT_String">FT_String</a>* */
-    PS_DICT_FULL_NAME,              /* <a href="ft2-basic_types.html#FT_String">FT_String</a>* */
-    PS_DICT_FAMILY_NAME,            /* <a href="ft2-basic_types.html#FT_String">FT_String</a>* */
-    PS_DICT_WEIGHT,                 /* <a href="ft2-basic_types.html#FT_String">FT_String</a>* */
-    PS_DICT_IS_FIXED_PITCH,         /* <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>    */
-    PS_DICT_UNDERLINE_POSITION,     /* <a href="ft2-basic_types.html#FT_Short">FT_Short</a>   */
-    PS_DICT_UNDERLINE_THICKNESS,    /* <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  */
-    PS_DICT_FS_TYPE,                /* <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  */
-    PS_DICT_ITALIC_ANGLE,           /* <a href="ft2-basic_types.html#FT_Long">FT_Long</a>    */
-
-    PS_DICT_MAX = PS_DICT_ITALIC_ANGLE
-
-  } <b>PS_Dict_Keys</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>An enumeration used in calls to <a href="ft2-type1_tables.html#FT_Get_PS_Font_Value">FT_Get_PS_Font_Value</a> to identify the Type&nbsp;1 dictionary entry to retrieve.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_PS_Font_Value">FT_Get_PS_Font_Value</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> )
-  <b>FT_Get_PS_Font_Value</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>       face,
-                        <a href="ft2-type1_tables.html#PS_Dict_Keys">PS_Dict_Keys</a>  key,
-                        <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>       idx,
-                        <span class="keyword">void</span>         *value,
-                        <a href="ft2-basic_types.html#FT_Long">FT_Long</a>       value_len );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve the value for the supplied key from a PostScript font.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>PostScript face handle.</p>
-</td></tr>
-<tr valign=top><td><b>key</b></td><td>
-<p>An enumeration value representing the dictionary key to retrieve.</p>
-</td></tr>
-<tr valign=top><td><b>idx</b></td><td>
-<p>For array values, this specifies the index to be returned.</p>
-</td></tr>
-<tr valign=top><td><b>value</b></td><td>
-<p>A pointer to memory into which to write the value.</p>
-</td></tr>
-<tr valign=top><td><b>valen_len</b></td><td>
-<p>The size, in bytes, of the memory supplied for the value.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>value</b></td><td>
-<p>The value matching the above key, if it exists.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The amount of memory (in bytes) required to hold the requested value (if it exists, -1 otherwise).</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The values returned are not pointers into the internal structures of the face, but are &lsquo;fresh&rsquo; copies, so that the memory containing them belongs to the calling application. This also enforces the &lsquo;read-only&rsquo; nature of these values, i.e., this function cannot be used to manipulate the face.</p>
-<p>&lsquo;value&rsquo; is a void pointer because the values returned can be of various types.</p>
-<p>If either &lsquo;value&rsquo; is NULL or &lsquo;value_len&rsquo; is too small, just the required memory size for the requested entry is returned.</p>
-<p>The &lsquo;idx&rsquo; 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.</p>
-<p>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).</p>
-<p>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.</p>
-<p>If the font's format is not PostScript-based, this function returns the &lsquo;FT_Err_Invalid_Argument&rsquo; error code.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-user_allocation.html b/docs/reference/ft2-user_allocation.html
deleted file mode 100644 (file)
index 3868a39..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-User allocation
-</h1></center>
-<table align=center width="87%"><tr><td>
-<p>FreeType assumes that structures allocated by the user and passed as arguments are zeroed out except for the actual data. In other words, it is recommended to use &lsquo;calloc&rsquo; (or variants of it) instead of &lsquo;malloc&rsquo; for allocation.</p>
-</td></tr></table><br>
-</body>
-</html>
diff --git a/docs/reference/ft2-version.html b/docs/reference/ft2-version.html
deleted file mode 100644 (file)
index 9136441..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-FreeType Version
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FREETYPE_XXX">FREETYPE_XXX</a></td><td></td><td><a href="#FT_Face_CheckTrueTypePatents">FT_Face_CheckTrueTypePatents</a></td></tr>
-<tr><td></td><td><a href="#FT_Library_Version">FT_Library_Version</a></td><td></td><td><a href="#FT_Face_SetUnpatentedHinting">FT_Face_SetUnpatentedHinting</a></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>Note that those functions and macros are of limited use because even a new release of FreeType with only documentation changes increases the version number.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FREETYPE_XXX">FREETYPE_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-version.html#FREETYPE_XXX">FREETYPE_MAJOR</a>  2
-#define <a href="ft2-version.html#FREETYPE_XXX">FREETYPE_MINOR</a>  4
-#define <a href="ft2-version.html#FREETYPE_XXX">FREETYPE_PATCH</a>  9
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>These three macros identify the FreeType source code version. Use <a href="ft2-version.html#FT_Library_Version">FT_Library_Version</a> to access them at runtime.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FREETYPE_MAJOR</b></td><td>
-<p>The major version number.</p>
-</td></tr>
-<tr valign=top><td><b>FREETYPE_MINOR</b></td><td>
-<p>The minor version number.</p>
-</td></tr>
-<tr valign=top><td><b>FREETYPE_PATCH</b></td><td>
-<p>The patch level.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The version number of FreeType if built as a dynamic link library with the &lsquo;libtool&rsquo; package is <i>not</i> controlled by these three macros.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Library_Version">FT_Library_Version</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <span class="keyword">void</span> )
-  <b>FT_Library_Version</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>   library,
-                      <a href="ft2-basic_types.html#FT_Int">FT_Int</a>      *amajor,
-                      <a href="ft2-basic_types.html#FT_Int">FT_Int</a>      *aminor,
-                      <a href="ft2-basic_types.html#FT_Int">FT_Int</a>      *apatch );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Return the version of the FreeType library being used. This is useful when dynamically linking to the library, since one cannot use the macros <a href="ft2-version.html#FREETYPE_XXX">FREETYPE_MAJOR</a>, <a href="ft2-version.html#FREETYPE_XXX">FREETYPE_MINOR</a>, and <a href="ft2-version.html#FREETYPE_XXX">FREETYPE_PATCH</a>.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
-<p>A source library handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>amajor</b></td><td>
-<p>The major version number.</p>
-</td></tr>
-<tr valign=top><td><b>aminor</b></td><td>
-<p>The minor version number.</p>
-</td></tr>
-<tr valign=top><td><b>apatch</b></td><td>
-<p>The patch version number.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>The reason why this function takes a &lsquo;library&rsquo; argument is because certain programs implement library initialization in a custom way that doesn't use <a href="ft2-base_interface.html#FT_Init_FreeType">FT_Init_FreeType</a>.</p>
-<p>In such cases, the library version might not be available before the library object has been created.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Face_CheckTrueTypePatents">FT_Face_CheckTrueTypePatents</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a> )
-  <b>FT_Face_CheckTrueTypePatents</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>  face );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Parse all bytecode instructions of a TrueType font file to check whether any of the patented opcodes are used. This is only useful if you want to be able to use the unpatented hinter with fonts that do <b>not</b> use these opcodes.</p>
-<p>Note that this function parses <b>all</b> glyph instructions in the font file, which may be slow.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A face handle.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>1&nbsp;if this is a TrueType font that uses one of the patented opcodes, 0&nbsp;otherwise.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Since May 2010, TrueType hinting is no longer patented.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.5</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Face_SetUnpatentedHinting">FT_Face_SetUnpatentedHinting</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_FREETYPE_H (freetype/freetype.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a> )
-  <b>FT_Face_SetUnpatentedHinting</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>  face,
-                                <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>  value );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Enable or disable the unpatented hinter for a given face. Only enable it if you have determined that the face doesn't use any patented opcodes (see <a href="ft2-version.html#FT_Face_CheckTrueTypePatents">FT_Face_CheckTrueTypePatents</a>).</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A face handle.</p>
-</td></tr>
-<tr valign=top><td><b>value</b></td><td>
-<p>New boolean setting.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>The old setting value. This will always be false if this is not an SFNT font, or if the unpatented hinter is not compiled in this instance of the library.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>Since May 2010, TrueType hinting is no longer patented.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
-<p>2.3.5</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
diff --git a/docs/reference/ft2-winfnt_fonts.html b/docs/reference/ft2-winfnt_fonts.html
deleted file mode 100644 (file)
index 3c72039..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.9 API Reference</title>
-<style type="text/css">
-  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
-         color: #000000;
-         background: #FFFFFF; }
-
-  p { text-align: justify; }
-  h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
-
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
-
-  span.keyword { font-family: monospace;
-                 text-align: left;
-                 white-space: pre;
-                 color: darkblue; }
-
-  pre.colored { color: blue; }
-
-  ul.empty { list-style-type: none; }
-</style>
-</head>
-<body>
-
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.9 API Reference</h1></center>
-
-<center><h1>
-Window FNT Files
-</h1></center>
-<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_WinFNT_ID_XXX">FT_WinFNT_ID_XXX</a></td><td></td><td><a href="#FT_WinFNT_Header">FT_WinFNT_Header</a></td><td></td><td></td></tr>
-<tr><td></td><td><a href="#FT_WinFNT_HeaderRec">FT_WinFNT_HeaderRec</a></td><td></td><td><a href="#FT_Get_WinFNT_Header">FT_Get_WinFNT_Header</a></td><td></td><td></td></tr>
-</table><br><br>
-
-<table align=center width="87%"><tr><td>
-<p>This section contains the declaration of Windows FNT specific functions.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_WinFNT_ID_XXX">FT_WinFNT_ID_XXX</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_WINFONTS_H (freetype/ftwinfnt.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1252</a>    0
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_DEFAULT</a>   1
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_SYMBOL</a>    2
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_MAC</a>      77
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP932</a>   128
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP949</a>   129
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1361</a>  130
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP936</a>   134
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP950</a>   136
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1253</a>  161
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1254</a>  162
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1258</a>  163
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1255</a>  177
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1256</a>  178
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1257</a>  186
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1251</a>  204
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP874</a>   222
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_CP1250</a>  238
-#define <a href="ft2-winfnt_fonts.html#FT_WinFNT_ID_XXX">FT_WinFNT_ID_OEM</a>     255
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A list of valid values for the &lsquo;charset&rsquo; byte in <a href="ft2-winfnt_fonts.html#FT_WinFNT_HeaderRec">FT_WinFNT_HeaderRec</a>. Exact mapping tables for the various cpXXXX encodings (except for cp1361) can be found at ftp://ftp.unicode.org in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_WinFNT_ID_DEFAULT</b></td><td>
-<p>This is used for font enumeration and font creation as a &lsquo;don't care&rsquo; value. Valid font files don't contain this value. When querying for information about the character set of the font that is currently selected into a specified device context, this return value (of the related Windows API) simply denotes failure.</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_SYMBOL</b></td><td>
-<p>There is no known mapping table available.</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_MAC</b></td><td>
-<p>Mac Roman encoding.</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_OEM</b></td><td>
-<p>From Michael Pöttgen &lt;michael@poettgen.de&gt;:</p>
-<p>The &lsquo;Windows Font Mapping&rsquo; article says that FT_WinFNT_ID_OEM is used for the charset of vector fonts, like &lsquo;modern.fon&rsquo;, &lsquo;roman.fon&rsquo;, and &lsquo;script.fon&rsquo; on Windows.</p>
-<p>The &lsquo;CreateFont&rsquo; documentation says: The FT_WinFNT_ID_OEM value specifies a character set that is operating-system dependent.</p>
-<p>The &lsquo;IFIMETRICS&rsquo; documentation from the &lsquo;Windows Driver Development Kit&rsquo; says: This font supports an OEM-specific character set. The OEM character set is system dependent.</p>
-<p>In general OEM, as opposed to ANSI (i.e., cp1252), denotes the second default codepage that most international versions of Windows have. It is one of the OEM codepages from</p>
-<p>http://www.microsoft.com/globaldev/reference/cphome.mspx,</p>
-<p>and is used for the &lsquo;DOS boxes&rsquo;, to support legacy applications. A German Windows version for example usually uses ANSI codepage 1252 and OEM codepage 850.</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP874</b></td><td>
-<p>A superset of Thai TIS 620 and ISO 8859-11.</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP932</b></td><td>
-<p>A superset of Japanese Shift-JIS (with minor deviations).</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP936</b></td><td>
-<p>A superset of simplified Chinese GB 2312-1980 (with different ordering and minor deviations).</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP949</b></td><td>
-<p>A superset of Korean Hangul KS&nbsp;C 5601-1987 (with different ordering and minor deviations).</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP950</b></td><td>
-<p>A superset of traditional Chinese Big&nbsp;5 ETen (with different ordering and minor deviations).</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP1250</b></td><td>
-<p>A superset of East European ISO 8859-2 (with slightly different ordering).</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP1251</b></td><td>
-<p>A superset of Russian ISO 8859-5 (with different ordering).</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP1252</b></td><td>
-<p>ANSI encoding. A superset of ISO 8859-1.</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP1253</b></td><td>
-<p>A superset of Greek ISO 8859-7 (with minor modifications).</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP1254</b></td><td>
-<p>A superset of Turkish ISO 8859-9.</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP1255</b></td><td>
-<p>A superset of Hebrew ISO 8859-8 (with some modifications).</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP1256</b></td><td>
-<p>A superset of Arabic ISO 8859-6 (with different ordering).</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP1257</b></td><td>
-<p>A superset of Baltic ISO 8859-13 (with some deviations).</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP1258</b></td><td>
-<p>For Vietnamese. This encoding doesn't cover all necessary characters.</p>
-</td></tr>
-<tr valign=top><td><b>FT_WinFNT_ID_CP1361</b></td><td>
-<p>Korean (Johab).</p>
-</td></tr>
-</table>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_WinFNT_HeaderRec">FT_WinFNT_HeaderRec</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_WINFONTS_H (freetype/ftwinfnt.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_WinFNT_HeaderRec_
-  {
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  version;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   file_size;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    copyright[60];
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  file_type;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  nominal_point_size;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  vertical_resolution;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  horizontal_resolution;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  ascent;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  internal_leading;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  external_leading;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    italic;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    underline;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    strike_out;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  weight;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    charset;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  pixel_width;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  pixel_height;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    pitch_and_family;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  avg_width;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  max_width;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    first_char;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    last_char;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    default_char;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    break_char;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  bytes_per_row;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   device_offset;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   face_name_offset;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   bits_pointer;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   bits_offset;
-    <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>    reserved;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   flags;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  A_space;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  B_space;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  C_space;
-    <a href="ft2-basic_types.html#FT_UShort">FT_UShort</a>  color_table_offset;
-    <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>   reserved1[4];
-
-  } <b>FT_WinFNT_HeaderRec</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Windows FNT Header info.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_WinFNT_Header">FT_WinFNT_Header</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_WINFONTS_H (freetype/ftwinfnt.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_WinFNT_HeaderRec_*  <b>FT_WinFNT_Header</b>;
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>A handle to an <a href="ft2-winfnt_fonts.html#FT_WinFNT_HeaderRec">FT_WinFNT_HeaderRec</a> structure.</p>
-</td></tr></table><br>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Get_WinFNT_Header">FT_Get_WinFNT_Header</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_WINFONTS_H (freetype/ftwinfnt.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
-
-  FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
-  <b>FT_Get_WinFNT_Header</b>( <a href="ft2-base_interface.html#FT_Face">FT_Face</a>               face,
-                        <a href="ft2-winfnt_fonts.html#FT_WinFNT_HeaderRec">FT_WinFNT_HeaderRec</a>  *aheader );
-
-</pre></table><br>
-<table align=center width="87%"><tr><td>
-<p>Retrieve a Windows FNT font info header.</p>
-</td></tr></table><br>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>face</b></td><td>
-<p>A handle to the input face.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>aheader</b></td><td>
-<p>The WinFNT header.</p>
-</td></tr>
-</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
-<p>FreeType error code. 0&nbsp;means success.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
-<p>This function only works with Windows FNT faces, returning an error otherwise.</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-</body>
-</html>
index 28a8235..98f16cd 100644 (file)
@@ -1,7 +1,7 @@
 How to prepare a new release
 ----------------------------
 
-. include/freetype/freetype.h:  Update FREETYPE_MAJOR, FREETYPE_MINOR,
+. include/freetype.h:  Update FREETYPE_MAJOR, FREETYPE_MINOR,
   and FREETYPE_PATCH.
 
 . Update version numbers in all files where necessary (for example, do
@@ -41,7 +41,8 @@ How to prepare a new release
 . Run  src/tools/chktrcmp.py  and check  that there  are no  undefined
   trace_XXXX macros.
 
-. Tag the git repositories (freetype2, freetype2-demos) with
+. After pushing the new release,  tag the git repositories (freetype2,
+  freetype2-demos) with
 
     git tag VER-<version> -m "" -u <committer>
 
@@ -49,16 +50,21 @@ How to prepare a new release
 
     git push --tags
 
-  TODO: Tag the home page CVS on savannah.nongnu.org.
+. Check with
+
+    git clean -ndx
+
+  that the git directory is really clean  (and remove extraneous files
+  if necessary).
 
 . Say `make  dist' in both the  freetype2 and freetype2-demos  modules
   to generate the .tar.gz, .tar.bz2, and .zip files.
 
 . Create     the     doc    bundles    (freetype-doc-<version>.tar.gz,
   freetype-doc-<version>.tar.bz2,    ftdoc<version>.zip).    This   is
-  everything below
+  everything in
 
-    freetype.freedesktop.org:/srv/freetype.freedesktop.org/www/freetype2/docs/
+    <freetype-web git repository>/freetype2/docs
 
   except the `reference' subdirectory.   Do *not* use option `-l' from
   zip!
@@ -70,7 +76,7 @@ How to prepare a new release
 
     #!/bin/sh
 
-    VERSION=2.4.8
+    VERSION=2.5.1
     SAVANNAH_USER=wl
     SOURCEFORGE_USER=wlemb
 
@@ -154,7 +160,7 @@ How to prepare a new release
 
     #!/bin/sh
 
-    VERSION=2.4.8
+    VERSION=2.5.1
     SOURCEFORGE_USER=wlemb
 
     #####################################################################
@@ -164,39 +170,26 @@ How to prepare a new release
 
     # EOF
 
-. On   SourceForge,   tag   the   just   uploaded   `ftXXXX.zip'   and
+. On   SourceForge,   tag   the    just   uploaded   `ftXXX.zip'   and
   `freetype-XXX.tar.bz2'  files as the  default files to  download for
   `Windows' and `Others', respectively.
 
 . Copy the reference files (generated by `make dist') to
 
-    freetype.freedesktop.org:/srv/freetype.freedesktop.org/www/freetype2/docs/reference
-
-  and
-
-    shell.sf.net:/home/groups/f/fr/freetype/htdocs/freetype2/docs/reference
-
-  TODO: Create  FreeType  home  page  CVS  on savannah.nongnu.org  and
-        update it accordingly.
-
-        Write script to automatically do this.
-
-        Mirror FreeType's savannah home page everywhere.
-
-. Update
-
-    freetype.freedesktop.org:/srv/freetype.freedesktop.org/www/index2.html
+    <freetype-web git repository>/freetype2/docs/reference
 
-  and copy it to
+. Update the `freetype-web' repository.  `git push' then automatically
+  triggers an update  of the public web pages  within ten minutes, due
+  to a cron script (on wl@freedesktop.org) that rsyncs with
 
-    shell.sf.net:/home/groups/f/fr/freetype/htdocs/index2.html
+    freedesktop.org://srv/freetype.freedesktop.org/www
 
 . Announce new release on freetype-announce@nongnu.org and to relevant
   newsgroups.
 
 ----------------------------------------------------------------------
 
-Copyright 2003, 2005-2007, 2009, 2011 by
+Copyright 2003, 2005-2007, 2009, 2011-2014 by
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 This  file is  part of  the FreeType  project, and  may only  be used,
diff --git a/ft2demos/ftbench b/ft2demos/ftbench
deleted file mode 100755 (executable)
index a53d002..0000000
Binary files a/ft2demos/ftbench and /dev/null differ
diff --git a/ft2demos/ftdiff b/ft2demos/ftdiff
deleted file mode 100755 (executable)
index e25e76a..0000000
Binary files a/ft2demos/ftdiff and /dev/null differ
diff --git a/ft2demos/ftdump b/ft2demos/ftdump
deleted file mode 100755 (executable)
index 45a3572..0000000
Binary files a/ft2demos/ftdump and /dev/null differ
diff --git a/ft2demos/ftgamma b/ft2demos/ftgamma
deleted file mode 100755 (executable)
index 46015e8..0000000
Binary files a/ft2demos/ftgamma and /dev/null differ
diff --git a/ft2demos/ftgrid b/ft2demos/ftgrid
deleted file mode 100755 (executable)
index a11e773..0000000
Binary files a/ft2demos/ftgrid and /dev/null differ
diff --git a/ft2demos/ftlint b/ft2demos/ftlint
deleted file mode 100755 (executable)
index d6482b2..0000000
Binary files a/ft2demos/ftlint and /dev/null differ
diff --git a/ft2demos/ftmulti b/ft2demos/ftmulti
deleted file mode 100755 (executable)
index 3e48474..0000000
Binary files a/ft2demos/ftmulti and /dev/null differ
diff --git a/ft2demos/ftstring b/ft2demos/ftstring
deleted file mode 100755 (executable)
index a02606f..0000000
Binary files a/ft2demos/ftstring and /dev/null differ
diff --git a/ft2demos/ftview b/ft2demos/ftview
deleted file mode 100755 (executable)
index 91e725d..0000000
Binary files a/ft2demos/ftview and /dev/null differ
similarity index 77%
rename from include/freetype/config/ftconfig.h
rename to include/config/ftconfig.h
index 5628569..22d70fd 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    ANSI-specific configuration file (specification only).               */
 /*                                                                         */
-/*  Copyright 1996-2004, 2006-2008, 2010-2011 by                           */
+/*  Copyright 1996-2004, 2006-2008, 2010-2011, 2013, 2014 by               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   /* Note however that if some specific modifications are needed, we       */
   /* advise you to place a modified copy in your build directory.          */
   /*                                                                       */
-  /* The build directory is usually `freetype/builds/<system>', and        */
-  /* contains system-specific files that are always included first when    */
-  /* building the library.                                                 */
+  /* The build directory is usually `builds/<system>', and contains        */
+  /* system-specific files that are always included first when building    */
+  /* the library.                                                          */
   /*                                                                       */
-  /* This ANSI version should stay in `include/freetype/config'.           */
+  /* This ANSI version should stay in `include/config/'.                   */
   /*                                                                       */
   /*************************************************************************/
 
@@ -53,7 +53,7 @@ FT_BEGIN_HEADER
   /* These macros can be toggled to suit a specific system.  The current   */
   /* ones are defaults used to compile FreeType in an ANSI C environment   */
   /* (16bit compilers are also supported).  Copy this file to your own     */
-  /* `freetype/builds/<system>' directory, and edit it to port the engine. */
+  /* `builds/<system>' directory, and edit it to port the engine.          */
   /*                                                                       */
   /*************************************************************************/
 
@@ -200,6 +200,30 @@ FT_BEGIN_HEADER
   /*                                                                       */
   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
@@ -239,13 +263,24 @@ FT_BEGIN_HEADER
 
   /* 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++) */
+  /*************************************************************************/
+  /*                                                                       */
+  /* A 64-bit data type may create compilation problems if you compile     */
+  /* in strict ANSI mode.  To avoid them, we disable other 64-bit data     */
+  /* types if __STDC__ is defined.  You can however ignore this rule       */
+  /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro.     */
+  /*                                                                       */
+#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
+
+#if 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++ */
 
@@ -254,7 +289,8 @@ FT_BEGIN_HEADER
 
   /* 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++ */
 
@@ -263,35 +299,24 @@ FT_BEGIN_HEADER
 #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
-#define FT_INT64  long long int
-
-#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* A 64-bit data type will create compilation problems if you compile    */
-  /* in strict ANSI mode.  To avoid them, we disable its use if __STDC__   */
-  /* is defined.  You can however ignore this rule by defining the         */
-  /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro.                     */
-  /*                                                                       */
-#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
+#define FT_INT64   long long int
+#define FT_UINT64  unsigned long long int
 
-#ifdef __STDC__
-
-  /* undefine the 64-bit macros in strict ANSI compilation mode */
-#undef FT_LONG64
-#undef FT_INT64
+#endif /* _MSC_VER */
 
-#endif /* __STDC__ */
+#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
 
-#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 {
@@ -299,147 +324,6 @@ FT_BEGIN_HEADER
 #define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT
 
 
-#ifndef  FT_CONFIG_OPTION_NO_ASSEMBLER
-  /* Provide assembler fragments for performance-critical functions. */
-  /* These must be defined `static __inline__' with GCC.             */
-
-#if defined( __CC_ARM ) || defined( __ARMCC__ )  /* RVCT */
-#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm
-
-  /* documentation is in freetype.h */
-
-  static __inline FT_Int32
-  FT_MulFix_arm( FT_Int32  a,
-                 FT_Int32  b )
-  {
-    register FT_Int32  t, t2;
-
-
-    __asm
-    {
-      smull t2, t,  b,  a           /* (lo=t2,hi=t) = a*b */
-      mov   a,  t,  asr #31         /* a   = (hi >> 31) */
-      add   a,  a,  #0x8000         /* a  += 0x8000 */
-      adds  t2, t2, a               /* t2 += a */
-      adc   t,  t,  #0              /* t  += carry */
-      mov   a,  t2, lsr #16         /* a   = t2 >> 16 */
-      orr   a,  a,  t,  lsl #16     /* a  |= t << 16 */
-    }
-    return a;
-  }
-
-#endif /* __CC_ARM || __ARMCC__ */
-
-
-#ifdef __GNUC__
-
-#if defined( __arm__ ) && !defined( __thumb__ )    && \
-    !( defined( __CC_ARM ) || defined( __ARMCC__ ) )
-#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm
-
-  /* documentation is in freetype.h */
-
-  static __inline__ FT_Int32
-  FT_MulFix_arm( FT_Int32  a,
-                 FT_Int32  b )
-  {
-    register FT_Int32  t, t2;
-
-
-    __asm__ __volatile__ (
-      "smull  %1, %2, %4, %3\n\t"       /* (lo=%1,hi=%2) = a*b */
-      "mov    %0, %2, asr #31\n\t"      /* %0  = (hi >> 31) */
-      "add    %0, %0, #0x8000\n\t"      /* %0 += 0x8000 */
-      "adds   %1, %1, %0\n\t"           /* %1 += %0 */
-      "adc    %2, %2, #0\n\t"           /* %2 += carry */
-      "mov    %0, %1, lsr #16\n\t"      /* %0  = %1 >> 16 */
-      "orr    %0, %0, %2, lsl #16\n\t"  /* %0 |= %2 << 16 */
-      : "=r"(a), "=&r"(t2), "=&r"(t)
-      : "r"(a), "r"(b) );
-    return a;
-  }
-
-#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */
-
-#if defined( __i386__ )
-#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386
-
-  /* documentation is in freetype.h */
-
-  static __inline__ FT_Int32
-  FT_MulFix_i386( FT_Int32  a,
-                  FT_Int32  b )
-  {
-    register FT_Int32  result;
-
-
-    __asm__ __volatile__ (
-      "imul  %%edx\n"
-      "movl  %%edx, %%ecx\n"
-      "sarl  $31, %%ecx\n"
-      "addl  $0x8000, %%ecx\n"
-      "addl  %%ecx, %%eax\n"
-      "adcl  $0, %%edx\n"
-      "shrl  $16, %%eax\n"
-      "shll  $16, %%edx\n"
-      "addl  %%edx, %%eax\n"
-      : "=a"(result), "=d"(b)
-      : "a"(a), "d"(b)
-      : "%ecx", "cc" );
-    return result;
-  }
-
-#endif /* i386 */
-
-#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 */
-
-
-#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
-#ifdef FT_MULFIX_ASSEMBLER
-#define FT_MULFIX_INLINED  FT_MULFIX_ASSEMBLER
-#endif
-#endif
-
-
 #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
 
 #define FT_LOCAL( x )      static  x
@@ -457,6 +341,9 @@ FT_BEGIN_HEADER
 
 #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
 
+#define FT_LOCAL_ARRAY( x )      extern const  x
+#define FT_LOCAL_ARRAY_DEF( x )  const  x
+
 
 #ifndef FT_BASE
 
similarity index 87%
rename from include/freetype/config/ftheader.h
rename to include/config/ftheader.h
index 2a7b8c4..b623629 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Build macros of the FreeType 2 library.                              */
 /*                                                                         */
-/*  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,       */
    *
    */
 #ifndef FT_CONFIG_CONFIG_H
-#define FT_CONFIG_CONFIG_H  <freetype/config/ftconfig.h>
+#define FT_CONFIG_CONFIG_H  <config/ftconfig.h>
 #endif
 
 
    *
    */
 #ifndef FT_CONFIG_STANDARD_LIBRARY_H
-#define FT_CONFIG_STANDARD_LIBRARY_H  <freetype/config/ftstdlib.h>
+#define FT_CONFIG_STANDARD_LIBRARY_H  <config/ftstdlib.h>
 #endif
 
 
    *
    */
 #ifndef FT_CONFIG_OPTIONS_H
-#define FT_CONFIG_OPTIONS_H  <freetype/config/ftoption.h>
+#define FT_CONFIG_OPTIONS_H  <config/ftoption.h>
 #endif
 
 
    *
    */
 #ifndef FT_CONFIG_MODULES_H
-#define FT_CONFIG_MODULES_H  <freetype/config/ftmodule.h>
+#define FT_CONFIG_MODULES_H  <config/ftmodule.h>
 #endif
 
   /* */
    *   base FreeType~2 API.
    *
    */
-#define FT_FREETYPE_H  <freetype/freetype.h>
+#define FT_FREETYPE_H  <freetype.h>
 
 
   /*************************************************************************
    *   It is included by @FT_FREETYPE_H.
    *
    */
-#define FT_ERRORS_H  <freetype/fterrors.h>
+#define FT_ERRORS_H  <fterrors.h>
 
 
   /*************************************************************************
    *   list of FreeType~2 module error offsets (and messages).
    *
    */
-#define FT_MODULE_ERRORS_H  <freetype/ftmoderr.h>
+#define FT_MODULE_ERRORS_H  <ftmoderr.h>
 
 
   /*************************************************************************
    *   It is included by @FT_FREETYPE_H.
    *
    */
-#define FT_SYSTEM_H  <freetype/ftsystem.h>
+#define FT_SYSTEM_H  <ftsystem.h>
 
 
   /*************************************************************************
    *   It is included by @FT_FREETYPE_H.
    *
    */
-#define FT_IMAGE_H  <freetype/ftimage.h>
+#define FT_IMAGE_H  <ftimage.h>
 
 
   /*************************************************************************
    *   It is included by @FT_FREETYPE_H.
    *
    */
-#define FT_TYPES_H  <freetype/fttypes.h>
+#define FT_TYPES_H  <fttypes.h>
 
 
   /*************************************************************************
    *   (Most applications will never need to include this file.)
    *
    */
-#define FT_LIST_H  <freetype/ftlist.h>
+#define FT_LIST_H  <ftlist.h>
 
 
   /*************************************************************************
    *   scalable outline management API of FreeType~2.
    *
    */
-#define FT_OUTLINE_H  <freetype/ftoutln.h>
+#define FT_OUTLINE_H  <ftoutln.h>
 
 
   /*************************************************************************
    *   API which manages multiple @FT_Size objects per face.
    *
    */
-#define FT_SIZES_H  <freetype/ftsizes.h>
+#define FT_SIZES_H  <ftsizes.h>
 
 
   /*************************************************************************
    *   module management API of FreeType~2.
    *
    */
-#define FT_MODULE_H  <freetype/ftmodapi.h>
+#define FT_MODULE_H  <ftmodapi.h>
 
 
   /*************************************************************************
    *   renderer module management API of FreeType~2.
    *
    */
-#define FT_RENDER_H  <freetype/ftrender.h>
+#define FT_RENDER_H  <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  <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  <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  <ftttdrv.h>
 
 
   /*************************************************************************
    *   types and API specific to the Type~1 format.
    *
    */
-#define FT_TYPE1_TABLES_H  <freetype/t1tables.h>
+#define FT_TYPE1_TABLES_H  <t1tables.h>
 
 
   /*************************************************************************
    *   definitions, taken from the TrueType and OpenType specifications.
    *
    */
-#define FT_TRUETYPE_IDS_H  <freetype/ttnameid.h>
+#define FT_TRUETYPE_IDS_H  <ttnameid.h>
 
 
   /*************************************************************************
    *   types and API specific to the TrueType (as well as OpenType) format.
    *
    */
-#define FT_TRUETYPE_TABLES_H  <freetype/tttables.h>
+#define FT_TRUETYPE_TABLES_H  <tttables.h>
 
 
   /*************************************************************************
    *   SFNT-based font formats (i.e., TrueType and OpenType).
    *
    */
-#define FT_TRUETYPE_TAGS_H  <freetype/tttags.h>
+#define FT_TRUETYPE_TAGS_H  <tttags.h>
 
 
   /*************************************************************************
    *   face.
    *
    */
-#define FT_BDF_H  <freetype/ftbdf.h>
+#define FT_BDF_H  <ftbdf.h>
 
 
   /*************************************************************************
    *   face.
    *
    */
-#define FT_CID_H  <freetype/ftcid.h>
+#define FT_CID_H  <ftcid.h>
 
 
   /*************************************************************************
    *   definitions of an API which supports gzip-compressed files.
    *
    */
-#define FT_GZIP_H  <freetype/ftgzip.h>
+#define FT_GZIP_H  <ftgzip.h>
 
 
   /*************************************************************************
    *   definitions of an API which supports LZW-compressed files.
    *
    */
-#define FT_LZW_H  <freetype/ftlzw.h>
+#define FT_LZW_H  <ftlzw.h>
 
 
   /*************************************************************************
    *   definitions of an API which supports bzip2-compressed files.
    *
    */
-#define FT_BZIP2_H  <freetype/ftbzip2.h>
+#define FT_BZIP2_H  <ftbzip2.h>
 
 
   /*************************************************************************
    *   definitions of an API which supports Windows FNT files.
    *
    */
-#define FT_WINFONTS_H   <freetype/ftwinfnt.h>
+#define FT_WINFONTS_H   <ftwinfnt.h>
 
 
   /*************************************************************************
    *   API of the optional glyph management component.
    *
    */
-#define FT_GLYPH_H  <freetype/ftglyph.h>
+#define FT_GLYPH_H  <ftglyph.h>
 
 
   /*************************************************************************
    *   API of the optional bitmap conversion component.
    *
    */
-#define FT_BITMAP_H  <freetype/ftbitmap.h>
+#define FT_BITMAP_H  <ftbitmap.h>
 
 
   /*************************************************************************
    *   API of the optional exact bounding box computation routines.
    *
    */
-#define FT_BBOX_H  <freetype/ftbbox.h>
+#define FT_BBOX_H  <ftbbox.h>
 
 
   /*************************************************************************
    *   API of the optional FreeType~2 cache sub-system.
    *
    */
-#define FT_CACHE_H  <freetype/ftcache.h>
+#define FT_CACHE_H  <ftcache.h>
 
 
   /*************************************************************************
    *   compiled on the Mac (note that the base API still works though).
    *
    */
-#define FT_MAC_H  <freetype/ftmac.h>
+#define FT_MAC_H  <ftmac.h>
 
 
   /*************************************************************************
    *   optional multiple-masters management API of FreeType~2.
    *
    */
-#define FT_MULTIPLE_MASTERS_H  <freetype/ftmm.h>
+#define FT_MULTIPLE_MASTERS_H  <ftmm.h>
 
 
   /*************************************************************************
    *   SFNT-based font formats (i.e., TrueType and OpenType).
    *
    */
-#define FT_SFNT_NAMES_H  <freetype/ftsnames.h>
+#define FT_SFNT_NAMES_H  <ftsnames.h>
 
 
   /*************************************************************************
    *   GPOS, GSUB, JSTF).
    *
    */
-#define FT_OPENTYPE_VALIDATE_H  <freetype/ftotval.h>
+#define FT_OPENTYPE_VALIDATE_H  <ftotval.h>
 
 
   /*************************************************************************
    *   mort, morx, bsln, just, kern, opbd, trak, prop).
    *
    */
-#define FT_GX_VALIDATE_H  <freetype/ftgxval.h>
+#define FT_GX_VALIDATE_H  <ftgxval.h>
 
 
   /*************************************************************************
    *   FreeType~2 API which accesses PFR-specific data.
    *
    */
-#define FT_PFR_H  <freetype/ftpfr.h>
+#define FT_PFR_H  <ftpfr.h>
 
 
   /*************************************************************************
    *   A macro used in #include statements to name the file containing the
    *   FreeType~2 API which provides functions to stroke outline paths.
    */
-#define FT_STROKER_H  <freetype/ftstroke.h>
+#define FT_STROKER_H  <ftstroke.h>
 
 
   /*************************************************************************
    *   A macro used in #include statements to name the file containing the
    *   FreeType~2 API which performs artificial obliquing and emboldening.
    */
-#define FT_SYNTHESIS_H  <freetype/ftsynth.h>
+#define FT_SYNTHESIS_H  <ftsynth.h>
 
 
   /*************************************************************************
    *   FreeType~2 API which provides functions specific to the XFree86 and
    *   X.Org X11 servers.
    */
-#define FT_XFREE86_H  <freetype/ftxf86.h>
+#define FT_XFREE86_H  <ftxf86.h>
 
 
   /*************************************************************************
    *   FreeType~2 API which performs trigonometric computations (e.g.,
    *   cosines and arc tangents).
    */
-#define FT_TRIGONOMETRY_H  <freetype/fttrigon.h>
+#define FT_TRIGONOMETRY_H  <fttrigon.h>
 
 
   /*************************************************************************
    *   A macro used in #include statements to name the file containing the
    *   FreeType~2 API which performs color filtering for subpixel rendering.
    */
-#define FT_LCD_FILTER_H  <freetype/ftlcdfil.h>
+#define FT_LCD_FILTER_H  <ftlcdfil.h>
 
 
   /*************************************************************************
    *   A macro used in #include statements to name the file containing the
    *   FreeType~2 API which performs color filtering for subpixel rendering.
    */
-#define FT_UNPATENTED_HINTING_H  <freetype/ttunpat.h>
+#define FT_UNPATENTED_HINTING_H  <ttunpat.h>
 
 
   /*************************************************************************
    *   A macro used in #include statements to name the file containing the
    *   FreeType~2 API which performs color filtering for subpixel rendering.
    */
-#define FT_INCREMENTAL_H  <freetype/ftincrem.h>
+#define FT_INCREMENTAL_H  <ftincrem.h>
 
 
   /*************************************************************************
    *   A macro used in #include statements to name the file containing the
    *   FreeType~2 API which returns entries from the TrueType GASP table.
    */
-#define FT_GASP_H  <freetype/ftgasp.h>
+#define FT_GASP_H  <ftgasp.h>
 
 
   /*************************************************************************
    *   A macro used in #include statements to name the file containing the
    *   FreeType~2 API which returns individual and ranged glyph advances.
    */
-#define FT_ADVANCES_H  <freetype/ftadvanc.h>
+#define FT_ADVANCES_H  <ftadvanc.h>
 
 
   /* */
 
-#define FT_ERROR_DEFINITIONS_H  <freetype/fterrdef.h>
+#define FT_ERROR_DEFINITIONS_H  <fterrdef.h>
 
 
   /* The internals of the cache sub-system are no longer exposed.  We */
   /* default to FT_CACHE_H at the moment just in case, but we know of */
   /* no rogue client that uses them.                                  */
   /*                                                                  */
-#define FT_CACHE_MANAGER_H           <freetype/ftcache.h>
-#define FT_CACHE_INTERNAL_MRU_H      <freetype/ftcache.h>
-#define FT_CACHE_INTERNAL_MANAGER_H  <freetype/ftcache.h>
-#define FT_CACHE_INTERNAL_CACHE_H    <freetype/ftcache.h>
-#define FT_CACHE_INTERNAL_GLYPH_H    <freetype/ftcache.h>
-#define FT_CACHE_INTERNAL_IMAGE_H    <freetype/ftcache.h>
-#define FT_CACHE_INTERNAL_SBITS_H    <freetype/ftcache.h>
+#define FT_CACHE_MANAGER_H           <ftcache.h>
+#define FT_CACHE_INTERNAL_MRU_H      <ftcache.h>
+#define FT_CACHE_INTERNAL_MANAGER_H  <ftcache.h>
+#define FT_CACHE_INTERNAL_CACHE_H    <ftcache.h>
+#define FT_CACHE_INTERNAL_GLYPH_H    <ftcache.h>
+#define FT_CACHE_INTERNAL_IMAGE_H    <ftcache.h>
+#define FT_CACHE_INTERNAL_SBITS_H    <ftcache.h>
 
 
-#define FT_INCREMENTAL_H          <freetype/ftincrem.h>
+#define FT_INCREMENTAL_H          <ftincrem.h>
 
-#define FT_TRUETYPE_UNPATENTED_H  <freetype/ttunpat.h>
+#define FT_TRUETYPE_UNPATENTED_H  <ttunpat.h>
 
 
   /*
-   * Include internal headers definitions from <freetype/internal/...>
+   * Include internal headers definitions from <internal/...>
    * only when building the library.
    */
 #ifdef FT2_BUILD_LIBRARY
-#define  FT_INTERNAL_INTERNAL_H  <freetype/internal/internal.h>
+#define  FT_INTERNAL_INTERNAL_H  <internal/internal.h>
 #include FT_INTERNAL_INTERNAL_H
 #endif /* FT2_BUILD_LIBRARY */
 
similarity index 86%
rename from include/freetype/config/ftoption.h
rename to include/config/ftoption.h
index 041e24a..12ca25b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    User-selectable configuration macros (specification only).           */
 /*                                                                         */
-/*  Copyright 1996-2011 by                                                 */
+/*  Copyright 1996-2014 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -38,9 +38,9 @@ FT_BEGIN_HEADER
   /*    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.                                   */
+  /*    precisely in `$BUILD/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  */
@@ -51,7 +51,7 @@ FT_BEGIN_HEADER
   /*    locate this file during the build.  For example,                   */
   /*                                                                       */
   /*      #define FT_CONFIG_OPTIONS_H  <myftoptions.h>                     */
-  /*      #include <freetype/config/ftheader.h>                            */
+  /*      #include <config/ftheader.h>                                     */
   /*                                                                       */
   /*    will use `$BUILD/myftoptions.h' instead of this file for macro     */
   /*    definitions.                                                       */
@@ -59,9 +59,9 @@ FT_BEGIN_HEADER
   /*    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>.                */
+  /*    default, this file is <config/ftmodule.h>.                         */
   /*                                                                       */
-  /*  We highly recommend using the third method whenever possible.        */
+  /* We highly recommend using the third method whenever possible.         */
   /*                                                                       */
   /*************************************************************************/
 
@@ -216,6 +216,33 @@ FT_BEGIN_HEADER
 
   /*************************************************************************/
   /*                                                                       */
+  /* 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
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* HarfBuzz support.                                                     */
+  /*                                                                       */
+  /*   FreeType uses the HarfBuzz library to improve auto-hinting of       */
+  /*   OpenType fonts.  If available, many glyphs not directly addressable */
+  /*   by a font's character map will be hinted also.                      */
+  /*                                                                       */
+  /*   Define this macro if you want to enable this `feature'.             */
+  /*                                                                       */
+/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */
+
+
+  /*************************************************************************/
+  /*                                                                       */
   /* DLL export compilation                                                */
   /*                                                                       */
   /*   When compiling FreeType as a DLL, some systems/compilers need a     */
@@ -514,7 +541,7 @@ FT_BEGIN_HEADER
   /* does not contain any glyph name though.                               */
   /*                                                                       */
   /* Accessing SFNT names is done through the functions declared in        */
-  /* `freetype/ftsnames.h'.                                                */
+  /* `ftsnames.h'.                                                         */
   /*                                                                       */
 #define TT_CONFIG_OPTION_SFNT_NAMES
 
@@ -560,6 +587,28 @@ FT_BEGIN_HEADER
 
   /*************************************************************************/
   /*                                                                       */
+  /* 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  */
   /* of the TrueType bytecode interpreter is used that doesn't implement   */
   /* any of the patented opcodes and algorithms.  The patents related to   */
@@ -669,7 +718,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.                                                             */
   /*                                                                       */
@@ -716,6 +765,49 @@ FT_BEGIN_HEADER
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
+  /****         C F F   D R I V E R    C O N F I G U R A T I O N        ****/
+  /****                                                                 ****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* Using CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4} it is      */
+  /* possible to set up the default values of the four control points that */
+  /* define the stem darkening behaviour of the (new) CFF engine.  For     */
+  /* more details please read the documentation of the                     */
+  /* `darkening-parameters' property of the cff driver module (file        */
+  /* `ftcffdrv.h'), which allows the control at run-time.                  */
+  /*                                                                       */
+  /* Do *not* undefine these macros!                                       */
+  /*                                                                       */
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1   500
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1   400
+
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2  1000
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2   275
+
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3  1667
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3   275
+
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4  2333
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4     0
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* 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 */
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /****                                                                 ****/
   /****    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     ****/
   /****                                                                 ****/
   /*************************************************************************/
@@ -752,37 +844,10 @@ FT_BEGIN_HEADER
 
 
   /*
-   * 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 */
 
 
   /*
@@ -796,6 +861,35 @@ FT_BEGIN_HEADER
 #define  TT_USE_BYTECODE_INTERPRETER
 #endif
 
+
+  /*
+   * Check CFF darkening parameters.  The checks are the same as in function
+   * `cff_property_set' in file `cffdrivr.c'.
+   */
+#if CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 < 0   || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 < 0   || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 < 0   || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 < 0   || \
+                                                      \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 < 0   || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 < 0   || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 < 0   || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 < 0   || \
+                                                      \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 >        \
+      CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2     || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 >        \
+      CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3     || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 >        \
+      CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4     || \
+                                                      \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 > 500 || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 > 500 || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 > 500 || \
+    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 > 500
+#error "Invalid CFF darkening parameters!"
+#endif
+
 FT_END_HEADER
 
 
similarity index 98%
rename from include/freetype/config/ftstdlib.h
rename to include/config/ftstdlib.h
index 11d5d0e..b940efc 100644 (file)
@@ -5,7 +5,7 @@
 /*    ANSI-specific library and header configuration file (specification   */
 /*    only).                                                               */
 /*                                                                         */
-/*  Copyright 2002-2007, 2009, 2011 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,       */
                                 /*       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 */
similarity index 93%
rename from include/freetype/freetype.h
rename to include/freetype.h
index 63c291a..27fd44b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType high-level API and common types (specification only).       */
 /*                                                                         */
-/*  Copyright 1996-2012 by                                                 */
+/*  Copyright 1996-2014 by                                                 */
 /*  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."
 #endif
 
 
-#ifndef __FREETYPE_H__
-#define __FREETYPE_H__
-
-
 #include <ft2build.h>
 #include FT_CONFIG_CONFIG_H
-#include FT_ERRORS_H
 #include FT_TYPES_H
+#include FT_ERRORS_H
 
 
 FT_BEGIN_HEADER
@@ -42,6 +42,38 @@ FT_BEGIN_HEADER
   /*************************************************************************/
   /*                                                                       */
   /* <Section>                                                             */
+  /*    header_inclusion                                                   */
+  /*                                                                       */
+  /* <Title>                                                               */
+  /*    FreeType's header inclusion scheme                                 */
+  /*                                                                       */
+  /* <Abstract>                                                            */
+  /*    How client applications should include FreeType header files.      */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    To be as flexible as possible (and for historical reasons),        */
+  /*    FreeType uses a very special inclusion scheme to load header       */
+  /*    files, for example                                                 */
+  /*                                                                       */
+  /*    {                                                                  */
+  /*      #include <ft2build.h>                                            */
+  /*                                                                       */
+  /*      #include FT_FREETYPE_H                                           */
+  /*      #include FT_OUTLINE_H                                            */
+  /*    }                                                                  */
+  /*                                                                       */
+  /*    A compiler and its preprocessor only needs an include path to find */
+  /*    the file `ft2build.h'; the exact locations and names of the other  */
+  /*    FreeType header files are hidden by preprocessor macro names,      */
+  /*    loaded by `ft2build.h'.  The API documentation always gives the    */
+  /*    header macro name needed for a particular function.                */
+  /*                                                                       */
+  /*************************************************************************/
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Section>                                                             */
   /*    user_allocation                                                    */
   /*                                                                       */
   /* <Title>                                                               */
@@ -81,7 +113,8 @@ FT_BEGIN_HEADER
   /*    The FreeType~2 base font interface.                                */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    This section describes the public high-level API of FreeType~2.    */
+  /*    This section describes the most important public high-level API    */
+  /*    functions of FreeType~2.                                           */
   /*                                                                       */
   /* <Order>                                                               */
   /*    FT_Library                                                         */
@@ -90,6 +123,7 @@ FT_BEGIN_HEADER
   /*    FT_GlyphSlot                                                       */
   /*    FT_CharMap                                                         */
   /*    FT_Encoding                                                        */
+  /*    FT_ENC_TAG                                                         */
   /*                                                                       */
   /*    FT_FaceRec                                                         */
   /*                                                                       */
@@ -98,13 +132,30 @@ FT_BEGIN_HEADER
   /*    FT_FACE_FLAG_FIXED_WIDTH                                           */
   /*    FT_FACE_FLAG_HORIZONTAL                                            */
   /*    FT_FACE_FLAG_VERTICAL                                              */
+  /*    FT_FACE_FLAG_COLOR                                                 */
   /*    FT_FACE_FLAG_SFNT                                                  */
+  /*    FT_FACE_FLAG_CID_KEYED                                             */
+  /*    FT_FACE_FLAG_TRICKY                                                */
   /*    FT_FACE_FLAG_KERNING                                               */
   /*    FT_FACE_FLAG_MULTIPLE_MASTERS                                      */
   /*    FT_FACE_FLAG_GLYPH_NAMES                                           */
   /*    FT_FACE_FLAG_EXTERNAL_STREAM                                       */
-  /*    FT_FACE_FLAG_FAST_GLYPHS                                           */
   /*    FT_FACE_FLAG_HINTER                                                */
+  /*    FT_FACE_FLAG_TRICKY                                                */
+  /*                                                                       */
+  /*    FT_HAS_HORIZONTAL                                                  */
+  /*    FT_HAS_VERTICAL                                                    */
+  /*    FT_HAS_KERNING                                                     */
+  /*    FT_HAS_FIXED_SIZES                                                 */
+  /*    FT_HAS_GLYPH_NAMES                                                 */
+  /*    FT_HAS_MULTIPLE_MASTERS                                            */
+  /*    FT_HAS_COLOR                                                       */
+  /*                                                                       */
+  /*    FT_IS_SFNT                                                         */
+  /*    FT_IS_SCALABLE                                                     */
+  /*    FT_IS_FIXED_WIDTH                                                  */
+  /*    FT_IS_CID_KEYED                                                    */
+  /*    FT_IS_TRICKY                                                       */
   /*                                                                       */
   /*    FT_STYLE_FLAG_BOLD                                                 */
   /*    FT_STYLE_FLAG_ITALIC                                               */
@@ -123,6 +174,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    FT_New_Face                                                        */
   /*    FT_Done_Face                                                       */
+  /*    FT_Reference_Face                                                  */
   /*    FT_New_Memory_Face                                                 */
   /*    FT_Open_Face                                                       */
   /*    FT_Open_Args                                                       */
@@ -135,10 +187,13 @@ FT_BEGIN_HEADER
   /*    FT_Request_Size                                                    */
   /*    FT_Select_Size                                                     */
   /*    FT_Size_Request_Type                                               */
+  /*    FT_Size_RequestRec                                                 */
   /*    FT_Size_Request                                                    */
   /*    FT_Set_Transform                                                   */
   /*    FT_Load_Glyph                                                      */
   /*    FT_Get_Char_Index                                                  */
+  /*    FT_Get_First_Char                                                  */
+  /*    FT_Get_Next_Char                                                   */
   /*    FT_Get_Name_Index                                                  */
   /*    FT_Load_Char                                                       */
   /*                                                                       */
@@ -155,11 +210,11 @@ FT_BEGIN_HEADER
   /*    FT_LOAD_NO_SCALE                                                   */
   /*    FT_LOAD_NO_HINTING                                                 */
   /*    FT_LOAD_NO_BITMAP                                                  */
-  /*    FT_LOAD_CROP_BITMAP                                                */
+  /*    FT_LOAD_NO_AUTOHINT                                                */
+  /*    FT_LOAD_COLOR                                                      */
   /*                                                                       */
   /*    FT_LOAD_VERTICAL_LAYOUT                                            */
   /*    FT_LOAD_IGNORE_TRANSFORM                                           */
-  /*    FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH                                */
   /*    FT_LOAD_FORCE_AUTOHINT                                             */
   /*    FT_LOAD_NO_RECURSE                                                 */
   /*    FT_LOAD_PEDANTIC                                                   */
@@ -170,6 +225,8 @@ FT_BEGIN_HEADER
   /*    FT_LOAD_TARGET_LCD                                                 */
   /*    FT_LOAD_TARGET_LCD_V                                               */
   /*                                                                       */
+  /*    FT_LOAD_TARGET_MODE                                                */
+  /*                                                                       */
   /*    FT_Render_Glyph                                                    */
   /*    FT_Render_Mode                                                     */
   /*    FT_Get_Kerning                                                     */
@@ -183,14 +240,22 @@ FT_BEGIN_HEADER
   /*    FT_Set_Charmap                                                     */
   /*    FT_Get_Charmap_Index                                               */
   /*                                                                       */
-  /*    FT_FSTYPE_INSTALLABLE_EMBEDDING                                    */
-  /*    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING                             */
-  /*    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING                              */
-  /*    FT_FSTYPE_EDITABLE_EMBEDDING                                       */
-  /*    FT_FSTYPE_NO_SUBSETTING                                            */
-  /*    FT_FSTYPE_BITMAP_EMBEDDING_ONLY                                    */
-  /*                                                                       */
   /*    FT_Get_FSType_Flags                                                */
+  /*    FT_Get_SubGlyph_Info                                               */
+  /*                                                                       */
+  /*    FT_Face_Internal                                                   */
+  /*    FT_Size_Internal                                                   */
+  /*    FT_Slot_Internal                                                   */
+  /*                                                                       */
+  /*    FT_FACE_FLAG_XXX                                                   */
+  /*    FT_STYLE_FLAG_XXX                                                  */
+  /*    FT_OPEN_XXX                                                        */
+  /*    FT_LOAD_XXX                                                        */
+  /*    FT_LOAD_TARGET_XXX                                                 */
+  /*    FT_SUBGLYPH_FLAG_XXX                                               */
+  /*    FT_FSTYPE_XXX                                                      */
+  /*                                                                       */
+  /*    FT_HAS_FAST_GLYPHS                                                 */
   /*                                                                       */
   /*************************************************************************/
 
@@ -237,6 +302,10 @@ FT_BEGIN_HEADER
   /*    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;
@@ -325,18 +394,27 @@ FT_BEGIN_HEADER
   /*    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     */
-  /*    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;
 
 
   /*************************************************************************/
   /*                                                                       */
+  /* <Section>                                                             */
+  /*    module_management                                                  */
+  /*                                                                       */
+  /*************************************************************************/
+
+  /*************************************************************************/
+  /*                                                                       */
   /* <Type>                                                                */
   /*    FT_Module                                                          */
   /*                                                                       */
@@ -376,6 +454,13 @@ FT_BEGIN_HEADER
 
   /*************************************************************************/
   /*                                                                       */
+  /* <Section>                                                             */
+  /*    base_interface                                                     */
+  /*                                                                       */
+  /*************************************************************************/
+
+  /*************************************************************************/
+  /*                                                                       */
   /* <Type>                                                                */
   /*    FT_Face                                                            */
   /*                                                                       */
@@ -411,7 +496,8 @@ FT_BEGIN_HEADER
   /* <Note>                                                                */
   /*    Each @FT_Face has an _active_ @FT_Size object that is used by      */
   /*    functions like @FT_Load_Glyph to determine the scaling             */
-  /*    transformation which is used to load and hint glyphs and metrics.  */
+  /*    transformation that in turn is used to load and hint glyphs and    */
+  /*    metrics.                                                           */
   /*                                                                       */
   /*    You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes,                */
   /*    @FT_Request_Size or even @FT_Select_Size to change the content     */
@@ -546,11 +632,12 @@ FT_BEGIN_HEADER
   /*    FT_ENCODING_MS_SYMBOL ::                                           */
   /*      Corresponds to the Microsoft Symbol encoding, used to encode     */
   /*      mathematical symbols in the 32..255 character code range.  For   */
-  /*      more information, see `http://www.ceviz.net/symbol.htm'.         */
+  /*      more information, see                                            */
+  /*      `http://www.kostis.net/charsets/symbol.htm'.                     */
   /*                                                                       */
   /*    FT_ENCODING_SJIS ::                                                */
   /*      Corresponds to Japanese SJIS encoding.  More info at             */
-  /*      at `http://langsupport.japanreference.com/encoding.shtml'.       */
+  /*      at `http://en.wikipedia.org/wiki/Shift_JIS'.                     */
   /*      See note on multi-byte encodings below.                          */
   /*                                                                       */
   /*    FT_ENCODING_GB2312 ::                                              */
@@ -564,7 +651,7 @@ FT_BEGIN_HEADER
   /*    FT_ENCODING_WANSUNG ::                                             */
   /*      Corresponds to the Korean encoding system known as Wansung.      */
   /*      For more information see                                         */
-  /*      `http://www.microsoft.com/typography/unicode/949.txt'.           */
+  /*      `http://msdn.microsoft.com/en-US/goglobal/cc305154'.             */
   /*                                                                       */
   /*    FT_ENCODING_JOHAB ::                                               */
   /*      The Korean standard character set (KS~C 5601-1992), which        */
@@ -639,10 +726,10 @@ FT_BEGIN_HEADER
   /*    FT_ENCODING_APPLE_ROMAN).                                          */
   /*                                                                       */
   /*    If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function       */
-  /*    @FT_Get_CMap_Language_ID  to query the Mac language ID which may   */
+  /*    @FT_Get_CMap_Language_ID to query the Mac language ID that may     */
   /*    be needed to be able to distinguish Apple encoding variants.  See  */
   /*                                                                       */
-  /*      http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT  */
+  /*      http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt  */
   /*                                                                       */
   /*    to get an idea how to do that.  Basically, if the language ID      */
   /*    is~0, don't use it, otherwise subtract 1 from the language ID.     */
@@ -684,15 +771,8 @@ FT_BEGIN_HEADER
   } FT_Encoding;
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Enum>                                                                */
-  /*    ft_encoding_xxx                                                    */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    These constants are deprecated; use the corresponding @FT_Encoding */
-  /*    values instead.                                                    */
-  /*                                                                       */
+  /* these constants are deprecated; use the corresponding `FT_Encoding' */
+  /* values instead                                                      */
 #define ft_encoding_none            FT_ENCODING_NONE
 #define ft_encoding_unicode         FT_ENCODING_UNICODE
 #define ft_encoding_symbol          FT_ENCODING_MS_SYMBOL
@@ -802,7 +882,7 @@ FT_BEGIN_HEADER
   /*                           highest CID used in the font.               */
   /*                                                                       */
   /*    family_name         :: The face's family name.  This is an ASCII   */
-  /*                           string, usually in English, which describes */
+  /*                           string, usually in English, that describes  */
   /*                           the typeface's family (like `Times New      */
   /*                           Roman', `Bodoni', `Garamond', etc).  This   */
   /*                           is a least common denominator used to list  */
@@ -814,7 +894,7 @@ FT_BEGIN_HEADER
   /*                           PDF file).                                  */
   /*                                                                       */
   /*    style_name          :: The face's style name.  This is an ASCII    */
-  /*                           string, usually in English, which describes */
+  /*                           string, usually in English, that describes  */
   /*                           the typeface's style (like `Italic',        */
   /*                           `Bold', `Condensed', etc).  Not all font    */
   /*                           formats provide a style name, so this field */
@@ -844,8 +924,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,  */
-  /*                           `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.                                    */
   /*                                                                       */
@@ -871,19 +951,22 @@ FT_BEGIN_HEADER
   /*                           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.                                    */
   /*                                                                       */
-  /*    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.                                    */
   /*                                                                       */
-  /*    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   */
@@ -1045,7 +1128,7 @@ FT_BEGIN_HEADER
   /*      exist make FT_Load_Glyph return successfully; in all other cases */
   /*      you get an `FT_Err_Invalid_Argument' error.                      */
   /*                                                                       */
-  /*      Note that CID-keyed fonts which are in an SFNT wrapper don't     */
+  /*      Note that CID-keyed fonts that are in an SFNT wrapper don't      */
   /*      have this flag set since the glyphs are accessed in the normal   */
   /*      way (using contiguous indices); the `CID-ness' isn't visible to  */
   /*      the application.                                                 */
@@ -1053,7 +1136,7 @@ FT_BEGIN_HEADER
   /*    FT_FACE_FLAG_TRICKY ::                                             */
   /*      Set if the font is `tricky', this is, it always needs the        */
   /*      font format's native hinting engine to get a reasonable result.  */
-  /*      A typical example is the Chinese font `mingli.ttf' which uses    */
+  /*      A typical example is the Chinese font `mingli.ttf' that uses     */
   /*      TrueType bytecode instructions to move and scale all of its      */
   /*      subglyphs.                                                       */
   /*                                                                       */
@@ -1066,6 +1149,10 @@ FT_BEGIN_HEADER
   /*      Currently, there are about a dozen TrueType fonts in the list of */
   /*      tricky fonts; they are hard-coded in file `ttobjs.c'.            */
   /*                                                                       */
+  /*    FT_FACE_FLAG_COLOR ::                                              */
+  /*      Set if the font has color glyph tables.  To access color glyphs  */
+  /*      use @FT_LOAD_COLOR.                                              */
+  /*                                                                       */
 #define FT_FACE_FLAG_SCALABLE          ( 1L <<  0 )
 #define FT_FACE_FLAG_FIXED_SIZES       ( 1L <<  1 )
 #define FT_FACE_FLAG_FIXED_WIDTH       ( 1L <<  2 )
@@ -1080,6 +1167,7 @@ FT_BEGIN_HEADER
 #define FT_FACE_FLAG_HINTER            ( 1L << 11 )
 #define FT_FACE_FLAG_CID_KEYED         ( 1L << 12 )
 #define FT_FACE_FLAG_TRICKY            ( 1L << 13 )
+#define FT_FACE_FLAG_COLOR             ( 1L << 14 )
 
 
   /*************************************************************************
@@ -1105,8 +1193,8 @@ FT_BEGIN_HEADER
    *   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 ) \
@@ -1264,6 +1352,20 @@ FT_BEGIN_HEADER
           ( face->face_flags & FT_FACE_FLAG_TRICKY )
 
 
+  /*************************************************************************
+   *
+   * @macro:
+   *   FT_HAS_COLOR( face )
+   *
+   * @description:
+   *   A macro that returns true whenever a face object contains
+   *   tables for color glyphs.
+   *
+   */
+#define FT_HAS_COLOR( face ) \
+          ( face->face_flags & FT_FACE_FLAG_COLOR )
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Const>                                                               */
@@ -1338,7 +1440,7 @@ FT_BEGIN_HEADER
   /*    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>                                                                */
@@ -1385,9 +1487,9 @@ FT_BEGIN_HEADER
   /* <Fields>                                                              */
   /*    face    :: Handle to the parent face object.                       */
   /*                                                                       */
-  /*    generic :: A typeless pointer, which is unused by the FreeType     */
-  /*               library or any of its drivers.  It can be used by       */
-  /*               client applications to link their own data to each size */
+  /*    generic :: A typeless pointer, unused by the FreeType library or   */
+  /*               any of its drivers.  It can be used by client           */
+  /*               applications to link their own data to each size        */
   /*               object.                                                 */
   /*                                                                       */
   /*    metrics :: Metrics for this size object.  This field is read-only. */
@@ -1455,10 +1557,10 @@ FT_BEGIN_HEADER
   /*                         listed through a direct, single-linked list   */
   /*                         using its `next' field.                       */
   /*                                                                       */
-  /*    generic           :: A typeless pointer which is unused by the     */
-  /*                         FreeType library or any of its drivers.  It   */
-  /*                         can be used by client applications to link    */
-  /*                         their own data to each glyph slot object.     */
+  /*    generic           :: A typeless pointer unused by the FreeType     */
+  /*                         library or any of its drivers.  It can be     */
+  /*                         used by client applications to link their own */
+  /*                         data to each glyph slot object.               */
   /*                                                                       */
   /*    metrics           :: The metrics of the last loaded glyph in the   */
   /*                         slot.  The returned values depend on the last */
@@ -1485,8 +1587,8 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    advance           :: This shorthand is, depending on               */
   /*                         @FT_LOAD_IGNORE_TRANSFORM, the transformed    */
-  /*                         advance width for the glyph (in 26.6          */
-  /*                         fractional pixel format).  As specified with  */
+  /*                         (hinted) advance width for the glyph, in 26.6 */
+  /*                         fractional pixel format.  As specified with   */
   /*                         @FT_LOAD_VERTICAL_LAYOUT, it uses either the  */
   /*                         `horiAdvance' or the `vertAdvance' value of   */
   /*                         `metrics' field.                              */
@@ -1505,15 +1607,15 @@ FT_BEGIN_HEADER
   /*                         change between calls of @FT_Load_Glyph and a  */
   /*                         few other functions.                          */
   /*                                                                       */
-  /*    bitmap_left       :: This is the bitmap's left bearing expressed   */
-  /*                         in integer pixels.  Of course, this is only   */
-  /*                         valid if the format is                        */
-  /*                         @FT_GLYPH_FORMAT_BITMAP.                      */
+  /*    bitmap_left       :: The bitmap's left bearing expressed in        */
+  /*                         integer pixels.  Only valid if the format is  */
+  /*                         @FT_GLYPH_FORMAT_BITMAP, this is, if the      */
+  /*                         glyph slot contains a bitmap.                 */
   /*                                                                       */
-  /*    bitmap_top        :: This is the bitmap's top bearing expressed in */
-  /*                         integer pixels.  Remember that this is the    */
-  /*                         distance from the baseline to the top-most    */
-  /*                         glyph scanline, upwards y~coordinates being   */
+  /*    bitmap_top        :: The bitmap's top bearing expressed in integer */
+  /*                         pixels.  Remember that this is the distance   */
+  /*                         from the baseline to the top-most glyph       */
+  /*                         scanline, upwards y~coordinates being         */
   /*                         *positive*.                                   */
   /*                                                                       */
   /*    outline           :: The outline descriptor for the current glyph  */
@@ -1527,7 +1629,6 @@ FT_BEGIN_HEADER
   /*                         This field is only valid for the composite    */
   /*                         glyph format that should normally only be     */
   /*                         loaded with the @FT_LOAD_NO_RECURSE flag.     */
-  /*                         For now this is internal to FreeType.         */
   /*                                                                       */
   /*    subglyphs         :: An array of subglyph descriptors for          */
   /*                         composite glyphs.  There are `num_subglyphs'  */
@@ -1575,7 +1676,7 @@ FT_BEGIN_HEADER
   /*    `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP.         */
   /*                                                                       */
   /* <Note>                                                                */
-  /*    Here a small pseudo code fragment which shows how to use           */
+  /*    Here a small pseudo code fragment that shows how to use            */
   /*    `lsb_delta' and `rsb_delta':                                       */
   /*                                                                       */
   /*    {                                                                  */
@@ -1671,6 +1772,9 @@ FT_BEGIN_HEADER
   /*    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 );
 
@@ -1715,16 +1819,6 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    FT_OPEN_PARAMS   :: Use the `num_params' and `params' fields.      */
   /*                                                                       */
-  /*    ft_open_memory   :: Deprecated; use @FT_OPEN_MEMORY instead.       */
-  /*                                                                       */
-  /*    ft_open_stream   :: Deprecated; use @FT_OPEN_STREAM instead.       */
-  /*                                                                       */
-  /*    ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead.     */
-  /*                                                                       */
-  /*    ft_open_driver   :: Deprecated; use @FT_OPEN_DRIVER instead.       */
-  /*                                                                       */
-  /*    ft_open_params   :: Deprecated; use @FT_OPEN_PARAMS instead.       */
-  /*                                                                       */
   /* <Note>                                                                */
   /*    The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME'     */
   /*    flags are mutually exclusive.                                      */
@@ -1735,11 +1829,14 @@ FT_BEGIN_HEADER
 #define FT_OPEN_DRIVER    0x8
 #define FT_OPEN_PARAMS    0x10
 
-#define ft_open_memory    FT_OPEN_MEMORY     /* deprecated */
-#define ft_open_stream    FT_OPEN_STREAM     /* deprecated */
-#define ft_open_pathname  FT_OPEN_PATHNAME   /* deprecated */
-#define ft_open_driver    FT_OPEN_DRIVER     /* deprecated */
-#define ft_open_params    FT_OPEN_PARAMS     /* deprecated */
+
+  /* these constants are deprecated; use the corresponding `FT_OPEN_XXX' */
+  /* values instead                                                      */
+#define ft_open_memory    FT_OPEN_MEMORY
+#define ft_open_stream    FT_OPEN_STREAM
+#define ft_open_pathname  FT_OPEN_PATHNAME
+#define ft_open_driver    FT_OPEN_DRIVER
+#define ft_open_params    FT_OPEN_PARAMS
 
 
   /*************************************************************************/
@@ -1801,25 +1898,25 @@ FT_BEGIN_HEADER
   /*                   opening a new face.                                 */
   /*                                                                       */
   /* <Note>                                                                */
-  /*    The stream type is determined by the contents of `flags' which     */
+  /*    The stream type is determined by the contents of `flags' that      */
   /*    are tested in the following order by @FT_Open_Face:                */
   /*                                                                       */
-  /*    If the `FT_OPEN_MEMORY' bit is set, assume that this is a          */
+  /*    If the @FT_OPEN_MEMORY bit is set, assume that this is a           */
   /*    memory file of `memory_size' bytes, located at `memory_address'.   */
   /*    The data are are not copied, and the client is responsible for     */
   /*    releasing and destroying them _after_ the corresponding call to    */
   /*    @FT_Done_Face.                                                     */
   /*                                                                       */
-  /*    Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a       */
+  /*    Otherwise, if the @FT_OPEN_STREAM bit is set, assume that a        */
   /*    custom input stream `stream' is used.                              */
   /*                                                                       */
-  /*    Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this  */
+  /*    Otherwise, if the @FT_OPEN_PATHNAME bit is set, assume that this   */
   /*    is a normal file and use `pathname' to open it.                    */
   /*                                                                       */
-  /*    If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to    */
+  /*    If the @FT_OPEN_DRIVER bit is set, @FT_Open_Face only tries to     */
   /*    open the file with the driver whose handler is in `driver'.        */
   /*                                                                       */
-  /*    If the `FT_OPEN_PARAMS' bit is set, the parameters given by        */
+  /*    If the @FT_OPEN_PARAMS bit is set, the parameters given by         */
   /*    `num_params' and `params' is used.  They are ignored otherwise.    */
   /*                                                                       */
   /*    Ideally, both the `pathname' and `params' fields should be tagged  */
@@ -1865,6 +1962,10 @@ FT_BEGIN_HEADER
   /* <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,
@@ -1878,7 +1979,7 @@ FT_BEGIN_HEADER
   /*    FT_New_Memory_Face                                                 */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    This function calls @FT_Open_Face to open a font which has been    */
+  /*    This function calls @FT_Open_Face to open a font that has been     */
   /*    loaded into memory.                                                */
   /*                                                                       */
   /* <InOut>                                                               */
@@ -1924,7 +2025,7 @@ FT_BEGIN_HEADER
   /*    library    :: A handle to the library resource.                    */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    args       :: A pointer to an `FT_Open_Args' structure which must  */
+  /*    args       :: A pointer to an `FT_Open_Args' structure that must   */
   /*                  be filled by the caller.                             */
   /*                                                                       */
   /*    face_index :: The index of the face within the font.  The first    */
@@ -1940,7 +2041,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Note>                                                                */
   /*    Unlike FreeType 1.x, this function automatically creates a glyph   */
-  /*    slot for the face object which can be accessed directly through    */
+  /*    slot for the face object that can be accessed directly through     */
   /*    `face->glyph'.                                                     */
   /*                                                                       */
   /*    FT_Open_Face can be used to quickly check whether the font         */
@@ -1949,7 +2050,7 @@ FT_BEGIN_HEADER
   /*    if the font format is recognized, or non-zero otherwise;           */
   /*    the function returns a more or less empty face handle in `*aface'  */
   /*    (if `aface' isn't NULL).  The only useful field in this special    */
-  /*    case is `face->num_faces' which gives the number of faces within   */
+  /*    case is `face->num_faces' that gives the number of faces within    */
   /*    the font file.  After examination, the returned @FT_Face structure */
   /*    should be deallocated with a call to @FT_Done_Face.                */
   /*                                                                       */
@@ -2007,7 +2108,7 @@ FT_BEGIN_HEADER
   /*    face       :: The target face object.                              */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    parameters :: A pointer to @FT_Open_Args which must be filled by   */
+  /*    parameters :: A pointer to @FT_Open_Args that must be filled by    */
   /*                  the caller.                                          */
   /*                                                                       */
   /* <Return>                                                              */
@@ -2038,7 +2139,7 @@ FT_BEGIN_HEADER
   /*    then only destroys a face if the counter is~1, otherwise it simply */
   /*    decrements the counter.                                            */
   /*                                                                       */
-  /*    This function helps in managing life-cycles of structures which    */
+  /*    This function helps in managing life-cycles of structures that     */
   /*    reference @FT_Face objects.                                        */
   /*                                                                       */
   /* <Input>                                                               */
@@ -2227,6 +2328,14 @@ FT_BEGIN_HEADER
   /*    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'      */
+  /*                                                                       */
+  /*    Don't use this function if you are using the FreeType cache API.   */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Request_Size( FT_Face          face,
                    FT_Size_Request  req );
@@ -2296,6 +2405,13 @@ FT_BEGIN_HEADER
   /* <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.             */
+  /*                                                                       */
+  /*    Don't use this function if you are using the FreeType cache API.   */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Set_Pixel_Sizes( FT_Face  face,
                       FT_UInt  pixel_width,
@@ -2334,7 +2450,7 @@ FT_BEGIN_HEADER
   /*    the details.                                                       */
   /*                                                                       */
   /*    For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is        */
-  /*    returned for invalid CID values (this is, for CID values which     */
+  /*    returned for invalid CID values (this is, for CID values that      */
   /*    don't have a corresponding glyph in the font).  See the discussion */
   /*    of the @FT_FACE_FLAG_CID_KEYED flag for more details.              */
   /*                                                                       */
@@ -2409,14 +2525,20 @@ FT_BEGIN_HEADER
    *     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.
    *
+   *     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 ::
-   *     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.
@@ -2435,18 +2557,19 @@ FT_BEGIN_HEADER
    *     @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
    *     hinter.  See also the note below.
    *
-   *   FT_LOAD_CROP_BITMAP ::
-   *     Indicates that the font driver should crop the loaded bitmap glyph
-   *     (i.e., remove all space around its black bits).  Not all drivers
-   *     implement this.
-   *
    *   FT_LOAD_PEDANTIC ::
    *     Indicates that the font driver should perform pedantic verifications
    *     during glyph loading.  This is mostly used to detect broken glyphs
@@ -2457,18 +2580,12 @@ FT_BEGIN_HEADER
    *     result in partially hinted or distorted glyphs in case a glyph's
    *     bytecode is buggy.
    *
-   *   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
-   *     Ignored.  Deprecated.
-   *
    *   FT_LOAD_NO_RECURSE ::
-   *     This flag is only used internally.  It merely indicates that the
-   *     font driver should not load composite glyphs recursively.  Instead,
-   *     it should set the `num_subglyph' and `subglyphs' values of the
-   *     glyph slot accordingly, and set `glyph->format' to
-   *     @FT_GLYPH_FORMAT_COMPOSITE.
-   *
-   *     The description of sub-glyphs is not available to client
-   *     applications for now.
+   *     Indicate that the font driver should not load composite glyphs
+   *     recursively.  Instead, it should set the `num_subglyph' and
+   *     `subglyphs' values of the glyph slot accordingly, and set
+   *     `glyph->format' to @FT_GLYPH_FORMAT_COMPOSITE.  The description of
+   *     subglyphs can then be accessed with @FT_Get_SubGlyph_Info.
    *
    *     This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.
    *
@@ -2493,6 +2610,20 @@ FT_BEGIN_HEADER
    *   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.
+   *
+   *   FT_LOAD_CROP_BITMAP ::
+   *     Ignored.  Deprecated.
+   *
+   *   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
+   *     Ignored.  Deprecated.
+   *
    * @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
@@ -2507,6 +2638,13 @@ 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.
    *
+   *   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_NO_SCALE                     ( 1L << 0 )
@@ -2523,6 +2661,8 @@ FT_BEGIN_HEADER
 #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 )
 
   /* */
 
@@ -2579,8 +2719,9 @@ FT_BEGIN_HEADER
    *   `load_flags'.  They can't be ORed.
    *
    *   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.
+   *   corresponding mode (i.e., the mode that matches the used algorithm
+   *   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'
@@ -2719,19 +2860,8 @@ FT_BEGIN_HEADER
   } FT_Render_Mode;
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Enum>                                                                */
-  /*    ft_render_mode_xxx                                                 */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    These constants are deprecated.  Use the corresponding             */
-  /*    @FT_Render_Mode values instead.                                    */
-  /*                                                                       */
-  /* <Values>                                                              */
-  /*    ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL                */
-  /*    ft_render_mode_mono   :: see @FT_RENDER_MODE_MONO                  */
-  /*                                                                       */
+  /* these constants are deprecated; use the corresponding */
+  /* `FT_Render_Mode' values instead                       */
 #define ft_render_mode_normal  FT_RENDER_MODE_NORMAL
 #define ft_render_mode_mono    FT_RENDER_MODE_MONO
 
@@ -2758,6 +2888,10 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
+  /* <Note>                                                                */
+  /*    To get meaningful results, font scaling values must be set with    */
+  /*    functions like @FT_Set_Char_Size before calling FT_Render_Glyph.   */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Render_Glyph( FT_GlyphSlot    slot,
                    FT_Render_Mode  render_mode );
@@ -2791,39 +2925,10 @@ FT_BEGIN_HEADER
   } FT_Kerning_Mode;
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Const>                                                               */
-  /*    ft_kerning_default                                                 */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    This constant is deprecated.  Please use @FT_KERNING_DEFAULT       */
-  /*    instead.                                                           */
-  /*                                                                       */
+  /* these constants are deprecated; use the corresponding */
+  /* `FT_Kerning_Mode' values instead                      */
 #define ft_kerning_default   FT_KERNING_DEFAULT
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Const>                                                               */
-  /*    ft_kerning_unfitted                                                */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    This constant is deprecated.  Please use @FT_KERNING_UNFITTED      */
-  /*    instead.                                                           */
-  /*                                                                       */
 #define ft_kerning_unfitted  FT_KERNING_UNFITTED
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Const>                                                               */
-  /*    ft_kerning_unscaled                                                */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    This constant is deprecated.  Please use @FT_KERNING_UNSCALED      */
-  /*    instead.                                                           */
-  /*                                                                       */
 #define ft_kerning_unscaled  FT_KERNING_UNSCALED
 
 
@@ -2922,7 +3027,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    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>                                                              */
@@ -2944,9 +3049,8 @@ FT_BEGIN_HEADER
   /*    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 always returns an error if the config macro          */
+  /*    `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is not defined in `ftoptions.h'. */
   /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Get_Glyph_Name( FT_Face     face,
@@ -3002,8 +3106,8 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    Because many fonts contain more than a single cmap for Unicode     */
   /*    encoding, this function has some special code to select the one    */
-  /*    which covers Unicode best (`best' in the sense that a UCS-4 cmap   */
-  /*    is preferred to a UCS-2 cmap).  It is thus preferable to           */
+  /*    that covers Unicode best (`best' in the sense that a UCS-4 cmap is */
+  /*    preferred to a UCS-2 cmap).  It is thus preferable to              */
   /*    @FT_Set_Charmap in this case.                                      */
   /*                                                                       */
   FT_EXPORT( FT_Error )
@@ -3081,9 +3185,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  */
-  /*    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,
@@ -3351,7 +3461,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Note>                                                                */
   /*    Use this function rather than directly reading the `fs_type' field */
-  /*    in the @PS_FontInfoRec structure which is only guaranteed to       */
+  /*    in the @PS_FontInfoRec structure, which is only guaranteed to      */
   /*    return the correct results for Type~1 fonts.                       */
   /*                                                                       */
   /* <Since>                                                               */
@@ -3383,9 +3493,13 @@ FT_BEGIN_HEADER
   /*    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 2014), the character with the most variants is   */
+  /*    U+9089, having 32 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 */
@@ -3527,7 +3641,7 @@ FT_BEGIN_HEADER
   /*      The character codepoint in Unicode.                              */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    A pointer to an array of variant selector code points which are    */
+  /*    A pointer to an array of variant selector code points that are     */
   /*    active for the given character, or NULL if the corresponding list  */
   /*    is empty.                                                          */
   /*                                                                       */
@@ -3561,7 +3675,7 @@ FT_BEGIN_HEADER
   /*      The variant selector code point in Unicode.                      */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    A list of all the code points which are specified by this selector */
+  /*    A list of all the code points that are specified by this selector  */
   /*    (both default and non-default codes are returned) or NULL if there */
   /*    is no valid cmap or the variant selector is invalid.               */
   /*                                                                       */
@@ -3614,7 +3728,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <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 */
@@ -3636,12 +3750,6 @@ FT_BEGIN_HEADER
              FT_Long  c );
 
 
-  /* */
-
-  /* The following #if 0 ... #endif is for the documentation formatter, */
-  /* hiding the internal `FT_MULFIX_INLINED' macro.                     */
-
-#if 0
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -3649,8 +3757,8 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <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.                                         */
@@ -3675,17 +3783,6 @@ FT_BEGIN_HEADER
   FT_MulFix( FT_Long  a,
              FT_Long  b );
 
-  /* */
-#endif
-
-#ifdef FT_MULFIX_INLINED
-#define FT_MulFix( a, b )  FT_MULFIX_INLINED( a, b )
-#else
-  FT_EXPORT( FT_Long )
-  FT_MulFix( FT_Long  a,
-             FT_Long  b );
-#endif
-
 
   /*************************************************************************/
   /*                                                                       */
@@ -3694,22 +3791,16 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <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.                                         */
-  /*    b :: The second multiplier.  Use a 16.16 factor here whenever      */
-  /*         possible (see note below).                                    */
+  /*    a :: The numerator.                                                */
+  /*    b :: The denominator.  Use a 16.16 factor here.                    */
   /*                                                                       */
   /* <Return>                                                              */
   /*    The result of `(a*0x10000)/b'.                                     */
   /*                                                                       */
-  /* <Note>                                                                */
-  /*    The optimization for FT_DivFix() is simple: If (a~<<~16) fits in   */
-  /*    32~bits, then the division is computed directly.  Otherwise, we    */
-  /*    use a specialized version of @FT_MulDiv.                           */
-  /*                                                                       */
   FT_EXPORT( FT_Long )
   FT_DivFix( FT_Long  a,
              FT_Long  b );
@@ -3809,6 +3900,18 @@ FT_BEGIN_HEADER
   /*    even a new release of FreeType with only documentation changes     */
   /*    increases the version number.                                      */
   /*                                                                       */
+  /* <Order>                                                               */
+  /*    FT_Library_Version                                                 */
+  /*                                                                       */
+  /*    FREETYPE_MAJOR                                                     */
+  /*    FREETYPE_MINOR                                                     */
+  /*    FREETYPE_PATCH                                                     */
+  /*                                                                       */
+  /*    FT_Face_CheckTrueTypePatents                                       */
+  /*    FT_Face_SetUnpatentedHinting                                       */
+  /*                                                                       */
+  /*    FREETYPE_XXX                                                       */
+  /*                                                                       */
   /*************************************************************************/
 
 
@@ -3833,8 +3936,8 @@ FT_BEGIN_HEADER
    *
    */
 #define FREETYPE_MAJOR  2
-#define FREETYPE_MINOR  4
-#define FREETYPE_PATCH  9
+#define FREETYPE_MINOR  5
+#define FREETYPE_PATCH  5
 
 
   /*************************************************************************/
diff --git a/include/freetype/internal/internal.h b/include/freetype/internal/internal.h
deleted file mode 100644 (file)
index f500a65..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  internal.h                                                             */
-/*                                                                         */
-/*    Internal header files (specification only).                          */
-/*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 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.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* This file is automatically included by `ft2build.h'.                  */
-  /* Do not include it manually!                                           */
-  /*                                                                       */
-  /*************************************************************************/
-
-
-#define FT_INTERNAL_OBJECTS_H             <freetype/internal/ftobjs.h>
-#define FT_INTERNAL_PIC_H                 <freetype/internal/ftpic.h>
-#define FT_INTERNAL_STREAM_H              <freetype/internal/ftstream.h>
-#define FT_INTERNAL_MEMORY_H              <freetype/internal/ftmemory.h>
-#define FT_INTERNAL_DEBUG_H               <freetype/internal/ftdebug.h>
-#define FT_INTERNAL_CALC_H                <freetype/internal/ftcalc.h>
-#define FT_INTERNAL_DRIVER_H              <freetype/internal/ftdriver.h>
-#define FT_INTERNAL_TRACE_H               <freetype/internal/fttrace.h>
-#define FT_INTERNAL_GLYPH_LOADER_H        <freetype/internal/ftgloadr.h>
-#define FT_INTERNAL_SFNT_H                <freetype/internal/sfnt.h>
-#define FT_INTERNAL_SERVICE_H             <freetype/internal/ftserv.h>
-#define FT_INTERNAL_RFORK_H               <freetype/internal/ftrfork.h>
-#define FT_INTERNAL_VALIDATE_H            <freetype/internal/ftvalid.h>
-
-#define FT_INTERNAL_TRUETYPE_TYPES_H      <freetype/internal/tttypes.h>
-#define FT_INTERNAL_TYPE1_TYPES_H         <freetype/internal/t1types.h>
-
-#define FT_INTERNAL_POSTSCRIPT_AUX_H      <freetype/internal/psaux.h>
-#define FT_INTERNAL_POSTSCRIPT_HINTS_H    <freetype/internal/pshints.h>
-#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H  <freetype/internal/psglobal.h>
-
-#define FT_INTERNAL_AUTOHINT_H            <freetype/internal/autohint.h>
-
-
-/* END */
index 923d887..6f8eb7f 100644 (file)
@@ -3,9 +3,8 @@
 /*  ft2build.h                                                             */
 /*                                                                         */
 /*    FreeType 2 build and setup macros.                                   */
-/*    (Generic version)                                                    */
 /*                                                                         */
-/*  Copyright 1996-2001, 2006 by                                           */
+/*  Copyright 1996-2001, 2006, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
   /*************************************************************************/
   /*                                                                       */
-  /* This file corresponds to the default `ft2build.h' file for            */
-  /* FreeType 2.  It uses the `freetype' include root.                     */
+  /* This is the `entry point' for FreeType header file inclusions.  It is */
+  /* the only header file which should be included directly; all other     */
+  /* FreeType header files should be accessed with macro names (after      */
+  /* including `ft2build.h').                                              */
   /*                                                                       */
-  /* Note that specific platforms might use a different configuration.     */
-  /* See builds/unix/ft2unix.h for an example.                             */
+  /* A typical example is                                                  */
+  /*                                                                       */
+  /*   #include <ft2build.h>                                               */
+  /*   #include FT_FREETYPE_H                                              */
   /*                                                                       */
   /*************************************************************************/
 
 
-#ifndef __FT2_BUILD_GENERIC_H__
-#define __FT2_BUILD_GENERIC_H__
+#ifndef __FT2BUILD_H__
+#define __FT2BUILD_H__
 
-#include <freetype/config/ftheader.h>
+#include <config/ftheader.h>
 
-#endif /* __FT2_BUILD_GENERIC_H__ */
+#endif /* __FT2BUILD_H__ */
 
 
 /* END */
similarity index 89%
rename from include/freetype/ftadvanc.h
rename to include/ftadvanc.h
index b2451be..955f93f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Quick computation of advance widths (specification only).            */
 /*                                                                         */
-/*  Copyright 2008 by                                                      */
+/*  Copyright 2008, 2013, 2014 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -48,6 +48,11 @@ FT_BEGIN_HEADER
    * @description:
    *   This section contains functions to quickly extract advance values
    *   without handling glyph outlines, if possible.
+   *
+   * @order:
+   *   FT_Get_Advance
+   *   FT_Get_Advances
+   *
    */
 
 
@@ -64,11 +69,11 @@ FT_BEGIN_HEADER
   /*    corresponding hinting mode or font driver doesn't allow for very   */
   /*    quick advance computation.                                         */
   /*                                                                       */
-  /*    Typically, glyphs which are either unscaled, unhinted, bitmapped,  */
+  /*    Typically, glyphs that are either unscaled, unhinted, bitmapped,   */
   /*    or light-hinted can have their advance width computed very         */
   /*    quickly.                                                           */
   /*                                                                       */
-  /*    Normal and bytecode hinted modes, which require loading, scaling,  */
+  /*    Normal and bytecode hinted modes that require loading, scaling,    */
   /*    and hinting of the glyph outline, are extremely slow by            */
   /*    comparison.                                                        */
   /*                                                                       */
@@ -82,8 +87,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <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.                          */
@@ -94,8 +98,9 @@ FT_BEGIN_HEADER
   /*                  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.   */
@@ -127,8 +132,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <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.                         */
@@ -141,8 +145,12 @@ FT_BEGIN_HEADER
   /*                   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.  */
@@ -168,7 +176,7 @@ FT_BEGIN_HEADER
                    FT_Int32   load_flags,
                    FT_Fixed  *padvances );
 
-/* */
+  /* */
 
 
 FT_END_HEADER
diff --git a/include/ftautoh.h b/include/ftautoh.h
new file mode 100644 (file)
index 0000000..59191ab
--- /dev/null
@@ -0,0 +1,402 @@
+/***************************************************************************/
+/*                                                                         */
+/*  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 that 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 script will affect this face.
+   *
+   */
+
+
+  /**************************************************************************
+   *
+   * @property:
+   *   default-script
+   *
+   * @description:
+   *   *Experimental* *only*
+   *
+   *   If Freetype gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make
+   *   the HarfBuzz library access OpenType features for getting better
+   *   glyph coverages, this property sets the (auto-fitter) script to be
+   *   used for the default (OpenType) script data of a font's GSUB table.
+   *   Features for the default script are intended for all scripts not
+   *   explicitly handled in GSUB; an example is a `dlig' feature,
+   *   containing the combination of the characters `T', `E', and `L' to
+   *   form a `TEL' ligature.
+   *
+   *   By default, this is @FT_AUTOHINTER_SCRIPT_LATIN.  Using the
+   *   `default-script' property, this default value can be changed.
+   *
+   *   {
+   *     FT_Library  library;
+   *     FT_UInt     default_script = FT_AUTOHINTER_SCRIPT_NONE;
+   *
+   *
+   *     FT_Init_FreeType( &library );
+   *
+   *     FT_Property_Set( library, "autofitter",
+   *                               "default-script", &default_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 that eventually uses the
+   *   default 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 default script 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 */
similarity index 97%
rename from include/freetype/ftbbox.h
rename to include/ftbbox.h
index 9766919..d6800e2 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType exact bbox computation (specification).                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2003, 2007, 2011 by                               */
+/*  Copyright 1996-2001, 2003, 2007, 2011, 2013 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -60,7 +60,7 @@ FT_BEGIN_HEADER
   /* <Description>                                                         */
   /*    Compute the exact bounding box of an outline.  This is slower      */
   /*    than computing the control box.  However, it uses an advanced      */
-  /*    algorithm which returns _very_ quickly when the two boxes          */
+  /*    algorithm that returns _very_ quickly when the two boxes           */
   /*    coincide.  Otherwise, the outline Bézier arcs are traversed to     */
   /*    extract their extrema.                                             */
   /*                                                                       */
@@ -78,14 +78,13 @@ FT_BEGIN_HEADER
   /*    @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  */
+  /*    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 );
 
-
   /* */
 
 
similarity index 96%
rename from include/freetype/ftbdf.h
rename to include/ftbdf.h
index 4f8baf8..6d262e4 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for accessing BDF-specific strings (specification).     */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2006, 2009 by                              */
+/*  Copyright 2002-2004, 2006, 2009, 2014 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -53,7 +53,7 @@ FT_BEGIN_HEADER
   /**********************************************************************
    *
    * @enum:
-   *    FT_PropertyType
+   *    BDF_PropertyType
    *
    * @description:
    *    A list of BDF property types.
@@ -106,7 +106,8 @@ FT_BEGIN_HEADER
   *      The property type.
   *
   *    u.atom ::
-  *      The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
+  *      The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.  May be
+  *      NULL, indicating an empty string.
   *
   *    u.integer ::
   *      A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
@@ -199,7 +200,7 @@ FT_BEGIN_HEADER
                        const char*       prop_name,
                        BDF_PropertyRec  *aproperty );
 
- /* */
 /* */
 
 FT_END_HEADER
 
similarity index 94%
rename from include/freetype/ftbitmap.h
rename to include/ftbitmap.h
index 9274236..eae7169 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility functions for bitmaps (specification).              */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2008 by                                    */
+/*  Copyright 2004-2006, 2008, 2013, 2014 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -45,7 +45,9 @@ FT_BEGIN_HEADER
   /*    Handling FT_Bitmap objects.                                        */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    This section contains functions for converting FT_Bitmap objects.  */
+  /*    This section contains functions for handling @FT_Bitmap objects.   */
+  /*    Note that none of the functions changes the bitmap's `flow' (as    */
+  /*    indicated by the sign of the `pitch' field in `FT_Bitmap').        */
   /*                                                                       */
   /*************************************************************************/
 
@@ -122,6 +124,9 @@ FT_BEGIN_HEADER
   /*    If you want to embolden the bitmap owned by a @FT_GlyphSlotRec,    */
   /*    you should call @FT_GlyphSlot_Own_Bitmap on the slot first.        */
   /*                                                                       */
+  /*    Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format    */
+  /*    are converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp).          */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Bitmap_Embolden( FT_Library  library,
                       FT_Bitmap*  bitmap,
@@ -135,9 +140,9 @@ FT_BEGIN_HEADER
   /*    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.                         */
similarity index 99%
rename from include/freetype/ftbzip2.h
rename to include/ftbzip2.h
index 1bf81b1..4dce161 100644 (file)
@@ -91,7 +91,7 @@ FT_BEGIN_HEADER
   FT_Stream_OpenBzip2( FT_Stream  stream,
                        FT_Stream  source );
 
- /* */
 /* */
 
 
 FT_END_HEADER
similarity index 94%
rename from include/freetype/ftcache.h
rename to include/ftcache.h
index 6af5306..a30e925 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType Cache subsystem (specification).                            */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
+/*  Copyright 1996-2008, 2010, 2013, 2014 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -156,7 +156,7 @@ FT_BEGIN_HEADER
    * @note:
    *   Never use NULL as a valid @FTC_FaceID.
    *
-   *   Face IDs are passed by the client to the cache manager, which calls,
+   *   Face IDs are passed by the client to the cache manager that calls,
    *   when needed, the @FTC_Face_Requester to translate them into new
    *   @FT_Face objects.
    *
@@ -209,22 +209,11 @@ FT_BEGIN_HEADER
   typedef FT_Error
   (*FTC_Face_Requester)( FTC_FaceID  face_id,
                          FT_Library  library,
-                         FT_Pointer  request_data,
+                         FT_Pointer  req_data,
                          FT_Face*    aface );
 
- /* */
-
-#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 */
-  /*    (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    */
@@ -705,17 +694,6 @@ FT_BEGIN_HEADER
             (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>                                                         */
-  /*    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.                                                  */
   /*                                                                       */
@@ -1068,70 +1046,9 @@ FT_BEGIN_HEADER
                               FTC_SBit      *sbit,
                               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
 
 #endif /* __FTCACHE_H__ */
diff --git a/include/ftcffdrv.h b/include/ftcffdrv.h
new file mode 100644 (file)
index 0000000..f7031bc
--- /dev/null
@@ -0,0 +1,262 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ftcffdrv.h                                                             */
+/*                                                                         */
+/*    FreeType API for controlling the CFF driver (specification only).    */
+/*                                                                         */
+/*  Copyright 2013, 2014 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 list below gives the available properties
+   *   together with the necessary macros and structures.
+   *
+   *   The CFF driver's module name is `cff'.
+   *
+   *   *Hinting* *and* *antialiasing* *principles* *of* *the* *new* *engine*
+   *
+   *   The rasterizer is positioning horizontal features (e.g., ascender
+   *   height & x-height, or crossbars) on the pixel grid and minimizing the
+   *   amount of antialiasing applied to them, while placing vertical
+   *   features (vertical stems) on the pixel grid without hinting, thus
+   *   representing the stem position and weight accurately.  Sometimes the
+   *   vertical stems may be only partially black.  In this context,
+   *   `antialiasing' means that stems are not positioned exactly on pixel
+   *   borders, causing a fuzzy appearance.
+   *
+   *   There are two principles behind this approach.
+   *
+   *   1) No hinting in the horizontal direction: Unlike `superhinted'
+   *   TrueType, which changes glyph widths to accommodate regular
+   *   inter-glyph spacing, Adobe's approach is `faithful to the design' in
+   *   representing both the glyph width and the inter-glyph spacing
+   *   designed for the font.  This makes the screen display as close as it
+   *   can be to the result one would get with infinite resolution, while
+   *   preserving what is considered the key characteristics of each glyph.
+   *   Note that the distances between unhinted and grid-fitted positions at
+   *   small sizes are comparable to kerning values and thus would be
+   *   noticeable (and distracting) while reading if hinting were applied.
+   *
+   *   One of the reasons to not hint horizontally is antialiasing for LCD
+   *   screens: The pixel geometry of modern displays supplies three
+   *   vertical sub-pixels as the eye moves horizontally across each visible
+   *   pixel.  On devices where we can be certain this characteristic is
+   *   present a rasterizer can take advantage of the sub-pixels to add
+   *   increments of weight.  In Western writing systems this turns out to
+   *   be the more critical direction anyway; the weights and spacing of
+   *   vertical stems (see above) are central to Armenian, Cyrillic, Greek,
+   *   and Latin type designs.  Even when the rasterizer uses greyscale
+   *   antialiasing instead of color (a necessary compromise when one
+   *   doesn't know the screen characteristics), the unhinted vertical
+   *   features preserve the design's weight and spacing much better than
+   *   aliased type would.
+   *
+   *   2) Aligment in the vertical direction: Weights and spacing along the
+   *   y~axis are less critical; what is much more important is the visual
+   *   alignment of related features (like cap-height and x-height).  The
+   *   sense of alignment for these is enhanced by the sharpness of grid-fit
+   *   edges, while the cruder vertical resolution (full pixels instead of
+   *   1/3 pixels) is less of a problem.
+   *
+   *   On the technical side, horizontal alignment zones for ascender,
+   *   x-height, and other important height values (traditionally called
+   *   `blue zones') as defined in the font are positioned independently,
+   *   each being rounded to the nearest pixel edge, taking care of
+   *   overshoot suppression at small sizes, stem darkening, and scaling.
+   *
+   *   Hstems (this is, hint values defined in the font to help align
+   *   horizontal features) that fall within a blue zone are said to be
+   *   `captured' and are aligned to that zone.  Uncaptured stems are moved
+   *   in one of four ways, top edge up or down, bottom edge up or down.
+   *   Unless there are conflicting hstems, the smallest movement is taken
+   *   to minimize distortion.
+   *
+   * @order:
+   *   hinting-engine
+   *   no-stem-darkening
+   *   darkening-parameters
+   *
+   */
+
+
+  /**************************************************************************
+   *
+   * @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_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.  This feature requires
+   *   a rendering system with proper gamma correction.  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_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.
+   *
+   */
+
+
+  /**************************************************************************
+   *
+   * @property:
+   *   darkening-parameters
+   *
+   * @description:
+   *   By default, the Adobe CFF engine darkens stems as follows (if the
+   *   `no-stem-darkening' property isn't set):
+   *
+   *   {
+   *     stem width <= 0.5px:   darkening amount = 0.4px
+   *     stem width  = 1px:     darkening amount = 0.275px
+   *     stem width  = 1.667px: darkening amount = 0.275px
+   *     stem width >= 2.333px: darkening amount = 0px
+   *   }
+   *
+   *   and piecewise linear in-between.  At configuration time, these four
+   *   control points can be set with the macro
+   *   `CFF_CONFIG_OPTION_DARKENING_PARAMETERS'.  At runtime, the control
+   *   points can be changed using the `darkening-parameters' property, as
+   *   the following example demonstrates.
+   *
+   *   {
+   *     FT_Library  library;
+   *     FT_Int      darken_params[8] = {  500, 300,   // x1, y1
+   *                                      1000, 200,   // x2, y2
+   *                                      1500, 100,   // x3, y3
+   *                                      2000,   0 }; // x4, y4
+   *
+   *
+   *     FT_Init_FreeType( &library );
+   *
+   *     FT_Property_Set( library, "cff",
+   *                               "darkening-parameters", darken_params );
+   *   }
+   *
+   *   The x~values give the stem width, and the y~values the darkening
+   *   amount.  The unit is 1000th of pixels.  All coordinate values must be
+   *   positive; the x~values must be monotonically increasing; the
+   *   y~values must be monotonically decreasing and smaller than or
+   *   equal to 500 (corresponding to half a pixel); the slope of each
+   *   linear piece must be shallower than -1 (e.g., -.4).
+   *
+   * @note:
+   *   This property can be used with @FT_Property_Get also.
+   *
+   */
+
+  /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __FTCFFDRV_H__ */
+
+
+/* END */
similarity index 85%
rename from include/freetype/ftchapters.h
rename to include/ftchapters.h
index 6cdf54e..d333761 100644 (file)
@@ -1,7 +1,7 @@
 /***************************************************************************/
 /*                                                                         */
 /* This file defines the structure of the FreeType reference.              */
-/* It is used by the python script which generates the HTML files.         */
+/* It is used by the python script that generates the HTML files.          */
 /*                                                                         */
 /***************************************************************************/
 
@@ -15,6 +15,7 @@
 /*    General Remarks                                                      */
 /*                                                                         */
 /* <Sections>                                                              */
+/*    header_inclusion                                                     */
 /*    user_allocation                                                      */
 /*                                                                         */
 /***************************************************************************/
 /***************************************************************************/
 /*                                                                         */
 /* <Chapter>                                                               */
+/*    module_specific                                                      */
+/*                                                                         */
+/* <Title>                                                                 */
+/*    Controlling FreeType Modules                                         */
+/*                                                                         */
+/* <Sections>                                                              */
+/*    auto_hinter                                                          */
+/*    cff_driver                                                           */
+/*    tt_driver                                                            */
+/*                                                                         */
+/***************************************************************************/
+
+
+/***************************************************************************/
+/*                                                                         */
+/* <Chapter>                                                               */
 /*    cache_subsystem                                                      */
 /*                                                                         */
 /* <Title>                                                                 */
similarity index 99%
rename from include/freetype/ftcid.h
rename to include/ftcid.h
index 203a30c..17550d8 100644 (file)
@@ -156,7 +156,8 @@ FT_BEGIN_HEADER
                                FT_UInt   glyph_index,
                                FT_UInt  *cid );
 
- /* */
+  /* */
+
 
 FT_END_HEADER
 
similarity index 95%
rename from include/freetype/fterrdef.h
rename to include/fterrdef.h
index fb4b53b..99b2fad 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType error codes (specification).                                */
 /*                                                                         */
-/*  Copyright 2002, 2004, 2006, 2007, 2010-2011 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,       */
 
   /* generic errors */
 
-  FT_NOERRORDEF_( Ok,                                        0x00, \
+  FT_NOERRORDEF_( Ok,                                        0x00,
                   "no error" )
 
-  FT_ERRORDEF_( Cannot_Open_Resource,                        0x01, \
+  FT_ERRORDEF_( Cannot_Open_Resource,                        0x01,
                 "cannot open resource" )
-  FT_ERRORDEF_( Unknown_File_Format,                         0x02, \
+  FT_ERRORDEF_( Unknown_File_Format,                         0x02,
                 "unknown file format" )
-  FT_ERRORDEF_( Invalid_File_Format,                         0x03, \
+  FT_ERRORDEF_( Invalid_File_Format,                         0x03,
                 "broken file" )
-  FT_ERRORDEF_( Invalid_Version,                             0x04, \
+  FT_ERRORDEF_( Invalid_Version,                             0x04,
                 "invalid FreeType version" )
-  FT_ERRORDEF_( Lower_Module_Version,                        0x05, \
+  FT_ERRORDEF_( Lower_Module_Version,                        0x05,
                 "module version is too low" )
-  FT_ERRORDEF_( Invalid_Argument,                            0x06, \
+  FT_ERRORDEF_( Invalid_Argument,                            0x06,
                 "invalid argument" )
-  FT_ERRORDEF_( Unimplemented_Feature,                       0x07, \
+  FT_ERRORDEF_( Unimplemented_Feature,                       0x07,
                 "unimplemented feature" )
-  FT_ERRORDEF_( Invalid_Table,                               0x08, \
+  FT_ERRORDEF_( Invalid_Table,                               0x08,
                 "broken table" )
-  FT_ERRORDEF_( Invalid_Offset,                              0x09, \
+  FT_ERRORDEF_( Invalid_Offset,                              0x09,
                 "broken offset within table" )
-  FT_ERRORDEF_( Array_Too_Large,                             0x0A, \
+  FT_ERRORDEF_( Array_Too_Large,                             0x0A,
                 "array allocation size too large" )
-  FT_ERRORDEF_( Missing_Module,                              0x0B, \
+  FT_ERRORDEF_( Missing_Module,                              0x0B,
                 "missing module" )
+  FT_ERRORDEF_( Missing_Property,                            0x0C,
+                "missing property" )
 
   /* glyph/character errors */
 
-  FT_ERRORDEF_( Invalid_Glyph_Index,                         0x10, \
+  FT_ERRORDEF_( Invalid_Glyph_Index,                         0x10,
                 "invalid glyph index" )
-  FT_ERRORDEF_( Invalid_Character_Code,                      0x11, \
+  FT_ERRORDEF_( Invalid_Character_Code,                      0x11,
                 "invalid character code" )
-  FT_ERRORDEF_( Invalid_Glyph_Format,                        0x12, \
+  FT_ERRORDEF_( Invalid_Glyph_Format,                        0x12,
                 "unsupported glyph image format" )
-  FT_ERRORDEF_( Cannot_Render_Glyph,                         0x13, \
+  FT_ERRORDEF_( Cannot_Render_Glyph,                         0x13,
                 "cannot render this glyph format" )
-  FT_ERRORDEF_( Invalid_Outline,                             0x14, \
+  FT_ERRORDEF_( Invalid_Outline,                             0x14,
                 "invalid outline" )
-  FT_ERRORDEF_( Invalid_Composite,                           0x15, \
+  FT_ERRORDEF_( Invalid_Composite,                           0x15,
                 "invalid composite glyph" )
-  FT_ERRORDEF_( Too_Many_Hints,                              0x16, \
+  FT_ERRORDEF_( Too_Many_Hints,                              0x16,
                 "too many hints" )
-  FT_ERRORDEF_( Invalid_Pixel_Size,                          0x17, \
+  FT_ERRORDEF_( Invalid_Pixel_Size,                          0x17,
                 "invalid pixel size" )
 
   /* handle errors */
 
-  FT_ERRORDEF_( Invalid_Handle,                              0x20, \
+  FT_ERRORDEF_( Invalid_Handle,                              0x20,
                 "invalid object handle" )
-  FT_ERRORDEF_( Invalid_Library_Handle,                      0x21, \
+  FT_ERRORDEF_( Invalid_Library_Handle,                      0x21,
                 "invalid library handle" )
-  FT_ERRORDEF_( Invalid_Driver_Handle,                       0x22, \
+  FT_ERRORDEF_( Invalid_Driver_Handle,                       0x22,
                 "invalid module handle" )
-  FT_ERRORDEF_( Invalid_Face_Handle,                         0x23, \
+  FT_ERRORDEF_( Invalid_Face_Handle,                         0x23,
                 "invalid face handle" )
-  FT_ERRORDEF_( Invalid_Size_Handle,                         0x24, \
+  FT_ERRORDEF_( Invalid_Size_Handle,                         0x24,
                 "invalid size handle" )
-  FT_ERRORDEF_( Invalid_Slot_Handle,                         0x25, \
+  FT_ERRORDEF_( Invalid_Slot_Handle,                         0x25,
                 "invalid glyph slot handle" )
-  FT_ERRORDEF_( Invalid_CharMap_Handle,                      0x26, \
+  FT_ERRORDEF_( Invalid_CharMap_Handle,                      0x26,
                 "invalid charmap handle" )
-  FT_ERRORDEF_( Invalid_Cache_Handle,                        0x27, \
+  FT_ERRORDEF_( Invalid_Cache_Handle,                        0x27,
                 "invalid cache manager handle" )
-  FT_ERRORDEF_( Invalid_Stream_Handle,                       0x28, \
+  FT_ERRORDEF_( Invalid_Stream_Handle,                       0x28,
                 "invalid stream handle" )
 
   /* driver errors */
 
-  FT_ERRORDEF_( Too_Many_Drivers,                            0x30, \
+  FT_ERRORDEF_( Too_Many_Drivers,                            0x30,
                 "too many modules" )
-  FT_ERRORDEF_( Too_Many_Extensions,                         0x31, \
+  FT_ERRORDEF_( Too_Many_Extensions,                         0x31,
                 "too many extensions" )
 
   /* memory errors */
 
-  FT_ERRORDEF_( Out_Of_Memory,                               0x40, \
+  FT_ERRORDEF_( Out_Of_Memory,                               0x40,
                 "out of memory" )
-  FT_ERRORDEF_( Unlisted_Object,                             0x41, \
+  FT_ERRORDEF_( Unlisted_Object,                             0x41,
                 "unlisted object" )
 
   /* stream errors */
 
-  FT_ERRORDEF_( Cannot_Open_Stream,                          0x51, \
+  FT_ERRORDEF_( Cannot_Open_Stream,                          0x51,
                 "cannot open stream" )
-  FT_ERRORDEF_( Invalid_Stream_Seek,                         0x52, \
+  FT_ERRORDEF_( Invalid_Stream_Seek,                         0x52,
                 "invalid stream seek" )
-  FT_ERRORDEF_( Invalid_Stream_Skip,                         0x53, \
+  FT_ERRORDEF_( Invalid_Stream_Skip,                         0x53,
                 "invalid stream skip" )
-  FT_ERRORDEF_( Invalid_Stream_Read,                         0x54, \
+  FT_ERRORDEF_( Invalid_Stream_Read,                         0x54,
                 "invalid stream read" )
-  FT_ERRORDEF_( Invalid_Stream_Operation,                    0x55, \
+  FT_ERRORDEF_( Invalid_Stream_Operation,                    0x55,
                 "invalid stream operation" )
-  FT_ERRORDEF_( Invalid_Frame_Operation,                     0x56, \
+  FT_ERRORDEF_( Invalid_Frame_Operation,                     0x56,
                 "invalid frame operation" )
-  FT_ERRORDEF_( Nested_Frame_Access,                         0x57, \
+  FT_ERRORDEF_( Nested_Frame_Access,                         0x57,
                 "nested frame access" )
-  FT_ERRORDEF_( Invalid_Frame_Read,                          0x58, \
+  FT_ERRORDEF_( Invalid_Frame_Read,                          0x58,
                 "invalid frame read" )
 
   /* raster errors */
 
-  FT_ERRORDEF_( Raster_Uninitialized,                        0x60, \
+  FT_ERRORDEF_( Raster_Uninitialized,                        0x60,
                 "raster uninitialized" )
-  FT_ERRORDEF_( Raster_Corrupted,                            0x61, \
+  FT_ERRORDEF_( Raster_Corrupted,                            0x61,
                 "raster corrupted" )
-  FT_ERRORDEF_( Raster_Overflow,                             0x62, \
+  FT_ERRORDEF_( Raster_Overflow,                             0x62,
                 "raster overflow" )
-  FT_ERRORDEF_( Raster_Negative_Height,                      0x63, \
+  FT_ERRORDEF_( Raster_Negative_Height,                      0x63,
                 "negative height while rastering" )
 
   /* cache errors */
 
-  FT_ERRORDEF_( Too_Many_Caches,                             0x70, \
+  FT_ERRORDEF_( Too_Many_Caches,                             0x70,
                 "too many registered caches" )
 
   /* TrueType and SFNT errors */
 
-  FT_ERRORDEF_( Invalid_Opcode,                              0x80, \
+  FT_ERRORDEF_( Invalid_Opcode,                              0x80,
                 "invalid opcode" )
-  FT_ERRORDEF_( Too_Few_Arguments,                           0x81, \
+  FT_ERRORDEF_( Too_Few_Arguments,                           0x81,
                 "too few arguments" )
-  FT_ERRORDEF_( Stack_Overflow,                              0x82, \
+  FT_ERRORDEF_( Stack_Overflow,                              0x82,
                 "stack overflow" )
-  FT_ERRORDEF_( Code_Overflow,                               0x83, \
+  FT_ERRORDEF_( Code_Overflow,                               0x83,
                 "code overflow" )
-  FT_ERRORDEF_( Bad_Argument,                                0x84, \
+  FT_ERRORDEF_( Bad_Argument,                                0x84,
                 "bad argument" )
-  FT_ERRORDEF_( Divide_By_Zero,                              0x85, \
+  FT_ERRORDEF_( Divide_By_Zero,                              0x85,
                 "division by zero" )
-  FT_ERRORDEF_( Invalid_Reference,                           0x86, \
+  FT_ERRORDEF_( Invalid_Reference,                           0x86,
                 "invalid reference" )
-  FT_ERRORDEF_( Debug_OpCode,                                0x87, \
+  FT_ERRORDEF_( Debug_OpCode,                                0x87,
                 "found debug opcode" )
-  FT_ERRORDEF_( ENDF_In_Exec_Stream,                         0x88, \
+  FT_ERRORDEF_( ENDF_In_Exec_Stream,                         0x88,
                 "found ENDF opcode in execution stream" )
-  FT_ERRORDEF_( Nested_DEFS,                                 0x89, \
+  FT_ERRORDEF_( Nested_DEFS,                                 0x89,
                 "nested DEFS" )
-  FT_ERRORDEF_( Invalid_CodeRange,                           0x8A, \
+  FT_ERRORDEF_( Invalid_CodeRange,                           0x8A,
                 "invalid code range" )
-  FT_ERRORDEF_( Execution_Too_Long,                          0x8B, \
+  FT_ERRORDEF_( Execution_Too_Long,                          0x8B,
                 "execution context too long" )
-  FT_ERRORDEF_( Too_Many_Function_Defs,                      0x8C, \
+  FT_ERRORDEF_( Too_Many_Function_Defs,                      0x8C,
                 "too many function definitions" )
-  FT_ERRORDEF_( Too_Many_Instruction_Defs,                   0x8D, \
+  FT_ERRORDEF_( Too_Many_Instruction_Defs,                   0x8D,
                 "too many instruction definitions" )
-  FT_ERRORDEF_( Table_Missing,                               0x8E, \
+  FT_ERRORDEF_( Table_Missing,                               0x8E,
                 "SFNT font table missing" )
-  FT_ERRORDEF_( Horiz_Header_Missing,                        0x8F, \
+  FT_ERRORDEF_( Horiz_Header_Missing,                        0x8F,
                 "horizontal header (hhea) table missing" )
-  FT_ERRORDEF_( Locations_Missing,                           0x90, \
+  FT_ERRORDEF_( Locations_Missing,                           0x90,
                 "locations (loca) table missing" )
-  FT_ERRORDEF_( Name_Table_Missing,                          0x91, \
+  FT_ERRORDEF_( Name_Table_Missing,                          0x91,
                 "name table missing" )
-  FT_ERRORDEF_( CMap_Table_Missing,                          0x92, \
+  FT_ERRORDEF_( CMap_Table_Missing,                          0x92,
                 "character map (cmap) table missing" )
-  FT_ERRORDEF_( Hmtx_Table_Missing,                          0x93, \
+  FT_ERRORDEF_( Hmtx_Table_Missing,                          0x93,
                 "horizontal metrics (hmtx) table missing" )
-  FT_ERRORDEF_( Post_Table_Missing,                          0x94, \
+  FT_ERRORDEF_( Post_Table_Missing,                          0x94,
                 "PostScript (post) table missing" )
-  FT_ERRORDEF_( Invalid_Horiz_Metrics,                       0x95, \
+  FT_ERRORDEF_( Invalid_Horiz_Metrics,                       0x95,
                 "invalid horizontal metrics" )
-  FT_ERRORDEF_( Invalid_CharMap_Format,                      0x96, \
+  FT_ERRORDEF_( Invalid_CharMap_Format,                      0x96,
                 "invalid character map (cmap) format" )
-  FT_ERRORDEF_( Invalid_PPem,                                0x97, \
+  FT_ERRORDEF_( Invalid_PPem,                                0x97,
                 "invalid ppem value" )
-  FT_ERRORDEF_( Invalid_Vert_Metrics,                        0x98, \
+  FT_ERRORDEF_( Invalid_Vert_Metrics,                        0x98,
                 "invalid vertical metrics" )
-  FT_ERRORDEF_( Could_Not_Find_Context,                      0x99, \
+  FT_ERRORDEF_( Could_Not_Find_Context,                      0x99,
                 "could not find context" )
-  FT_ERRORDEF_( Invalid_Post_Table_Format,                   0x9A, \
+  FT_ERRORDEF_( Invalid_Post_Table_Format,                   0x9A,
                 "invalid PostScript (post) table format" )
-  FT_ERRORDEF_( Invalid_Post_Table,                          0x9B, \
+  FT_ERRORDEF_( Invalid_Post_Table,                          0x9B,
                 "invalid PostScript (post) table" )
 
   /* CFF, CID, and Type 1 errors */
 
-  FT_ERRORDEF_( Syntax_Error,                                0xA0, \
+  FT_ERRORDEF_( Syntax_Error,                                0xA0,
                 "opcode syntax error" )
-  FT_ERRORDEF_( Stack_Underflow,                             0xA1, \
+  FT_ERRORDEF_( Stack_Underflow,                             0xA1,
                 "argument stack underflow" )
-  FT_ERRORDEF_( Ignore,                                      0xA2, \
+  FT_ERRORDEF_( Ignore,                                      0xA2,
                 "ignore" )
-  FT_ERRORDEF_( No_Unicode_Glyph_Name,                       0xA3, \
+  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 */
 
-  FT_ERRORDEF_( Missing_Startfont_Field,                     0xB0, \
+  FT_ERRORDEF_( Missing_Startfont_Field,                     0xB0,
                 "`STARTFONT' field missing" )
-  FT_ERRORDEF_( Missing_Font_Field,                          0xB1, \
+  FT_ERRORDEF_( Missing_Font_Field,                          0xB1,
                 "`FONT' field missing" )
-  FT_ERRORDEF_( Missing_Size_Field,                          0xB2, \
+  FT_ERRORDEF_( Missing_Size_Field,                          0xB2,
                 "`SIZE' field missing" )
-  FT_ERRORDEF_( Missing_Fontboundingbox_Field,               0xB3, \
+  FT_ERRORDEF_( Missing_Fontboundingbox_Field,               0xB3,
                 "`FONTBOUNDINGBOX' field missing" )
-  FT_ERRORDEF_( Missing_Chars_Field,                         0xB4, \
+  FT_ERRORDEF_( Missing_Chars_Field,                         0xB4,
                 "`CHARS' field missing" )
-  FT_ERRORDEF_( Missing_Startchar_Field,                     0xB5, \
+  FT_ERRORDEF_( Missing_Startchar_Field,                     0xB5,
                 "`STARTCHAR' field missing" )
-  FT_ERRORDEF_( Missing_Encoding_Field,                      0xB6, \
+  FT_ERRORDEF_( Missing_Encoding_Field,                      0xB6,
                 "`ENCODING' field missing" )
-  FT_ERRORDEF_( Missing_Bbx_Field,                           0xB7, \
+  FT_ERRORDEF_( Missing_Bbx_Field,                           0xB7,
                 "`BBX' field missing" )
-  FT_ERRORDEF_( Bbx_Too_Big,                                 0xB8, \
+  FT_ERRORDEF_( Bbx_Too_Big,                                 0xB8,
                 "`BBX' too big" )
-  FT_ERRORDEF_( Corrupted_Font_Header,                       0xB9, \
+  FT_ERRORDEF_( Corrupted_Font_Header,                       0xB9,
                 "Font header corrupted or missing fields" )
-  FT_ERRORDEF_( Corrupted_Font_Glyphs,                       0xBA, \
+  FT_ERRORDEF_( Corrupted_Font_Glyphs,                       0xBA,
                 "Font glyphs corrupted or missing fields" )
 
 
similarity index 93%
rename from include/freetype/fterrors.h
rename to include/fterrors.h
index a54699f..0fa3e4d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -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     */
-  /*   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                                            */
 
 #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_'.                            */
 
 
   /* 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! */
-#define FT_NOERRORDEF_( e, v, s ) \
+#define FT_NOERRORDEF_( e, v, s )                             \
           FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
 
 
 #undef FT_NEED_EXTERN_C
 #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
-#else
-#undef FT_KEEP_ERR_PREFIX
 #endif
 
 #endif /* __FTERRORS_H__ */
similarity index 99%
rename from include/freetype/ftgasp.h
rename to include/ftgasp.h
index 453d4fa..3f3d765 100644 (file)
   FT_Get_Gasp( FT_Face  face,
                FT_UInt  ppem );
 
-/* */
+  /* */
+
 
 #endif /* _FT_GASP_H_ */
 
similarity index 95%
rename from include/freetype/ftglyph.h
rename to include/ftglyph.h
index 3de69f7..15fa6a9 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType convenience functions to handle glyphs (specification).     */
 /*                                                                         */
-/*  Copyright 1996-2003, 2006, 2008, 2009, 2011 by                         */
+/*  Copyright 1996-2003, 2006, 2008, 2009, 2011, 2013, 2014 by             */
 /*  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     */
-  /*    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.                */
@@ -325,22 +325,8 @@ FT_BEGIN_HEADER
   } FT_Glyph_BBox_Mode;
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Enum>                                                                */
-  /*    ft_glyph_bbox_xxx                                                  */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    These constants are deprecated.  Use the corresponding             */
-  /*    @FT_Glyph_BBox_Mode values instead.                                */
-  /*                                                                       */
-  /* <Values>                                                              */
-  /*   ft_glyph_bbox_unscaled  :: See @FT_GLYPH_BBOX_UNSCALED.             */
-  /*   ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS.            */
-  /*   ft_glyph_bbox_gridfit   :: See @FT_GLYPH_BBOX_GRIDFIT.              */
-  /*   ft_glyph_bbox_truncate  :: See @FT_GLYPH_BBOX_TRUNCATE.             */
-  /*   ft_glyph_bbox_pixels    :: See @FT_GLYPH_BBOX_PIXELS.               */
-  /*                                                                       */
+  /* these constants are deprecated; use the corresponding */
+  /* `FT_Glyph_BBox_Mode' values instead                   */
 #define ft_glyph_bbox_unscaled   FT_GLYPH_BBOX_UNSCALED
 #define ft_glyph_bbox_subpixels  FT_GLYPH_BBOX_SUBPIXELS
 #define ft_glyph_bbox_gridfit    FT_GLYPH_BBOX_GRIDFIT
@@ -358,17 +344,17 @@ FT_BEGIN_HEADER
   /*    outline's points, including Bézier control points.  Though it      */
   /*    coincides with the exact bounding box for most glyphs, it can be   */
   /*    slightly larger in some situations (like when rotating an outline  */
-  /*    which contains Bézier outside arcs).                               */
+  /*    that contains Bézier outside arcs).                                */
   /*                                                                       */
   /*    Computing the control box is very fast, while getting the bounding */
   /*    box can take much more time as it needs to walk over all segments  */
   /*    and arcs in the outline.  To get the latter, you can use the       */
-  /*    `ftbbox' component which is dedicated to this single task.         */
+  /*    `ftbbox' component, which is dedicated to this single task.        */
   /*                                                                       */
   /* <Input>                                                               */
   /*    glyph :: A handle to the source glyph object.                      */
   /*                                                                       */
-  /*    mode  :: The mode which indicates how to interpret the returned    */
+  /*    mode  :: The mode that indicates how to interpret the returned     */
   /*             bounding box values.                                      */
   /*                                                                       */
   /* <Output>                                                              */
@@ -388,7 +374,7 @@ FT_BEGIN_HEADER
   /*    @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  */
+  /*    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  */
@@ -603,7 +589,6 @@ FT_BEGIN_HEADER
   FT_EXPORT( FT_Error )
   FT_Matrix_Invert( FT_Matrix*  matrix );
 
-
   /* */
 
 
similarity index 91%
rename from include/freetype/ftgxval.h
rename to include/ftgxval.h
index 497015c..88c3d93 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for validating TrueTypeGX/AAT tables (specification).   */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006 by                                          */
+/*  Copyright 2004-2006, 2013 by                                           */
 /*  Masatake YAMATO, Redhat K.K,                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
@@ -57,9 +57,19 @@ FT_BEGIN_HEADER
   /*    some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd,  */
   /*    trak, prop, lcar).                                                 */
   /*                                                                       */
+  /* <Order>                                                               */
+  /*    FT_TrueTypeGX_Validate                                             */
+  /*    FT_TrueTypeGX_Free                                                 */
+  /*                                                                       */
+  /*    FT_ClassicKern_Validate                                            */
+  /*    FT_ClassicKern_Free                                                */
+  /*                                                                       */
+  /*    FT_VALIDATE_GX_LENGTH                                              */
+  /*    FT_VALIDATE_GXXXX                                                  */
+  /*    FT_VALIDATE_CKERNXXX                                               */
+  /*                                                                       */
   /*************************************************************************/
 
-
   /*************************************************************************/
   /*                                                                       */
   /*                                                                       */
@@ -171,8 +181,6 @@ FT_BEGIN_HEADER
                           FT_VALIDATE_lcar )
 
 
-  /* */
-
  /**********************************************************************
   *
   * @function:
@@ -180,7 +188,7 @@ FT_BEGIN_HEADER
   *
   * @description:
   *    Validate various TrueTypeGX tables to assure that all offsets and
-  *    indices are valid.  The idea is that a higher-level library which
+  *    indices are valid.  The idea is that a higher-level library that
   *    actually does the text layout can access those tables without
   *    error checking (which can be quite time consuming).
   *
@@ -189,7 +197,7 @@ FT_BEGIN_HEADER
   *       A handle to the input face.
   *
   *    validation_flags ::
-  *       A bit field which specifies the tables to be validated.  See
+  *       A bit field that specifies the tables to be validated.  See
   *       @FT_VALIDATE_GXXXX for possible values.
   *
   *    table_length ::
@@ -221,8 +229,6 @@ FT_BEGIN_HEADER
                           FT_UInt   table_length );
 
 
-  /* */
-
  /**********************************************************************
   *
   * @function:
@@ -248,8 +254,6 @@ FT_BEGIN_HEADER
                       FT_Bytes  table );
 
 
-  /* */
-
  /**********************************************************************
   *
   * @enum:
@@ -277,8 +281,6 @@ FT_BEGIN_HEADER
 #define FT_VALIDATE_CKERN  ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
 
 
-  /* */
-
  /**********************************************************************
   *
   * @function:
@@ -286,7 +288,7 @@ FT_BEGIN_HEADER
   *
   * @description:
   *    Validate classic (16-bit format) kern table to assure that the offsets
-  *    and indices are valid.  The idea is that a higher-level library which
+  *    and indices are valid.  The idea is that a higher-level library that
   *    actually does the text layout can access those tables without error
   *    checking (which can be quite time consuming).
   *
@@ -299,7 +301,7 @@ FT_BEGIN_HEADER
   *       A handle to the input face.
   *
   *    validation_flags ::
-  *       A bit field which specifies the dialect to be validated.  See
+  *       A bit field that specifies the dialect to be validated.  See
   *       @FT_VALIDATE_CKERNXXX for possible values.
   *
   * @output:
@@ -320,8 +322,6 @@ FT_BEGIN_HEADER
                            FT_Bytes  *ckern_table );
 
 
-  /* */
-
  /**********************************************************************
   *
   * @function:
@@ -346,8 +346,7 @@ FT_BEGIN_HEADER
   FT_ClassicKern_Free( FT_Face   face,
                        FT_Bytes  table );
 
-
- /* */
+  /* */
 
 
 FT_END_HEADER
similarity index 74%
rename from include/freetype/ftgzip.h
rename to include/ftgzip.h
index acbc4f0..eb346c6 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Gzip-compressed stream support.                                      */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2006 by                                    */
+/*  Copyright 2002-2004, 2006, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -91,7 +91,53 @@ FT_BEGIN_HEADER
   FT_Stream_OpenGzip( FT_Stream  stream,
                       FT_Stream  source );
 
- /* */
+
+ /************************************************************************
+  *
+  * @function:
+  *   FT_Gzip_Uncompress
+  *
+  * @description:
+  *   Decompress a zipped input buffer into an output buffer.  This function
+  *   is modeled after zlib's `uncompress' function.
+  *
+  * @input:
+  *   memory ::
+  *     A FreeType memory handle.
+  *
+  *   input ::
+  *     The input buffer.
+  *
+  *   input_len ::
+  *     The length of the input buffer.
+  *
+  * @output:
+  *   output::
+  *     The output buffer.
+  *
+  * @inout:
+  *   output_len ::
+  *     Before calling the function, this is the the total size of the
+  *     output buffer, which must be large enough to hold the entire
+  *     uncompressed data (so the size of the uncompressed data must be
+  *     known in advance).  After calling the function, `output_len' is the
+  *     size of the used data in `output'.
+  *
+  * @return:
+  *   FreeType error code.  0~means success.
+  *
+  * @note:
+  *   This function may return `FT_Err_Unimplemented_Feature' if your build
+  *   of FreeType was not compiled with zlib support.
+  */
+  FT_EXPORT( FT_Error )
+  FT_Gzip_Uncompress( FT_Memory       memory,
+                      FT_Byte*        output,
+                      FT_ULong*       output_len,
+                      const FT_Byte*  input,
+                      FT_ULong        input_len );
+
+  /* */
 
 
 FT_END_HEADER
similarity index 88%
rename from include/freetype/ftimage.h
rename to include/ftimage.h
index 04b5e04..2f7ca2a 100644 (file)
@@ -5,8 +5,7 @@
 /*    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, 2014 by                                     */
 /*  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      */
-  /*    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;
 
@@ -169,6 +168,15 @@ FT_BEGIN_HEADER
   /*      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,
@@ -178,73 +186,21 @@ FT_BEGIN_HEADER
     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;
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Enum>                                                                */
-  /*    ft_pixel_mode_xxx                                                  */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A list of deprecated constants.  Use the corresponding             */
-  /*    @FT_Pixel_Mode values instead.                                     */
-  /*                                                                       */
-  /* <Values>                                                              */
-  /*    ft_pixel_mode_none  :: See @FT_PIXEL_MODE_NONE.                    */
-  /*    ft_pixel_mode_mono  :: See @FT_PIXEL_MODE_MONO.                    */
-  /*    ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY.                    */
-  /*    ft_pixel_mode_pal2  :: See @FT_PIXEL_MODE_GRAY2.                   */
-  /*    ft_pixel_mode_pal4  :: See @FT_PIXEL_MODE_GRAY4.                   */
-  /*                                                                       */
+  /* these constants are deprecated; use the corresponding `FT_Pixel_Mode' */
+  /* values instead.                                                       */
 #define ft_pixel_mode_none   FT_PIXEL_MODE_NONE
 #define ft_pixel_mode_mono   FT_PIXEL_MODE_MONO
 #define ft_pixel_mode_grays  FT_PIXEL_MODE_GRAY
 #define ft_pixel_mode_pal2   FT_PIXEL_MODE_GRAY2
 #define ft_pixel_mode_pal4   FT_PIXEL_MODE_GRAY4
 
- /* */
-
-#if 0
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Enum>                                                                */
-  /*    FT_Palette_Mode                                                    */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT!                           */
-  /*                                                                       */
-  /*    An enumeration type to describe the format of a bitmap palette,    */
-  /*    used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8.               */
-  /*                                                                       */
-  /* <Values>                                                              */
-  /*    ft_palette_mode_rgb  :: The palette is an array of 3-byte RGB      */
-  /*                            records.                                   */
-  /*                                                                       */
-  /*    ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA     */
-  /*                            records.                                   */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by       */
-  /*    FreeType, these types are not handled by the library itself.       */
-  /*                                                                       */
-  typedef enum  FT_Palette_Mode_
-  {
-    ft_palette_mode_rgb = 0,
-    ft_palette_mode_rgba,
-
-    ft_palette_mode_max   /* do not remove */
-
-  } FT_Palette_Mode;
-
-  /* */
-
-#endif
-
 
   /*************************************************************************/
   /*                                                                       */
@@ -309,13 +265,13 @@ FT_BEGIN_HEADER
   /*                                                                       */
   typedef struct  FT_Bitmap_
   {
-    int             rows;
-    int             width;
+    unsigned int    rows;
+    unsigned int    width;
     int             pitch;
     unsigned char*  buffer;
-    short           num_grays;
-    char            pixel_mode;
-    char            palette_mode;
+    unsigned short  num_grays;
+    unsigned char   pixel_mode;
+    unsigned char   palette_mode;
     void*           palette;
 
   } FT_Bitmap;
@@ -372,7 +328,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    flags      :: A set of bit flags used to characterize the outline  */
   /*                  and give hints to the scan-converter and hinter on   */
-  /*                  how to convert/grid-fit it.  See @FT_OUTLINE_FLAGS.  */
+  /*                  how to convert/grid-fit it.  See @FT_OUTLINE_XXX.    */
   /*                                                                       */
   /* <Note>                                                                */
   /*    The B/W rasterizer only checks bit~2 in the `tags' array for the   */
@@ -393,6 +349,8 @@ FT_BEGIN_HEADER
 
   } FT_Outline;
 
+  /* */
+
   /* Following limits must be consistent with */
   /* FT_Outline.{n_contours,n_points}         */
 #define FT_OUTLINE_CONTOURS_MAX  SHRT_MAX
@@ -402,7 +360,7 @@ FT_BEGIN_HEADER
   /*************************************************************************/
   /*                                                                       */
   /* <Enum>                                                                */
-  /*    FT_OUTLINE_FLAGS                                                   */
+  /*    FT_OUTLINE_XXX                                                     */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A list of bit-field constants use for the flags in an outline's    */
@@ -483,24 +441,8 @@ FT_BEGIN_HEADER
 #define FT_OUTLINE_SINGLE_PASS      0x200
 
 
- /*************************************************************************
-  *
-  * @enum:
-  *   ft_outline_flags
-  *
-  * @description:
-  *   These constants are deprecated.  Please use the corresponding
-  *   @FT_OUTLINE_FLAGS values.
-  *
-  * @values:
-  *   ft_outline_none            :: See @FT_OUTLINE_NONE.
-  *   ft_outline_owner           :: See @FT_OUTLINE_OWNER.
-  *   ft_outline_even_odd_fill   :: See @FT_OUTLINE_EVEN_ODD_FILL.
-  *   ft_outline_reverse_fill    :: See @FT_OUTLINE_REVERSE_FILL.
-  *   ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS.
-  *   ft_outline_high_precision  :: See @FT_OUTLINE_HIGH_PRECISION.
-  *   ft_outline_single_pass     :: See @FT_OUTLINE_SINGLE_PASS.
-  */
+  /* these constants are deprecated; use the corresponding */
+  /* `FT_OUTLINE_XXX' values instead                       */
 #define ft_outline_none             FT_OUTLINE_NONE
 #define ft_outline_owner            FT_OUTLINE_OWNER
 #define ft_outline_even_odd_fill    FT_OUTLINE_EVEN_ODD_FILL
@@ -546,7 +488,7 @@ FT_BEGIN_HEADER
   /* <Input>                                                               */
   /*    to   :: A pointer to the target point of the `move to'.            */
   /*                                                                       */
-  /*    user :: A typeless pointer which is passed from the caller of the  */
+  /*    user :: A typeless pointer, which is passed from the caller of the */
   /*            decomposition function.                                    */
   /*                                                                       */
   /* <Return>                                                              */
@@ -573,7 +515,7 @@ FT_BEGIN_HEADER
   /* <Input>                                                               */
   /*    to   :: A pointer to the target point of the `line to'.            */
   /*                                                                       */
-  /*    user :: A typeless pointer which is passed from the caller of the  */
+  /*    user :: A typeless pointer, which is passed from the caller of the */
   /*            decomposition function.                                    */
   /*                                                                       */
   /* <Return>                                                              */
@@ -604,7 +546,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    to      :: A pointer to the target end point of the conic arc.     */
   /*                                                                       */
-  /*    user    :: A typeless pointer which is passed from the caller of   */
+  /*    user    :: A typeless pointer, which is passed from the caller of  */
   /*               the decomposition function.                             */
   /*                                                                       */
   /* <Return>                                                              */
@@ -636,7 +578,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    to       :: A pointer to the target end point.                     */
   /*                                                                       */
-  /*    user     :: A typeless pointer which is passed from the caller of  */
+  /*    user     :: A typeless pointer, which is passed from the caller of */
   /*                the decomposition function.                            */
   /*                                                                       */
   /* <Return>                                                              */
@@ -787,22 +729,8 @@ FT_BEGIN_HEADER
   } FT_Glyph_Format;
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Enum>                                                                */
-  /*    ft_glyph_format_xxx                                                */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A list of deprecated constants.  Use the corresponding             */
-  /*    @FT_Glyph_Format values instead.                                   */
-  /*                                                                       */
-  /* <Values>                                                              */
-  /*    ft_glyph_format_none      :: See @FT_GLYPH_FORMAT_NONE.            */
-  /*    ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE.       */
-  /*    ft_glyph_format_bitmap    :: See @FT_GLYPH_FORMAT_BITMAP.          */
-  /*    ft_glyph_format_outline   :: See @FT_GLYPH_FORMAT_OUTLINE.         */
-  /*    ft_glyph_format_plotter   :: See @FT_GLYPH_FORMAT_PLOTTER.         */
-  /*                                                                       */
+  /* these constants are deprecated; use the corresponding */
+  /* `FT_Glyph_Format' values instead.                     */
 #define ft_glyph_format_none       FT_GLYPH_FORMAT_NONE
 #define ft_glyph_format_composite  FT_GLYPH_FORMAT_COMPOSITE
 #define ft_glyph_format_bitmap     FT_GLYPH_FORMAT_BITMAP
@@ -827,8 +755,8 @@ FT_BEGIN_HEADER
   /* a a bitmap.  This section contains the public API for rasters.        */
   /*                                                                       */
   /* Note that in FreeType 2, all rasters are now encapsulated within      */
-  /* specific modules called `renderers'.  See `freetype/ftrender.h' for   */
-  /* more details on renderers.                                            */
+  /* specific modules called `renderers'.  See `ftrender.h' for more       */
+  /* details on renderers.                                                 */
   /*                                                                       */
   /*************************************************************************/
 
@@ -847,6 +775,21 @@ FT_BEGIN_HEADER
   /* <Description>                                                         */
   /*    This section contains technical definitions.                       */
   /*                                                                       */
+  /* <Order>                                                               */
+  /*    FT_Raster                                                          */
+  /*    FT_Span                                                            */
+  /*    FT_SpanFunc                                                        */
+  /*                                                                       */
+  /*    FT_Raster_Params                                                   */
+  /*    FT_RASTER_FLAG_XXX                                                 */
+  /*                                                                       */
+  /*    FT_Raster_NewFunc                                                  */
+  /*    FT_Raster_DoneFunc                                                 */
+  /*    FT_Raster_ResetFunc                                                */
+  /*    FT_Raster_SetModeFunc                                              */
+  /*    FT_Raster_RenderFunc                                               */
+  /*    FT_Raster_Funcs                                                    */
+  /*                                                                       */
   /*************************************************************************/
 
 
@@ -856,8 +799,8 @@ FT_BEGIN_HEADER
   /*    FT_Raster                                                          */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    A handle (pointer) to a raster object.  Each object can be used    */
-  /*    independently to convert an outline into a bitmap or pixmap.       */
+  /*    An opaque handle (pointer) to a raster object.  Each object can be */
+  /*    used independently to convert an outline into a bitmap or pixmap.  */
   /*                                                                       */
   typedef struct FT_RasterRec_*  FT_Raster;
 
@@ -868,8 +811,8 @@ FT_BEGIN_HEADER
   /*    FT_Span                                                            */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    A structure used to model a single span of gray (or black) pixels  */
-  /*    when rendering a monochrome or anti-aliased bitmap.                */
+  /*    A structure used to model a single span of gray pixels when        */
+  /*    rendering an anti-aliased bitmap.                                  */
   /*                                                                       */
   /* <Fields>                                                              */
   /*    x        :: The span's horizontal start position.                  */
@@ -877,13 +820,12 @@ FT_BEGIN_HEADER
   /*    len      :: The span's length in pixels.                           */
   /*                                                                       */
   /*    coverage :: The span color/coverage, ranging from 0 (background)   */
-  /*                to 255 (foreground).  Only used for anti-aliased       */
-  /*                rendering.                                             */
+  /*                to 255 (foreground).                                   */
   /*                                                                       */
   /* <Note>                                                                */
   /*    This structure is used by the span drawing callback type named     */
-  /*    @FT_SpanFunc which takes the y~coordinate of the span as a         */
-  /*    a parameter.                                                       */
+  /*    @FT_SpanFunc that takes the y~coordinate of the span as a          */
+  /*    parameter.                                                         */
   /*                                                                       */
   /*    The coverage value is always between 0 and 255.  If you want less  */
   /*    gray values, the callback function has to reduce them.             */
@@ -948,22 +890,7 @@ FT_BEGIN_HEADER
   /*    FT_Raster_BitTest_Func                                             */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT.                           */
-  /*                                                                       */
-  /*    A function used as a call-back by the monochrome scan-converter    */
-  /*    to test whether a given target pixel is already set to the drawing */
-  /*    `color'.  These tests are crucial to implement drop-out control    */
-  /*    per-se the TrueType spec.                                          */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    y     :: The pixel's y~coordinate.                                 */
-  /*                                                                       */
-  /*    x     :: The pixel's x~coordinate.                                 */
-  /*                                                                       */
-  /*    user  :: User-supplied data that is passed to the callback.        */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*   1~if the pixel is `set', 0~otherwise.                               */
+  /*    Deprecated, unimplemented.                                         */
   /*                                                                       */
   typedef int
   (*FT_Raster_BitTest_Func)( int    y,
@@ -977,21 +904,7 @@ FT_BEGIN_HEADER
   /*    FT_Raster_BitSet_Func                                              */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT.                           */
-  /*                                                                       */
-  /*    A function used as a call-back by the monochrome scan-converter    */
-  /*    to set an individual target pixel.  This is crucial to implement   */
-  /*    drop-out control according to the TrueType specification.          */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    y     :: The pixel's y~coordinate.                                 */
-  /*                                                                       */
-  /*    x     :: The pixel's x~coordinate.                                 */
-  /*                                                                       */
-  /*    user  :: User-supplied data that is passed to the callback.        */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    1~if the pixel is `set', 0~otherwise.                              */
+  /*    Deprecated, unimplemented.                                         */
   /*                                                                       */
   typedef void
   (*FT_Raster_BitSet_Func)( int    y,
@@ -1025,8 +938,8 @@ FT_BEGIN_HEADER
   /*                              pixmap's buffer _must_ be zeroed before  */
   /*                              rendering.                               */
   /*                                                                       */
-  /*                              Note that for now, direct rendering is   */
-  /*                              only possible with anti-aliased glyphs.  */
+  /*                              Direct rendering is only possible with   */
+  /*                              anti-aliased glyphs.                     */
   /*                                                                       */
   /*    FT_RASTER_FLAG_CLIP    :: This flag is only used in direct         */
   /*                              rendering mode.  If set, the output will */
@@ -1044,7 +957,8 @@ FT_BEGIN_HEADER
 #define FT_RASTER_FLAG_DIRECT   0x2
 #define FT_RASTER_FLAG_CLIP     0x4
 
-  /* deprecated */
+  /* these constants are deprecated; use the corresponding */
+  /* `FT_RASTER_FLAG_XXX' values instead                   */
 #define ft_raster_flag_default  FT_RASTER_FLAG_DEFAULT
 #define ft_raster_flag_aa       FT_RASTER_FLAG_AA
 #define ft_raster_flag_direct   FT_RASTER_FLAG_DIRECT
@@ -1070,11 +984,11 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    gray_spans  :: The gray span drawing callback.                     */
   /*                                                                       */
-  /*    black_spans :: The black span drawing callback.  UNIMPLEMENTED!    */
+  /*    black_spans :: Unused.                                             */
   /*                                                                       */
-  /*    bit_test    :: The bit test callback.  UNIMPLEMENTED!              */
+  /*    bit_test    :: Unused.                                             */
   /*                                                                       */
-  /*    bit_set     :: The bit set callback.  UNIMPLEMENTED!               */
+  /*    bit_set     :: Unused.                                             */
   /*                                                                       */
   /*    user        :: User-supplied data that is passed to each drawing   */
   /*                   callback.                                           */
@@ -1091,15 +1005,9 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the      */
   /*    raster will call the `gray_spans' callback to draw gray pixel      */
-  /*    spans, in the case of an aa glyph bitmap, it will call             */
-  /*    `black_spans', and `bit_test' and `bit_set' in the case of a       */
-  /*    monochrome bitmap.  This allows direct composition over a          */
-  /*    pre-existing bitmap through user-provided callbacks to perform the */
-  /*    span drawing/composition.                                          */
-  /*                                                                       */
-  /*    Note that the `bit_test' and `bit_set' callbacks are required when */
-  /*    rendering a monochrome bitmap, as they are crucial to implement    */
-  /*    correct drop-out control as defined in the TrueType specification. */
+  /*    spans.  This allows direct composition over a pre-existing bitmap  */
+  /*    through user-provided callbacks to perform the span drawing and    */
+  /*    composition.    Not supported by the monochrome rasterizer.        */
   /*                                                                       */
   typedef struct  FT_Raster_Params_
   {
@@ -1107,9 +1015,9 @@ FT_BEGIN_HEADER
     const void*             source;
     int                     flags;
     FT_SpanFunc             gray_spans;
-    FT_SpanFunc             black_spans;  /* doesn't work! */
-    FT_Raster_BitTest_Func  bit_test;     /* doesn't work! */
-    FT_Raster_BitSet_Func   bit_set;      /* doesn't work! */
+    FT_SpanFunc             black_spans;  /* unused */
+    FT_Raster_BitTest_Func  bit_test;     /* unused */
+    FT_Raster_BitSet_Func   bit_set;      /* unused */
     void*                   user;
     FT_BBox                 clip_box;
 
@@ -1256,7 +1164,7 @@ FT_BEGIN_HEADER
   /*    XXX: For now, the standard raster doesn't support direct           */
   /*         composition but this should change for the final release (see */
   /*         the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c'    */
-  /*         for examples of distinct implementations which support direct */
+  /*         for examples of distinct implementations that support direct  */
   /*         composition).                                                 */
   /*                                                                       */
   typedef int
@@ -1296,7 +1204,6 @@ FT_BEGIN_HEADER
 
   } FT_Raster_Funcs;
 
-
   /* */
 
 
similarity index 99%
rename from include/freetype/ftincrem.h
rename to include/ftincrem.h
index aaf689f..4c0246c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType incremental loading (specification).                        */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2006, 2007, 2008, 2010 by                        */
+/*  Copyright 2002, 2003, 2006-2008, 2010, 2014 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -45,7 +45,7 @@ FT_BEGIN_HEADER
    * @description:
    *   This section contains various functions used to perform so-called
    *   `incremental' glyph loading.  This is a mode where all glyphs loaded
-   *   from a given @FT_Face are provided by the client application,
+   *   from a given @FT_Face are provided by the client application.
    *
    *   Apart from that, all other tables are loaded normally from the font
    *   file.  This mode is useful when FreeType is used within another
@@ -345,6 +345,7 @@ FT_BEGIN_HEADER
 
   /* */
 
+
 FT_END_HEADER
 
 #endif /* __FTINCREM_H__ */
similarity index 80%
rename from include/freetype/ftlcdfil.h
rename to include/ftlcdfil.h
index 0b55ebe..e8679c1 100644 (file)
@@ -5,7 +5,7 @@
 /*    FreeType API for color filtering of subpixel bitmap glyphs           */
 /*    (specification).                                                     */
 /*                                                                         */
-/*  Copyright 2006, 2007, 2008, 2010 by                                    */
+/*  Copyright 2006-2008, 2010, 2013, 2014 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -45,14 +45,52 @@ FT_BEGIN_HEADER
    *
    * @description:
    *   The @FT_Library_SetLcdFilter API can be used to specify a low-pass
-   *   filter which is then applied to LCD-optimized bitmaps generated
+   *   filter, which is then applied to LCD-optimized bitmaps generated
    *   through @FT_Render_Glyph.  This is useful to reduce color fringes
-   *   which would occur with unfiltered rendering.
+   *   that would occur with unfiltered rendering.
    *
    *   Note that no filter is active by default, and that this function is
    *   *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.
    */
 
 
similarity index 96%
rename from include/freetype/ftlist.h
rename to include/ftlist.h
index bb6f7f1..9950a27 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Generic list support for FreeType (specification).                   */
 /*                                                                         */
-/*  Copyright 1996-2001, 2003, 2007, 2010 by                               */
+/*  Copyright 1996-2001, 2003, 2007, 2010, 2013, 2014 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -173,7 +173,7 @@ FT_BEGIN_HEADER
   /*    FT_List_Iterator                                                   */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    An FT_List iterator function which is called during a list parse   */
+  /*    An FT_List iterator function that is called during a list parse    */
   /*    by @FT_List_Iterate.                                               */
   /*                                                                       */
   /* <Input>                                                               */
@@ -200,7 +200,7 @@ FT_BEGIN_HEADER
   /* <Input>                                                               */
   /*    list     :: A handle to the list.                                  */
   /*    iterator :: An iterator function, called on each node of the list. */
-  /*    user     :: A user-supplied field which is passed as the second    */
+  /*    user     :: A user-supplied field that is passed as the second     */
   /*                argument to the iterator.                              */
   /*                                                                       */
   /* <Return>                                                              */
@@ -218,7 +218,7 @@ FT_BEGIN_HEADER
   /*    FT_List_Destructor                                                 */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    An @FT_List iterator function which is called during a list        */
+  /*    An @FT_List iterator function that is called during a list         */
   /*    finalization by @FT_List_Finalize to destroy all elements in a     */
   /*    given list.                                                        */
   /*                                                                       */
@@ -248,11 +248,11 @@ FT_BEGIN_HEADER
   /*    list    :: A handle to the list.                                   */
   /*                                                                       */
   /*    destroy :: A list destructor that will be applied to each element  */
-  /*               of the list.                                            */
+  /*               of the list.  Set this to NULL if not needed.           */
   /*                                                                       */
-  /*    memory  :: The current memory object which handles deallocation.   */
+  /*    memory  :: The current memory object that handles deallocation.    */
   /*                                                                       */
-  /*    user    :: A user-supplied field which is passed as the last       */
+  /*    user    :: A user-supplied field that is passed as the last        */
   /*               argument to the destructor.                             */
   /*                                                                       */
   /* <Note>                                                                */
@@ -265,7 +265,6 @@ FT_BEGIN_HEADER
                     FT_Memory           memory,
                     void*               user );
 
-
   /* */
 
 
similarity index 99%
rename from include/freetype/ftlzw.h
rename to include/ftlzw.h
index 00d4016..857c0c5 100644 (file)
@@ -88,7 +88,7 @@ FT_BEGIN_HEADER
   FT_Stream_OpenLZW( FT_Stream  stream,
                      FT_Stream  source );
 
- /* */
 /* */
 
 
 FT_END_HEADER
similarity index 98%
rename from include/freetype/ftmac.h
rename to include/ftmac.h
index ab5bab5..42874fe 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Additional Mac-specific API.                                         */
 /*                                                                         */
-/*  Copyright 1996-2001, 2004, 2006, 2007 by                               */
+/*  Copyright 1996-2001, 2004, 2006, 2007, 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,       */
@@ -18,7 +18,7 @@
 
 /***************************************************************************/
 /*                                                                         */
-/* NOTE: Include this file after <freetype/freetype.h> and after any       */
+/* NOTE: Include this file after FT_FREETYPE_H and after any               */
 /*       Mac-specific headers (because this header uses Mac types such as  */
 /*       Handle, FSSpec, FSRef, etc.)                                      */
 /*                                                                         */
@@ -168,7 +168,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    Return a pathname of the disk file and face index for given font   */
-  /*    name which is handled by ATS framework.                            */
+  /*    name that is handled by ATS framework.                             */
   /*                                                                       */
   /* <Input>                                                               */
   /*    fontName    :: Mac OS name of the font in ATS framework.           */
similarity index 98%
rename from include/freetype/ftmm.h
rename to include/ftmm.h
index 3aefb9e..2dcfd67 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType Multiple Master font interface (specification).             */
 /*                                                                         */
-/*  Copyright 1996-2001, 2003, 2004, 2006, 2009 by                         */
+/*  Copyright 1996-2001, 2003, 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,       */
@@ -196,7 +196,7 @@ FT_BEGIN_HEADER
   /*                       number of designs).                             */
   /*                                                                       */
   /*    num_namedstyles :: The number of named styles; only meaningful for */
-  /*                       GX which allows certain design coordinates to   */
+  /*                       GX that allows certain design coordinates to    */
   /*                       have a string ID (in the `name' table)          */
   /*                       associated with them.  The font can tell the    */
   /*                       user that, for example, Weight=1.5 is `Bold'.   */
@@ -218,9 +218,6 @@ FT_BEGIN_HEADER
   } FT_MM_Var;
 
 
-  /* */
-
-
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -258,8 +255,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Output>                                                              */
   /*    amaster :: The Multiple Masters/GX var descriptor.                 */
-  /*               Allocates a data structure, which the user must free    */
-  /*               (a single call to FT_FREE will do it).                  */
+  /*               Allocates a data structure, which the user must free.   */
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
@@ -366,7 +362,6 @@ FT_BEGIN_HEADER
                                 FT_UInt    num_coords,
                                 FT_Fixed*  coords );
 
-
   /* */
 
 
similarity index 75%
rename from include/freetype/ftmodapi.h
rename to include/ftmodapi.h
index 8f2e017..980f15d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -42,11 +42,65 @@ FT_BEGIN_HEADER
   /*    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.            */
+  /*    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.  */
+  /*                                                                       */
+  /* <Order>                                                               */
+  /*    FT_Module                                                          */
+  /*    FT_Module_Constructor                                              */
+  /*    FT_Module_Destructor                                               */
+  /*    FT_Module_Requester                                                */
+  /*    FT_Module_Class                                                    */
+  /*                                                                       */
+  /*    FT_Add_Module                                                      */
+  /*    FT_Get_Module                                                      */
+  /*    FT_Remove_Module                                                   */
+  /*    FT_Add_Default_Modules                                             */
+  /*                                                                       */
+  /*    FT_Property_Set                                                    */
+  /*    FT_Property_Get                                                    */
+  /*                                                                       */
+  /*    FT_New_Library                                                     */
+  /*    FT_Done_Library                                                    */
+  /*    FT_Reference_Library                                               */
+  /*                                                                       */
+  /*    FT_Renderer                                                        */
+  /*    FT_Renderer_Class                                                  */
+  /*                                                                       */
+  /*    FT_Get_Renderer                                                    */
+  /*    FT_Set_Renderer                                                    */
+  /*                                                                       */
+  /*    FT_Set_Debug_Hook                                                  */
   /*                                                                       */
   /*************************************************************************/
 
@@ -118,7 +172,7 @@ FT_BEGIN_HEADER
   /*    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.                 */
   /*                                                                       */
@@ -249,6 +303,137 @@ FT_BEGIN_HEADER
                     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 that 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 that 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>                                                            */
@@ -260,7 +445,7 @@ FT_BEGIN_HEADER
   /*    @FT_Done_Library then only destroys a library if the counter is~1, */
   /*    otherwise it simply decrements the counter.                        */
   /*                                                                       */
-  /*    This function helps in managing life-cycles of structures which    */
+  /*    This function helps in managing life-cycles of structures that     */
   /*    reference @FT_Library objects.                                     */
   /*                                                                       */
   /* <Input>                                                               */
@@ -333,7 +518,7 @@ FT_BEGIN_HEADER
   FT_EXPORT( FT_Error )
   FT_Done_Library( FT_Library  library );
 
-/* */
+  /* */
 
   typedef void
   (*FT_DebugHook_Func)( void*  arg );
@@ -426,17 +611,17 @@ FT_BEGIN_HEADER
    *       The library implements a bytecode interpreter that doesn't
    *       support the patented operations of the TrueType virtual machine.
    *
-   *       Its main use is to load certain Asian fonts which position and
+   *       Its main use is to load certain Asian fonts that position and
    *       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:
-   *       2.2
+   *     2.2
    *
    */
   typedef enum  FT_TrueTypeEngineType_
@@ -471,7 +656,6 @@ FT_BEGIN_HEADER
   FT_EXPORT( FT_TrueTypeEngineType )
   FT_Get_TrueType_Engine_Type( FT_Library  library );
 
-
   /* */
 
 
similarity index 63%
rename from include/freetype/ftmoderr.h
rename to include/ftmoderr.h
index 1bf3b38..5a27db1 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType module error offsets (specification).                       */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004, 2005, 2010 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,       */
 
   /*************************************************************************/
   /*                                                                       */
-  /* 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                                                   */
@@ -48,9 +88,6 @@
   /*     #include FT_MODULE_ERRORS_H                                       */
   /*   }                                                                   */
   /*                                                                       */
-  /* To use such a table, all errors must be ANDed with 0xFF00 to remove   */
-  /* the error code.                                                       */
-  /*                                                                       */
   /*************************************************************************/
 
 
   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
similarity index 91%
rename from include/freetype/ftotval.h
rename to include/ftotval.h
index 027f2e8..75ba03e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for validating OpenType tables (specification).         */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2007 by                                    */
+/*  Copyright 2004-2007, 2013, 2014 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -58,6 +58,12 @@ FT_BEGIN_HEADER
   /*    This section contains the declaration of functions to validate     */
   /*    some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).         */
   /*                                                                       */
+  /* <Order>                                                               */
+  /*    FT_OpenType_Validate                                               */
+  /*    FT_OpenType_Free                                                   */
+  /*                                                                       */
+  /*    FT_VALIDATE_OTXXX                                                  */
+  /*                                                                       */
   /*************************************************************************/
 
 
@@ -107,8 +113,6 @@ FT_BEGIN_HEADER
                         FT_VALIDATE_JSTF | \
                         FT_VALIDATE_MATH
 
-  /* */
-
  /**********************************************************************
   *
   * @function:
@@ -116,7 +120,7 @@ FT_BEGIN_HEADER
   *
   * @description:
   *    Validate various OpenType tables to assure that all offsets and
-  *    indices are valid.  The idea is that a higher-level library which
+  *    indices are valid.  The idea is that a higher-level library that
   *    actually does the text layout can access those tables without
   *    error checking (which can be quite time consuming).
   *
@@ -125,7 +129,7 @@ FT_BEGIN_HEADER
   *       A handle to the input face.
   *
   *    validation_flags ::
-  *       A bit field which specifies the tables to be validated.  See
+  *       A bit field that specifies the tables to be validated.  See
   *       @FT_VALIDATE_OTXXX for possible values.
   *
   * @output:
@@ -165,8 +169,6 @@ FT_BEGIN_HEADER
                         FT_Bytes  *GSUB_table,
                         FT_Bytes  *JSTF_table );
 
-  /* */
-
  /**********************************************************************
   *
   * @function:
@@ -191,8 +193,7 @@ FT_BEGIN_HEADER
   FT_OpenType_Free( FT_Face   face,
                     FT_Bytes  table );
 
-
- /* */
+  /* */
 
 
 FT_END_HEADER
similarity index 90%
rename from include/freetype/ftoutln.h
rename to include/ftoutln.h
index 1cf3c3f..d3b8fbd 100644 (file)
@@ -5,7 +5,7 @@
 /*    Support for the FT_Outline type used to store glyph shapes of        */
 /*    most scalable font formats (specification).                          */
 /*                                                                         */
-/*  Copyright 1996-2003, 2005-2011 by                                      */
+/*  Copyright 1996-2003, 2005-2014 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -52,13 +52,13 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Order>                                                               */
   /*    FT_Outline                                                         */
-  /*    FT_OUTLINE_FLAGS                                                   */
   /*    FT_Outline_New                                                     */
   /*    FT_Outline_Done                                                    */
   /*    FT_Outline_Copy                                                    */
   /*    FT_Outline_Translate                                               */
   /*    FT_Outline_Transform                                               */
   /*    FT_Outline_Embolden                                                */
+  /*    FT_Outline_EmboldenXY                                              */
   /*    FT_Outline_Reverse                                                 */
   /*    FT_Outline_Check                                                   */
   /*                                                                       */
@@ -67,13 +67,17 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    FT_Outline_Get_Bitmap                                              */
   /*    FT_Outline_Render                                                  */
-  /*                                                                       */
   /*    FT_Outline_Decompose                                               */
   /*    FT_Outline_Funcs                                                   */
-  /*    FT_Outline_MoveTo_Func                                             */
-  /*    FT_Outline_LineTo_Func                                             */
-  /*    FT_Outline_ConicTo_Func                                            */
-  /*    FT_Outline_CubicTo_Func                                            */
+  /*    FT_Outline_MoveToFunc                                              */
+  /*    FT_Outline_LineToFunc                                              */
+  /*    FT_Outline_ConicToFunc                                             */
+  /*    FT_Outline_CubicToFunc                                             */
+  /*                                                                       */
+  /*    FT_Orientation                                                     */
+  /*    FT_Outline_Get_Orientation                                         */
+  /*                                                                       */
+  /*    FT_OUTLINE_XXX                                                     */
   /*                                                                       */
   /*************************************************************************/
 
@@ -96,7 +100,7 @@ FT_BEGIN_HEADER
   /*                      operations.                                      */
   /*                                                                       */
   /* <InOut>                                                               */
-  /*    user           :: A typeless pointer which is passed to each       */
+  /*    user           :: A typeless pointer that is passed to each        */
   /*                      emitter during the decomposition.  It can be     */
   /*                      used to store the state during the               */
   /*                      decomposition.                                   */
@@ -104,6 +108,13 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
+  /* <Note>                                                                */
+  /*    A contour that contains a single point only is represented by a    */
+  /*    `move to' operation followed by `line to' to the same point.  In   */
+  /*    most cases, it is best to filter this out before using the         */
+  /*    outline for stroking purposes (otherwise it would result in a      */
+  /*    visible dot when round caps are used).                             */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Outline_Decompose( FT_Outline*              outline,
                         const FT_Outline_Funcs*  func_interface,
@@ -124,9 +135,11 @@ FT_BEGIN_HEADER
   /*                   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.                        */
@@ -214,12 +227,12 @@ FT_BEGIN_HEADER
   /*    the outline's points, including Bézier control points.  Though it  */
   /*    coincides with the exact bounding box for most glyphs, it can be   */
   /*    slightly larger in some situations (like when rotating an outline  */
-  /*    which contains Bézier outside arcs).                               */
+  /*    that contains Bézier outside arcs).                                */
   /*                                                                       */
   /*    Computing the control box is very fast, while getting the bounding */
   /*    box can take much more time as it needs to walk over all segments  */
   /*    and arcs in the outline.  To get the latter, you can use the       */
-  /*    `ftbbox' component which is dedicated to this single task.         */
+  /*    `ftbbox' component, which is dedicated to this single task.        */
   /*                                                                       */
   /* <Input>                                                               */
   /*    outline :: A pointer to the source outline descriptor.             */
@@ -345,6 +358,9 @@ FT_BEGIN_HEADER
   /*        FT_Outline_Embolden( &face->slot->outline, strength );         */
   /*    }                                                                  */
   /*                                                                       */
+  /*    To get meaningful results, font scaling values must be set with    */
+  /*    functions like @FT_Set_Char_Size before calling FT_Render_Glyph.   */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Outline_Embolden( FT_Outline*  outline,
                        FT_Pos       strength );
@@ -353,6 +369,23 @@ FT_BEGIN_HEADER
   /*************************************************************************/
   /*                                                                       */
   /* <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>                                                            */
   /*    FT_Outline_Reverse                                                 */
   /*                                                                       */
   /* <Description>                                                         */
@@ -505,9 +538,11 @@ FT_BEGIN_HEADER
   *
   * @description:
   *   This function analyzes a glyph outline and tries to compute its
-  *   fill orientation (see @FT_Orientation).  This is done by computing
-  *   the direction of each global horizontal and/or vertical extrema
-  *   within the outline.
+  *   fill orientation (see @FT_Orientation).  This is done by integrating
+  *   the total area covered by the outline. The positive integral
+  *   corresponds to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT
+  *   is returned. The negative integral corresponds to the counter-clockwise
+  *   orientation and @FT_ORIENTATION_TRUETYPE is returned.
   *
   *   Note that this will return @FT_ORIENTATION_TRUETYPE for empty
   *   outlines.
@@ -523,7 +558,6 @@ FT_BEGIN_HEADER
   FT_EXPORT( FT_Orientation )
   FT_Outline_Get_Orientation( FT_Outline*  outline );
 
-
   /* */
 
 
similarity index 99%
rename from include/freetype/ftpfr.h
rename to include/ftpfr.h
index 0b7b7d4..7d50353 100644 (file)
@@ -161,7 +161,7 @@ FT_BEGIN_HEADER
                       FT_UInt   gindex,
                       FT_Pos   *aadvance );
 
- /* */
 /* */
 
 
 FT_END_HEADER
similarity index 99%
rename from include/freetype/ftrender.h
rename to include/ftrender.h
index dd0229b..e8d3636 100644 (file)
@@ -226,7 +226,6 @@ FT_BEGIN_HEADER
                    FT_UInt        num_params,
                    FT_Parameter*  parameters );
 
-
   /* */
 
 
similarity index 98%
rename from include/freetype/ftsizes.h
rename to include/ftsizes.h
index 3e548cc..4167045 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType size objects management (specification).                    */
 /*                                                                         */
-/*  Copyright 1996-2001, 2003, 2004, 2006, 2009 by                         */
+/*  Copyright 1996-2001, 2003, 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,       */
@@ -129,7 +129,7 @@ FT_BEGIN_HEADER
   /* <Description>                                                         */
   /*    Even though it is possible to create several size objects for a    */
   /*    given face (see @FT_New_Size for details), functions like          */
-  /*    @FT_Load_Glyph or @FT_Load_Char only use the one which has been    */
+  /*    @FT_Load_Glyph or @FT_Load_Char only use the one that has been     */
   /*    activated last to determine the `current character pixel size'.    */
   /*                                                                       */
   /*    This function can be used to `activate' a previously created size  */
similarity index 98%
rename from include/freetype/ftsnames.h
rename to include/ftsnames.h
index 485e4e1..88af440 100644 (file)
@@ -7,7 +7,7 @@
 /*                                                                         */
 /*    This is _not_ used to retrieve glyph names!                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by                   */
+/*  Copyright 1996-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,       */
@@ -169,7 +169,7 @@ FT_BEGIN_HEADER
    *   A constant used as the tag of @FT_Parameter structures to make
    *   FT_Open_Face() ignore preferred family subfamily names in `name'
    *   table since OpenType version 1.4.  For backwards compatibility with
-   *   legacy systems which has 4-face-per-family restriction.
+   *   legacy systems that have a 4-face-per-family restriction.
    *
    */
 #define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
@@ -184,7 +184,7 @@ FT_BEGIN_HEADER
    *   A constant used as the tag of @FT_Parameter structures to make
    *   FT_Open_Face() ignore preferred subfamily names in `name' table since
    *   OpenType version 1.4.  For backwards compatibility with legacy
-   *   systems which has 4-face-per-family restriction.
+   *   systems that have a 4-face-per-family restriction.
    *
    */
 #define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 's' )
similarity index 93%
rename from include/freetype/ftstroke.h
rename to include/ftstroke.h
index 49ae2bc..bd31170 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType path stroker (specification).                               */
 /*                                                                         */
-/*  Copyright 2002-2006, 2008, 2009, 2011 by                               */
+/*  Copyright 2002-2006, 2008, 2009, 2011-2012, 2014 by                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -46,6 +46,38 @@ FT_BEGIN_HEADER
   *    This can be useful to generate `bordered' glyph, i.e., glyphs
   *    displayed with a coloured (and anti-aliased) border around their
   *    shape.
+  *
+  * @order:
+  *    FT_Stroker
+  *
+  *    FT_Stroker_LineJoin
+  *    FT_Stroker_LineCap
+  *    FT_StrokerBorder
+  *
+  *    FT_Outline_GetInsideBorder
+  *    FT_Outline_GetOutsideBorder
+  *
+  *    FT_Glyph_Stroke
+  *    FT_Glyph_StrokeBorder
+  *
+  *    FT_Stroker_New
+  *    FT_Stroker_Set
+  *    FT_Stroker_Rewind
+  *    FT_Stroker_ParseOutline
+  *    FT_Stroker_Done
+  *
+  *    FT_Stroker_BeginSubPath
+  *    FT_Stroker_EndSubPath
+  *
+  *    FT_Stroker_LineTo
+  *    FT_Stroker_ConicTo
+  *    FT_Stroker_CubicTo
+  *
+  *    FT_Stroker_GetBorderCounts
+  *    FT_Stroker_ExportBorder
+  *    FT_Stroker_GetCounts
+  *    FT_Stroker_Export
+  *
   */
 
 
@@ -55,7 +87,7 @@ FT_BEGIN_HEADER
   *   FT_Stroker
   *
   * @description:
-  *   Opaque handler to a path stroker object.
+  *   Opaque handle to a path stroker object.
   */
   typedef struct FT_StrokerRec_*  FT_Stroker;
 
@@ -271,11 +303,13 @@ FT_BEGIN_HEADER
    *   miter_limit ::
    *     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.
+   *     expressed as 16.16 fixed-point value.
    *
    * @note:
    *   The radius is expressed in the same units as the outline
    *   coordinates.
+   *
+   *   This function calls @FT_Stroker_Rewind automatically.
    */
   FT_EXPORT( void )
   FT_Stroker_Set( FT_Stroker           stroker,
@@ -570,10 +604,10 @@ FT_BEGIN_HEADER
    *   receive all new data.
    *
    *   When an outline, or a sub-path, is `closed', the stroker generates
-   *   two independent `border' outlines, named `left' and `right'
+   *   two independent `border' outlines, named `left' and `right'.
    *
    *   When the outline, or a sub-path, is `opened', the stroker merges
-   *   the `border' outlines with caps. The `left' border receives all
+   *   the `border' outlines with caps.  The `left' border receives all
    *   points, while the `right' border becomes empty.
    *
    *   Use the function @FT_Stroker_Export instead if you want to
@@ -682,6 +716,11 @@ FT_BEGIN_HEADER
    *
    * @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,
@@ -719,6 +758,11 @@ FT_BEGIN_HEADER
    *
    * @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,
@@ -726,7 +770,7 @@ FT_BEGIN_HEADER
                          FT_Bool      inside,
                          FT_Bool      destroy );
 
- /* */
 /* */
 
 FT_END_HEADER
 
similarity index 91%
rename from include/freetype/ftsynth.h
rename to include/ftsynth.h
index a068b79..d0ea730 100644 (file)
@@ -5,7 +5,7 @@
 /*    FreeType synthesizing code for emboldening and slanting              */
 /*    (specification).                                                     */
 /*                                                                         */
-/*  Copyright 2000-2001, 2003, 2006, 2008 by                               */
+/*  Copyright 2000-2001, 2003, 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,       */
@@ -37,7 +37,7 @@
   /* Main reason for not lifting the functions in this module to a  */
   /* `standard' API is that the used parameters for emboldening and */
   /* slanting are not configurable.  Consider the functions as a    */
-  /* code resource which should be copied into the application and  */
+  /* code resource that should be copied into the application and   */
   /* adapted to the particular needs.                               */
 
 
@@ -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.           */
   /*                                                                       */
-  /* 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 );
 
@@ -72,6 +73,7 @@ FT_BEGIN_HEADER
 
   /* */
 
+
 FT_END_HEADER
 
 #endif /* __FTSYNTH_H__ */
similarity index 95%
rename from include/freetype/ftsystem.h
rename to include/ftsystem.h
index e07460c..7436ed2 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType low-level system interface definition (specification).      */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2005, 2010 by                               */
+/*  Copyright 1996-2001, 2002, 2005, 2010, 2014 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -192,6 +192,10 @@ FT_BEGIN_HEADER
    * @description:
    *   A handle to an input stream.
    *
+   * @also:
+   *   See @FT_StreamRec for the publicly accessible fields of a given
+   *   stream object.
+   *
    */
   typedef struct FT_StreamRec_*  FT_Stream;
 
@@ -285,6 +289,11 @@ FT_BEGIN_HEADER
    *   size ::
    *     The stream size in bytes.
    *
+   *     In case of compressed streams where the size is unknown before
+   *     actually doing the decompression, the value is set to 0x7FFFFFFF. 
+   *     (Note that this size value can occur for normal streams also; it is
+   *     thus just a hint.)
+   *
    *   pos ::
    *     The current position within the stream.
    *
@@ -335,7 +344,6 @@ FT_BEGIN_HEADER
 
   } FT_StreamRec;
 
-
   /* */
 
 
similarity index 95%
rename from include/freetype/fttrigon.h
rename to include/fttrigon.h
index 6b77d2e..9c7b543 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -46,7 +46,7 @@ FT_BEGIN_HEADER
    *
    * @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;
@@ -106,7 +106,7 @@ FT_BEGIN_HEADER
    *   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 ::
@@ -130,7 +130,7 @@ FT_BEGIN_HEADER
    *   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 ::
@@ -154,7 +154,7 @@ FT_BEGIN_HEADER
    *   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 ::
@@ -237,7 +237,7 @@ FT_BEGIN_HEADER
    *
    * @input:
    *   angle ::
-   *     The address of angle.
+   *     The input angle.
    *
    */
   FT_EXPORT( void )
@@ -259,7 +259,7 @@ FT_BEGIN_HEADER
    *
    * @input:
    *   angle ::
-   *     The address of angle.
+   *     The input angle.
    *
    */
   FT_EXPORT( void )
diff --git a/include/ftttdrv.h b/include/ftttdrv.h
new file mode 100644 (file)
index 0000000..3588413
--- /dev/null
@@ -0,0 +1,170 @@
+/***************************************************************************/
+/*                                                                         */
+/*  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, representing 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.
+   *
+   *   Depending on the graphics framework, Microsoft uses different
+   *   bytecode engines.  As a consequence, the version numbers returned by
+   *   a call to the `GETINFO[1]' bytecode instruction are more convoluted
+   *   than desired.
+   *
+   *   {
+   *      framework   Windows version   result of GETINFO[1]
+   *     ----------------------------------------------------
+   *       GDI         before XP         35
+   *       GDI         XP and later      37
+   *       GDI+ old    before Vista      37
+   *       GDI+ old    Vista, 7          38
+   *       GDI+        after 7           40
+   *       DWrite      before 8          39
+   *       DWrite      8 and later       40
+   *   }
+   *
+   *   Since FreeType doesn't provide all capabilities of DWrite ClearType,
+   *   using version~38 seems justified.
+   *
+   */
+#define TT_INTERPRETER_VERSION_35  35
+#define TT_INTERPRETER_VERSION_38  38
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __FTTTDRV_H__ */
+
+
+/* END */
similarity index 96%
rename from include/freetype/fttypes.h
rename to include/fttypes.h
index 3255527..2c01e87 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType simple types definitions (specification only).              */
 /*                                                                         */
-/*  Copyright 1996-2002, 2004, 2006-2009, 2012 by                          */
+/*  Copyright 1996-2002, 2004, 2006-2009, 2012-2014 by                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -57,6 +57,8 @@ FT_BEGIN_HEADER
   /*    FT_UInt16                                                          */
   /*    FT_Int32                                                           */
   /*    FT_UInt32                                                          */
+  /*    FT_Int64                                                           */
+  /*    FT_UInt64                                                          */
   /*    FT_Short                                                           */
   /*    FT_UShort                                                          */
   /*    FT_Long                                                            */
@@ -78,7 +80,9 @@ FT_BEGIN_HEADER
   /*    FT_F2Dot14                                                         */
   /*    FT_UnitVector                                                      */
   /*    FT_F26Dot6                                                         */
+  /*    FT_Data                                                            */
   /*                                                                       */
+  /*    FT_MAKE_TAG                                                        */
   /*                                                                       */
   /*    FT_Generic                                                         */
   /*    FT_Generic_Finalizer                                               */
@@ -255,7 +259,7 @@ FT_BEGIN_HEADER
   /*    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;
 
@@ -266,7 +270,7 @@ FT_BEGIN_HEADER
   /*    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;
@@ -278,7 +282,7 @@ FT_BEGIN_HEADER
   /*    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;
@@ -362,7 +366,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <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                                             */
@@ -418,7 +422,7 @@ FT_BEGIN_HEADER
   /*    details of usage.                                                  */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    The address of the FreeType object which is under finalization.    */
+  /*    The address of the FreeType object that is under finalization.     */
   /*    Its client data is accessed through its `generic' field.           */
   /*                                                                       */
   typedef void  (*FT_Generic_Finalizer)(void*  object);
@@ -466,8 +470,8 @@ FT_BEGIN_HEADER
   /*    FT_MAKE_TAG                                                        */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    This macro converts four-letter tags which are used to label       */
-  /*    TrueType tables into an unsigned long to be used within FreeType.  */
+  /*    This macro converts four-letter tags that are used to label        */
+  /*    TrueType tables into an unsigned long, to be used within FreeType. */
   /*                                                                       */
   /* <Note>                                                                */
   /*    The produced values *must* be 32-bit integers.  Don't redefine     */
@@ -567,18 +571,28 @@ FT_BEGIN_HEADER
 
   } FT_ListRec;
 
-
   /* */
 
+
 #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 )
 
-  /* return module error code */
+  /* see `ftmoderr.h' for descriptions of the following macros */
+
+#define FT_ERR( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )
+
+#define FT_ERROR_BASE( x )    ( (x) & 0xFF )
 #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
 
similarity index 97%
rename from include/freetype/ftwinfnt.h
rename to include/ftwinfnt.h
index ea33353..5026158 100644 (file)
@@ -58,9 +58,10 @@ FT_BEGIN_HEADER
    * @description:
    *   A list of valid values for the `charset' byte in
    *   @FT_WinFNT_HeaderRec.  Exact mapping tables for the various cpXXXX
-   *   encodings (except for cp1361) can be found at ftp://ftp.unicode.org
-   *   in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory.  cp1361 is
-   *   roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
+   *   encodings (except for cp1361) can be found at
+   *   ftp://ftp.unicode.org/public in the MAPPINGS/VENDORS/MICSFT/WINDOWS
+   *   subdirectory.  cp1361 is roughly a superset of
+   *   MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
    *
    * @values:
    *   FT_WinFNT_ID_DEFAULT ::
@@ -258,9 +259,9 @@ FT_BEGIN_HEADER
   FT_Get_WinFNT_Header( FT_Face               face,
                         FT_WinFNT_HeaderRec  *aheader );
 
-
   /* */
 
+
 FT_END_HEADER
 
 #endif /* __FTWINFNT_H__ */
similarity index 96%
rename from include/freetype/ftxf86.h
rename to include/ftxf86.h
index 8c68afd..89d1993 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Support functions for X11.                                           */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2006, 2007 by                              */
+/*  Copyright 2002-2004, 2006, 2007, 2013 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -62,7 +62,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*   Return a string describing the format of a given face, using values */
-  /*   which can be used as an X11 FONT_PROPERTY.  Possible values are     */
+  /*   that can be used as an X11 FONT_PROPERTY.  Possible values are      */
   /*   `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */
   /*   `PFR', and `Windows~FNT'.                                           */
   /*                                                                       */
@@ -76,7 +76,8 @@ FT_BEGIN_HEADER
   FT_EXPORT( const char* )
   FT_Get_X11_Font_Format( FT_Face  face );
 
- /* */
+  /* */
+
 
 FT_END_HEADER
 
similarity index 84%
rename from include/freetype/internal/autohint.h
rename to include/internal/autohint.h
index 231bdd4..545de93 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -86,20 +86,20 @@ FT_BEGIN_HEADER
   /*    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>                                                               */
-  /*    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>                                                              */
-  /*    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,
@@ -114,7 +114,7 @@ FT_BEGIN_HEADER
   /*    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.                                             */
   /*                                                                       */
@@ -168,8 +168,8 @@ FT_BEGIN_HEADER
   /*    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,
@@ -182,43 +182,56 @@ FT_BEGIN_HEADER
   /*************************************************************************/
   /*                                                                       */
   /* <Struct>                                                              */
-  /*    FT_AutoHinter_ServiceRec                                           */
+  /*    FT_AutoHinter_InterfaceRec                                         */
   /*                                                                       */
   /* <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_ServiceRec, *FT_AutoHinter_Service;
+  } FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;
+
 
 #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_;                                         \
+#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 */
similarity index 51%
rename from include/freetype/internal/ftcalc.h
rename to include/internal/ftcalc.h
index f8b4324..14ec37b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Arithmetic computations (specification).                             */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by       */
+/*  Copyright 1996-2006, 2008, 2009, 2012-2014 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -29,56 +29,222 @@ FT_BEGIN_HEADER
 
   /*************************************************************************/
   /*                                                                       */
-  /* <Function>                                                            */
-  /*    FT_FixedSqrt                                                       */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Computes the square root of a 16.16 fixed point value.             */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    x :: The value to compute the root for.                            */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    The result of `sqrt(x)'.                                           */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    This function is not very fast.                                    */
+  /* FT_MulDiv() and FT_MulFix() are declared in freetype.h.               */
   /*                                                                       */
-  FT_BASE( FT_Int32 )
-  FT_SqrtFixed( FT_Int32  x );
+  /*************************************************************************/
 
+#ifndef  FT_CONFIG_OPTION_NO_ASSEMBLER
+  /* Provide assembler fragments for performance-critical functions. */
+  /* These must be defined `static __inline__' with GCC.             */
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
+#if defined( __CC_ARM ) || defined( __ARMCC__ )  /* RVCT */
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <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 );
+#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm
 
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
+  /* documentation is in freetype.h */
 
+  static __inline FT_Int32
+  FT_MulFix_arm( FT_Int32  a,
+                 FT_Int32  b )
+  {
+    register FT_Int32  t, t2;
+
+
+    __asm
+    {
+      smull t2, t,  b,  a           /* (lo=t2,hi=t) = a*b */
+      mov   a,  t,  asr #31         /* a   = (hi >> 31) */
+      add   a,  a,  #0x8000         /* a  += 0x8000 */
+      adds  t2, t2, a               /* t2 += a */
+      adc   t,  t,  #0              /* t  += carry */
+      mov   a,  t2, lsr #16         /* a   = t2 >> 16 */
+      orr   a,  a,  t,  lsl #16     /* a  |= t << 16 */
+    }
+    return a;
+  }
+
+#endif /* __CC_ARM || __ARMCC__ */
+
+
+#ifdef __GNUC__
+
+#if defined( __arm__ )                                 && \
+    ( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \
+    !( defined( __CC_ARM ) || defined( __ARMCC__ ) )
+
+#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm
+
+  /* documentation is in freetype.h */
+
+  static __inline__ FT_Int32
+  FT_MulFix_arm( FT_Int32  a,
+                 FT_Int32  b )
+  {
+    register FT_Int32  t, t2;
+
+
+    __asm__ __volatile__ (
+      "smull  %1, %2, %4, %3\n\t"       /* (lo=%1,hi=%2) = a*b */
+      "mov    %0, %2, asr #31\n\t"      /* %0  = (hi >> 31) */
+#if defined( __clang__ ) && defined( __thumb2__ )
+      "add.w  %0, %0, #0x8000\n\t"      /* %0 += 0x8000 */
+#else
+      "add    %0, %0, #0x8000\n\t"      /* %0 += 0x8000 */
+#endif
+      "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"(b)
+      : "cc" );
+    return a;
+  }
+
+#endif /* __arm__                      && */
+       /* ( __thumb2__ || !__thumb__ ) && */
+       /* !( __CC_ARM || __ARMCC__ )      */
+
+
+#if defined( __i386__ )
+
+#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386
+
+  /* documentation is in freetype.h */
+
+  static __inline__ FT_Int32
+  FT_MulFix_i386( FT_Int32  a,
+                  FT_Int32  b )
+  {
+    register FT_Int32  result;
+
+
+    __asm__ __volatile__ (
+      "imul  %%edx\n"
+      "movl  %%edx, %%ecx\n"
+      "sarl  $31, %%ecx\n"
+      "addl  $0x8000, %%ecx\n"
+      "addl  %%ecx, %%eax\n"
+      "adcl  $0, %%edx\n"
+      "shrl  $16, %%eax\n"
+      "shll  $16, %%edx\n"
+      "addl  %%edx, %%eax\n"
+      : "=a"(result), "=d"(b)
+      : "a"(a), "d"(b)
+      : "%ecx", "cc" );
+    return result;
+  }
+
+#endif /* i386 */
+
+#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 */
+
+
+#if defined( __GNUC__ ) && defined( __x86_64__ )
+
+#define FT_MULFIX_ASSEMBLER  FT_MulFix_x86_64
+
+  static __inline__ FT_Int32
+  FT_MulFix_x86_64( FT_Int32  a,
+                    FT_Int32  b )
+  {
+    /* Temporarily disable the warning that C90 doesn't support */
+    /* `long long'.                                             */
+#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
+#endif
+
+#if 1
+    /* Technically not an assembly fragment, but GCC does a really good */
+    /* job at inlining it and generating good machine code for it.      */
+    long long  ret, tmp;
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* FT_MulDiv() and FT_MulFix() are declared in freetype.h.               */
-  /*                                                                       */
-  /*************************************************************************/
 
+    ret  = (long long)a * b;
+    tmp  = ret >> 63;
+    ret += 0x8000 + tmp;
+
+    return (FT_Int32)( ret >> 16 );
+#else
+
+    /* For some reason, GCC 4.6 on Ubuntu 12.04 generates invalid machine  */
+    /* code from the lines below.  The main issue is that `wide_a' is not  */
+    /* properly initialized by sign-extending `a'.  Instead, the generated */
+    /* machine code assumes that the register that contains `a' on input   */
+    /* can be used directly as a 64-bit value, which is wrong most of the  */
+    /* time.                                                               */
+    long long  wide_a = (long long)a;
+    long long  wide_b = (long long)b;
+    long long  result;
+
+
+    __asm__ __volatile__ (
+      "imul %2, %1\n"
+      "mov %1, %0\n"
+      "sar $63, %0\n"
+      "lea 0x8000(%1, %0), %0\n"
+      "sar $16, %0\n"
+      : "=&r"(result), "=&r"(wide_a)
+      : "r"(wide_b)
+      : "cc" );
+
+    return (FT_Int32)result;
+#endif
+
+#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )
+#pragma GCC diagnostic pop
+#endif
+  }
+
+#endif /* __GNUC__ && __x86_64__ */
+
+#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
+
+
+#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
+#ifdef FT_MULFIX_ASSEMBLER
+#define FT_MulFix( a, b )  FT_MULFIX_ASSEMBLER( (FT_Int32)(a), (FT_Int32)(b) )
+#endif
+#endif
 
-#ifdef TT_USE_BYTECODE_INTERPRETER
 
   /*************************************************************************/
   /*                                                                       */
@@ -87,7 +253,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <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 */
@@ -108,8 +274,6 @@ FT_BEGIN_HEADER
                       FT_Long  b,
                       FT_Long  c );
 
-#endif /* TT_USE_BYTECODE_INTERPRETER */
-
 
   /*
    *  A variant of FT_Matrix_Multiply which scales its result afterwards.
@@ -129,7 +293,6 @@ FT_BEGIN_HEADER
    *  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,
@@ -148,10 +311,11 @@ FT_BEGIN_HEADER
                          FT_Pos  out_x,
                          FT_Pos  out_y );
 
+
   /*
    *  Return TRUE if a corner is flat or nearly flat.  This is equivalent to
-   *  saying that the angle difference between the `in' and `out' vectors is
-   *  very small.
+   *  saying that the corner point is close to its neighbors, or inside an
+   *  ellipse defined by the neighbor focal points to be more precise.
    */
   FT_BASE( FT_Int )
   ft_corner_is_flat( FT_Pos  in_x,
@@ -160,6 +324,69 @@ FT_BEGIN_HEADER
                      FT_Pos  out_y );
 
 
+  /*
+   *  Return the most significant bit index.
+   */
+
+#ifndef  FT_CONFIG_OPTION_NO_ASSEMBLER
+#if defined( __GNUC__ )                                          && \
+    ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) )
+
+#if FT_SIZEOF_INT == 4
+
+#define FT_MSB( x )  ( 31 - __builtin_clz( x ) )
+
+#elif FT_SIZEOF_LONG == 4
+
+#define FT_MSB( x )  ( 31 - __builtin_clzl( x ) )
+
+#endif
+
+#endif /* __GNUC__ */
+#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
+
+#ifndef FT_MSB
+
+  FT_BASE( FT_Int )
+  FT_MSB( FT_UInt32  z );
+
+#endif
+
+
+  /*
+   *  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 );
+
+
+#if 0
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_SqrtFixed                                                       */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Computes the square root of a 16.16 fixed-point value.             */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    x :: The value to compute the root for.                            */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    The result of `sqrt(x)'.                                           */
+  /*                                                                       */
+  /* <Note>                                                                */
+  /*    This function is not very fast.                                    */
+  /*                                                                       */
+  FT_BASE( FT_Int32 )
+  FT_SqrtFixed( FT_Int32  x );
+
+#endif /* 0 */
+
+
 #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 )
similarity index 93%
rename from include/freetype/internal/ftdebug.h
rename to include/internal/ftdebug.h
index 7baae35..58a3916 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -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 )
 
+#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 )
 
+#define FT_THROW( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )
+
 #endif /* !FT_DEBUG_LEVEL_ERROR */
 
 
@@ -226,22 +235,18 @@ FT_BEGIN_HEADER
   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 );
 
-
-#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__ */
similarity index 54%
rename from include/freetype/internal/ftdriver.h
rename to include/internal/ftdriver.h
index 6f6b206..940218e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType font driver interface (specification).                      */
 /*                                                                         */
-/*  Copyright 1996-2003, 2006, 2008, 2011 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,       */
@@ -60,22 +60,6 @@ FT_BEGIN_HEADER
   (*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,
@@ -181,72 +165,42 @@ FT_BEGIN_HEADER
   /*                                                                       */
   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 */
-    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;
 
 
-  /*
-   *  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>                                                         */
-  /*    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                                                   */
@@ -254,160 +208,194 @@ FT_BEGIN_HEADER
   /* <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     */
-  /*    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.                */
+  /*    `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        */
-  /*    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
 
-#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                  \
   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_                                                             \
+#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                                                                       \
-  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;                                                        \
+#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;                                            \
   }
 
 
similarity index 88%
rename from include/freetype/internal/ftgloadr.h
rename to include/internal/ftgloadr.h
index ce4dc6c..f70774f 100644 (file)
@@ -121,20 +121,22 @@ FT_BEGIN_HEADER
                               FT_UInt         n_contours );
 
 
-#define FT_GLYPHLOADER_CHECK_P( _loader, _count )                         \
-   ( (_count) == 0 || ((_loader)->base.outline.n_points    +              \
-                       (_loader)->current.outline.n_points +              \
-                       (unsigned long)(_count)) <= (_loader)->max_points )
-
-#define FT_GLYPHLOADER_CHECK_C( _loader, _count )                          \
-  ( (_count) == 0 || ((_loader)->base.outline.n_contours    +              \
-                      (_loader)->current.outline.n_contours +              \
-                      (unsigned long)(_count)) <= (_loader)->max_contours )
-
-#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours )      \
-  ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points )   &&                  \
-      FT_GLYPHLOADER_CHECK_C( _loader, _contours ) )                   \
-    ? 0                                                                \
+#define FT_GLYPHLOADER_CHECK_P( _loader, _count )           \
+  ( (_count) == 0                                        || \
+    ( (_loader)->base.outline.n_points    +                 \
+      (_loader)->current.outline.n_points +                 \
+      (unsigned long)(_count) ) <= (_loader)->max_points )
+
+#define FT_GLYPHLOADER_CHECK_C( _loader, _count )            \
+  ( (_count) == 0                                         || \
+    ( (_loader)->base.outline.n_contours    +                \
+      (_loader)->current.outline.n_contours +                \
+      (unsigned long)(_count)) <= (_loader)->max_contours )
+
+#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points, _contours )      \
+  ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points )   &&                   \
+      FT_GLYPHLOADER_CHECK_C( _loader, _contours ) )                    \
+    ? 0                                                                 \
     : FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )
 
 
similarity index 71%
rename from include/freetype/internal/ftmemory.h
rename to include/internal/ftmemory.h
index 026aa63..3d51aee 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -141,8 +141,10 @@ FT_BEGIN_HEADER
                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                  \
@@ -154,45 +156,60 @@ FT_BEGIN_HEADER
           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_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 )
@@ -236,26 +253,37 @@ FT_BEGIN_HEADER
   /* _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 ) )
@@ -303,37 +331,6 @@ FT_BEGIN_HEADER
           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,
@@ -345,6 +342,7 @@ FT_BEGIN_HEADER
               FT_ULong     size,
               FT_Error    *p_error );
 
+
 #define FT_MEM_STRDUP( dst, str )                                            \
           (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )
 
similarity index 72%
rename from include/freetype/internal/ftobjs.h
rename to include/internal/ftobjs.h
index fc18275..b45a5ed 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType private base classes (specification).                   */
 /*                                                                         */
-/*  Copyright 1996-2006, 2008, 2010, 2012 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,       */
@@ -72,6 +72,16 @@ FT_BEGIN_HEADER
 
 #define FT_ABS( a )     ( (a) < 0 ? -(a) : (a) )
 
+  /*
+   *  Approximate sqrt(x*x+y*y) using the `alpha max plus beta min'
+   *  algorithm.  We use alpha = 1, beta = 3/8, giving us results with a
+   *  largest error less than 7% compared to the exact value.
+   */
+#define FT_HYPOT( x, y )                 \
+          ( x = FT_ABS( x ),             \
+            y = FT_ABS( y ),             \
+            x > y ? x + ( 3 * y >> 3 )   \
+                  : y + ( 3 * x >> 3 ) )
 
 #define FT_PAD_FLOOR( x, n )  ( (x) & ~((n)-1) )
 #define FT_PAD_ROUND( x, n )  FT_PAD_FLOOR( (x) + ((n)/2), n )
@@ -83,14 +93,6 @@ FT_BEGIN_HEADER
 
 
   /*
-   *  Return the highest power of 2 that is <= value; this correspond to
-   *  the highest bit in a given 32-bit value.
-   */
-  FT_BASE( FT_UInt32 )
-  ft_highpow2( FT_UInt32  value );
-
-
-  /*
    *  character classification functions -- since these are used to parse
    *  font files, we must not use those in <ctypes.h> which are
    *  locale-dependent
@@ -206,46 +208,79 @@ FT_BEGIN_HEADER
 
   } FT_CMap_ClassRec;
 
+
 #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 */
 
-#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 */
 
+
   /* create a new charmap and add it to charmap->face */
   FT_BASE( FT_Error )
   FT_CMap_New( FT_CMap_Class  clazz,
@@ -270,13 +305,13 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <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 ::                                                    */
-  /*      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.                   */
@@ -319,10 +354,6 @@ FT_BEGIN_HEADER
   /*                                                                       */
   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;
@@ -334,7 +365,7 @@ FT_BEGIN_HEADER
 #endif
 
     FT_Bool             ignore_unpatented_hinter;
-    FT_UInt             refcount;
+    FT_Int              refcount;
 
   } FT_Face_InternalRec;
 
@@ -411,6 +442,7 @@ FT_BEGIN_HEADER
 
   /*************************************************************************/
   /*************************************************************************/
+  /*************************************************************************/
   /****                                                                 ****/
   /****                                                                 ****/
   /****                         M O D U L E S                           ****/
@@ -503,7 +535,7 @@ FT_BEGIN_HEADER
   ft_module_get_service( FT_Module    module,
                          const char*  service_id );
 
- /* */
 /* */
 
 
   /*************************************************************************/
@@ -511,7 +543,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  ****/
   /****                                                                 ****/
   /****                                                                 ****/
   /*************************************************************************/
@@ -853,7 +885,7 @@ FT_BEGIN_HEADER
     FT_PIC_Container   pic_container;
 #endif
 
-    FT_UInt            refcount;
+    FT_Int             refcount;
 
   } FT_LibraryRec;
 
@@ -926,12 +958,13 @@ FT_BEGIN_HEADER
   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                      ****/
   /****                                                                 ****/
   /****                                                                 ****/
   /*************************************************************************/
@@ -939,6 +972,9 @@ FT_BEGIN_HEADER
   /*************************************************************************/
 
 
+  /* PIC support macros for ftimage.h */
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Macro>                                                               */
@@ -947,38 +983,57 @@ 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  */
-  /*    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
 
-#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 */
 
-#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 */
 
+
   /*************************************************************************/
   /*                                                                       */
   /* <Macro>                                                               */
@@ -987,51 +1042,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  */
-  /*    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
 
-#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 */
 
-#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 */
 
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /****                                                                 ****/
-  /****              PIC-Support Macros for ftrender.h                  ****/
-  /****                                                                 ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
 
+  /* PIC support macros for ftrender.h */
 
 
   /*************************************************************************/
@@ -1042,40 +1102,64 @@ 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  */
-  /*    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
 
-#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 */
 
-#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 */
 
+
   /*************************************************************************/
   /*                                                                       */
   /* <Macro>                                                               */
@@ -1083,7 +1167,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    Used to create a forward declaration of a                          */
-  /*    FT_Renderer_Class stract instance.                                 */
+  /*    FT_Renderer_Class struct instance.                                 */
   /*                                                                       */
   /* <Macro>                                                               */
   /*    FT_DEFINE_RENDERER                                                 */
@@ -1091,22 +1175,23 @@ FT_BEGIN_HEADER
   /* <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        */
-  /*    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     */
-  /*    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 renderer  */
-  /*    definition calling FT_DEFINE_RENDERER() in following.              */
+  /*    `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        */
@@ -1114,99 +1199,130 @@ FT_BEGIN_HEADER
   /*                                                                       */
 #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                                                                       \
-  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;                                                        \
+#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                  ****/
-  /****                                                                 ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
+
+  /* PIC support macros for ftmodapi.h **/
 
 
 #ifdef FT_CONFIG_OPTION_PIC
@@ -1247,6 +1363,7 @@ FT_BEGIN_HEADER
 
 #endif
 
+
   /*************************************************************************/
   /*                                                                       */
   /* <Macro>                                                               */
@@ -1254,30 +1371,31 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    Used to create a forward declaration of a                          */
-  /*    FT_Module_Class stract instance.                                   */
+  /*    FT_Module_Class struct instance.                                   */
   /*                                                                       */
   /* <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        */
-  /*    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     */
-  /*    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 module    */
-  /*    definition calling FT_DEFINE_MODULE() in following.                */
+  /*    `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        */
@@ -1287,119 +1405,159 @@ FT_BEGIN_HEADER
   /*    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
 
-#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 */
 
-#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;                                                 \
-    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 */
similarity index 80%
rename from include/freetype/internal/ftpic.h
rename to include/internal/ftpic.h
index 5b674e6..485ce7a 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -31,29 +31,33 @@ FT_BEGIN_HEADER
 
 #ifdef FT_CONFIG_OPTION_PIC
 
-  typedef struct FT_PIC_Container_
+  typedef struct  FT_PIC_Container_
   {
     /* pic containers for base */
-    void* base;
+    void*  base;
+
     /* 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;
 
-  /* 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_pic_container_init( FT_Library library );
+  ft_pic_container_init( FT_Library  library );
 
 
   /* 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 */
 
similarity index 89%
rename from include/freetype/internal/ftrfork.h
rename to include/internal/ftrfork.h
index 77e1020..d750cbe 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Embedded resource forks accessor (specification).                    */
 /*                                                                         */
-/*  Copyright 2004, 2006, 2007 by                                          */
+/*  Copyright 2004, 2006, 2007, 2012, 2013 by                              */
 /*  Masatake YAMATO and Redhat K.K.                                        */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -80,26 +80,37 @@ FT_BEGIN_HEADER
   } 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 };
+#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 }
+#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type )  \
+          void                                         \
+          FT_Init_Table_ ## 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 */
 
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -213,6 +224,13 @@ FT_BEGIN_HEADER
   /*    tag ::                                                             */
   /*      The resource tag.                                                */
   /*                                                                       */
+  /*    sort_by_res_id ::                                                  */
+  /*      A Boolean to sort the fragmented resource by their ids.          */
+  /*      The fragmented resources for `POST' resource should be sorted    */
+  /*      to restore Type1 font properly.  For `snft' resources, sorting   */
+  /*      may induce a different order of the faces in comparison to that  */
+  /*      by QuickDraw API.                                                */
+  /*                                                                       */
   /* <Output>                                                              */
   /*    offsets ::                                                         */
   /*      The stream offsets for the resource data specified by `tag'.     */
@@ -235,6 +253,7 @@ FT_BEGIN_HEADER
                               FT_Long     map_offset,
                               FT_Long     rdata_pos,
                               FT_Long     tag,
+                              FT_Bool     sort_by_res_id,
                               FT_Long   **offsets,
                               FT_Long    *count );
 
similarity index 82%
rename from include/freetype/internal/ftserv.h
rename to include/internal/ftserv.h
index 4f481db..1203ec8 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType services (specification only).                          */
 /*                                                                         */
-/*  Copyright 2003-2007, 2009, 2012 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,       */
 
 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
@@ -92,6 +84,7 @@ FT_BEGIN_HEADER
 
 #endif /* !C++ */
 
+
   /*
    * @macro:
    *   FT_FACE_FIND_GLOBAL_SERVICE
@@ -167,7 +160,13 @@ FT_BEGIN_HEADER
   /*************************************************************************/
   /*                                                                       */
   /* <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>                                                         */
   /*    Used to initialize an array of FT_ServiceDescRec structures.       */
@@ -264,6 +263,26 @@ FT_BEGIN_HEADER
     { 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_,                                  \
@@ -283,7 +302,7 @@ FT_BEGIN_HEADER
   FT_Create_Class_ ## class_( FT_Library           library,                 \
                               FT_ServiceDescRec**  output_class )           \
   {                                                                         \
-    FT_ServiceDescRec*  clazz;                                              \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
     FT_Error            error;                                              \
     FT_Memory           memory = library->memory;                           \
                                                                             \
@@ -319,7 +338,7 @@ FT_BEGIN_HEADER
   FT_Create_Class_ ## class_( FT_Library           library,                 \
                               FT_ServiceDescRec**  output_class )           \
   {                                                                         \
-    FT_ServiceDescRec*  clazz;                                              \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
     FT_Error            error;                                              \
     FT_Memory           memory = library->memory;                           \
                                                                             \
@@ -358,7 +377,7 @@ FT_BEGIN_HEADER
   FT_Create_Class_ ## class_( FT_Library           library,                 \
                               FT_ServiceDescRec**  output_class )           \
   {                                                                         \
-    FT_ServiceDescRec*  clazz;                                              \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
     FT_Error            error;                                              \
     FT_Memory           memory = library->memory;                           \
                                                                             \
@@ -400,7 +419,7 @@ FT_BEGIN_HEADER
   FT_Create_Class_ ## class_( FT_Library           library,                 \
                               FT_ServiceDescRec**  output_class )           \
   {                                                                         \
-    FT_ServiceDescRec*  clazz;                                              \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
     FT_Error            error;                                              \
     FT_Memory           memory = library->memory;                           \
                                                                             \
@@ -445,7 +464,7 @@ FT_BEGIN_HEADER
   FT_Create_Class_ ## class_( FT_Library           library,                 \
                               FT_ServiceDescRec**  output_class )           \
   {                                                                         \
-    FT_ServiceDescRec*  clazz;                                              \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
     FT_Error            error;                                              \
     FT_Memory           memory = library->memory;                           \
                                                                             \
@@ -493,7 +512,7 @@ FT_BEGIN_HEADER
   FT_Create_Class_ ## class_( FT_Library           library,                 \
                               FT_ServiceDescRec**  output_class)            \
   {                                                                         \
-    FT_ServiceDescRec*  clazz;                                              \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
     FT_Error            error;                                              \
     FT_Memory           memory = library->memory;                           \
                                                                             \
@@ -521,6 +540,59 @@ FT_BEGIN_HEADER
     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 */
 
 
@@ -573,7 +645,9 @@ FT_BEGIN_HEADER
   /*
    *  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)
 
 
   /*
@@ -660,23 +734,24 @@ FT_BEGIN_HEADER
    *  The header files containing the services.
    */
 
-#define FT_SERVICE_BDF_H                <freetype/internal/services/svbdf.h>
-#define FT_SERVICE_CID_H                <freetype/internal/services/svcid.h>
-#define FT_SERVICE_GLYPH_DICT_H         <freetype/internal/services/svgldict.h>
-#define FT_SERVICE_GX_VALIDATE_H        <freetype/internal/services/svgxval.h>
-#define FT_SERVICE_KERNING_H            <freetype/internal/services/svkern.h>
-#define FT_SERVICE_MULTIPLE_MASTERS_H   <freetype/internal/services/svmm.h>
-#define FT_SERVICE_OPENTYPE_VALIDATE_H  <freetype/internal/services/svotval.h>
-#define FT_SERVICE_PFR_H                <freetype/internal/services/svpfr.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_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_WINFNT_H             <freetype/internal/services/svwinfnt.h>
-#define FT_SERVICE_XFREE86_NAME_H       <freetype/internal/services/svxf86nm.h>
-#define FT_SERVICE_TRUETYPE_GLYF_H      <freetype/internal/services/svttglyf.h>
+#define FT_SERVICE_BDF_H                <internal/services/svbdf.h>
+#define FT_SERVICE_CID_H                <internal/services/svcid.h>
+#define FT_SERVICE_GLYPH_DICT_H         <internal/services/svgldict.h>
+#define FT_SERVICE_GX_VALIDATE_H        <internal/services/svgxval.h>
+#define FT_SERVICE_KERNING_H            <internal/services/svkern.h>
+#define FT_SERVICE_MULTIPLE_MASTERS_H   <internal/services/svmm.h>
+#define FT_SERVICE_OPENTYPE_VALIDATE_H  <internal/services/svotval.h>
+#define FT_SERVICE_PFR_H                <internal/services/svpfr.h>
+#define FT_SERVICE_POSTSCRIPT_CMAPS_H   <internal/services/svpscmap.h>
+#define FT_SERVICE_POSTSCRIPT_INFO_H    <internal/services/svpsinfo.h>
+#define FT_SERVICE_POSTSCRIPT_NAME_H    <internal/services/svpostnm.h>
+#define FT_SERVICE_PROPERTIES_H         <internal/services/svprop.h>
+#define FT_SERVICE_SFNT_H               <internal/services/svsfnt.h>
+#define FT_SERVICE_TRUETYPE_ENGINE_H    <internal/services/svtteng.h>
+#define FT_SERVICE_TT_CMAP_H            <internal/services/svttcmap.h>
+#define FT_SERVICE_WINFNT_H             <internal/services/svwinfnt.h>
+#define FT_SERVICE_XFREE86_NAME_H       <internal/services/svxf86nm.h>
+#define FT_SERVICE_TRUETYPE_GLYF_H      <internal/services/svttglyf.h>
 
  /* */
 
similarity index 88%
rename from include/freetype/internal/ftstream.h
rename to include/internal/ftstream.h
index 8b18500..2661858 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Stream handling (specification).                                     */
 /*                                                                         */
-/*  Copyright 1996-2002, 2004-2006, 2011 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,       */
@@ -154,67 +154,60 @@ FT_BEGIN_HEADER
   /*                                                                       */
 
 #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_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_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_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_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_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_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_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_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 ) | \
@@ -493,37 +486,41 @@ FT_BEGIN_HEADER
 #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_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_ExtractFrame( stream, size,             \
+            FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream,                   \
+                                                    (FT_ULong)(size),         \
                                                     (FT_Byte**)&(bytes) ) ) )
 
 #define FT_FRAME_RELEASE( bytes )                                         \
similarity index 94%
rename from include/freetype/internal/fttrace.h
rename to include/internal/fttrace.h
index fbefdbd..d5253db 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Tracing handling (specification only).                               */
 /*                                                                         */
-/*  Copyright 2002, 2004-2007, 2009, 2011 by                               */
+/*  Copyright 2002, 2004-2007, 2009, 2011-2014 by                          */
 /*  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( bitmap )    /* bitmap checksum         (ftobjs.c)   */
 
   /* 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 )
+FT_TRACE_DEF( psconv )
 
   /* 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( cf2blues )
+FT_TRACE_DEF( cf2hints )
+FT_TRACE_DEF( cf2interp )
+
   /* Type 42 driver component */
 FT_TRACE_DEF( t42 )
 
@@ -136,9 +142,13 @@ 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 )
+FT_TRACE_DEF( afharfbuzz )
+FT_TRACE_DEF( afglobal )
 
 /* END */
similarity index 88%
rename from include/freetype/internal/ftvalid.h
rename to include/internal/ftvalid.h
index 00cd85e..c281b14 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType validation support (specification).                         */
 /*                                                                         */
-/*  Copyright 2004 by                                                      */
+/*  Copyright 2004, 2013, 2014 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -76,20 +76,31 @@ FT_BEGIN_HEADER
   } 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_
   {
+    ft_jmp_buf          jump_buffer; /* used for exception handling      */
+
     const FT_Byte*      base;        /* address of table in memory       */
     const FT_Byte*      limit;       /* `base' + sizeof(table) in memory */
     FT_ValidationLevel  level;       /* validation level                 */
     FT_Error            error;       /* error returned. 0 means success  */
 
-    ft_jmp_buf          jump_buffer; /* used for exception handling      */
-
   } 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 )
@@ -115,31 +126,29 @@ FT_BEGIN_HEADER
   /* Calls ft_validate_error.  Assumes that the `valid' local variable */
   /* holds a pointer to the current validator object.                  */
   /*                                                                   */
-  /* Use preprocessor prescan to pass FT_ERR_PREFIX.                   */
-  /*                                                                   */
-#define FT_INVALID( _prefix, _error )  FT_INVALID_( _prefix, _error )
-#define FT_INVALID_( _prefix, _error ) \
-          ft_validator_error( valid, _prefix ## _error )
+#define FT_INVALID( _error )  FT_INVALID_( _error )
+#define FT_INVALID_( _error ) \
+          ft_validator_error( valid, FT_THROW( _error ) )
 
   /* called when a broken table is detected */
 #define FT_INVALID_TOO_SHORT \
-          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
+          FT_INVALID( Invalid_Table )
 
   /* called when an invalid offset is detected */
 #define FT_INVALID_OFFSET \
-          FT_INVALID( FT_ERR_PREFIX, Invalid_Offset )
+          FT_INVALID( Invalid_Offset )
 
   /* called when an invalid format/value is detected */
 #define FT_INVALID_FORMAT \
-          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
+          FT_INVALID( Invalid_Table )
 
   /* called when an invalid glyph index is detected */
 #define FT_INVALID_GLYPH_ID \
-          FT_INVALID( FT_ERR_PREFIX, Invalid_Glyph_Index )
+          FT_INVALID( Invalid_Glyph_Index )
 
   /* called when an invalid field value is detected */
 #define FT_INVALID_DATA \
-          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
+          FT_INVALID( Invalid_Table )
 
 
 FT_END_HEADER
diff --git a/include/internal/internal.h b/include/internal/internal.h
new file mode 100644 (file)
index 0000000..e0ddb06
--- /dev/null
@@ -0,0 +1,63 @@
+/***************************************************************************/
+/*                                                                         */
+/*  internal.h                                                             */
+/*                                                                         */
+/*    Internal header files (specification only).                          */
+/*                                                                         */
+/*  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,       */
+/*  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 automatically included by `ft2build.h'.                  */
+  /* Do not include it manually!                                           */
+  /*                                                                       */
+  /*************************************************************************/
+
+
+#define FT_INTERNAL_OBJECTS_H             <internal/ftobjs.h>
+#define FT_INTERNAL_PIC_H                 <internal/ftpic.h>
+#define FT_INTERNAL_STREAM_H              <internal/ftstream.h>
+#define FT_INTERNAL_MEMORY_H              <internal/ftmemory.h>
+#define FT_INTERNAL_DEBUG_H               <internal/ftdebug.h>
+#define FT_INTERNAL_CALC_H                <internal/ftcalc.h>
+#define FT_INTERNAL_DRIVER_H              <internal/ftdriver.h>
+#define FT_INTERNAL_TRACE_H               <internal/fttrace.h>
+#define FT_INTERNAL_GLYPH_LOADER_H        <internal/ftgloadr.h>
+#define FT_INTERNAL_SFNT_H                <internal/sfnt.h>
+#define FT_INTERNAL_SERVICE_H             <internal/ftserv.h>
+#define FT_INTERNAL_RFORK_H               <internal/ftrfork.h>
+#define FT_INTERNAL_VALIDATE_H            <internal/ftvalid.h>
+
+#define FT_INTERNAL_TRUETYPE_TYPES_H      <internal/tttypes.h>
+#define FT_INTERNAL_TYPE1_TYPES_H         <internal/t1types.h>
+
+#define FT_INTERNAL_POSTSCRIPT_AUX_H      <internal/psaux.h>
+#define FT_INTERNAL_POSTSCRIPT_HINTS_H    <internal/pshints.h>
+#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H  <internal/psglobal.h>
+
+#define FT_INTERNAL_AUTOHINT_H            <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 */
similarity index 98%
rename from include/freetype/internal/psaux.h
rename to include/internal/psaux.h
index a96e0df..e903114 100644 (file)
@@ -5,7 +5,7 @@
 /*    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,       */
@@ -101,6 +101,9 @@ FT_BEGIN_HEADER
   /*    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.              */
@@ -183,6 +186,7 @@ FT_BEGIN_HEADER
     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,
@@ -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         */
-    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 */
@@ -531,7 +535,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    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).   */
   /*                                                                       */
similarity index 93%
rename from include/freetype/internal/pshints.h
rename to include/internal/pshints.h
index 5b7b698..f05ea68 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.           */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2009 by                  */
+/*  Copyright 2001-2003, 2005-2007, 2009, 2012, 2014 by                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -45,7 +45,7 @@ FT_BEGIN_HEADER
                           T1_Private*   private_dict,
                           PSH_Globals*  aglobals );
 
-  typedef FT_Error
+  typedef void
   (*PSH_Globals_SetScaleFunc)( PSH_Globals  globals,
                                FT_Fixed     x_scale,
                                FT_Fixed     y_scale,
@@ -679,27 +679,37 @@ FT_BEGIN_HEADER
 
   typedef PSHinter_Interface*  PSHinter_Service;
 
+
 #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_;                                     \
+#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 */
diff --git a/include/internal/services/svprop.h b/include/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 */
similarity index 97%
rename from include/freetype/internal/services/svttcmap.h
rename to include/internal/services/svttcmap.h
index 83994aa..4370f4c 100644 (file)
@@ -7,7 +7,7 @@
 /*  Copyright 2003 by                                                      */
 /*  Masatake YAMATO, Redhat K.K.                                           */
 /*                                                                         */
-/*  Copyright 2003, 2008, 2009, 2012 by                                    */
+/*  Copyright 2003, 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,       */
@@ -47,7 +47,7 @@ FT_BEGIN_HEADER
   /* <Fields>                                                              */
   /*    language ::                                                        */
   /*      The language ID used in Mac fonts.  Definitions of values are in */
-  /*      freetype/ttnameid.h.                                             */
+  /*      `ttnameid.h'.                                                    */
   /*                                                                       */
   /*    format ::                                                          */
   /*      The cmap format.  OpenType 1.5 defines the formats 0 (byte       */
similarity index 66%
rename from include/freetype/internal/sfnt.h
rename to include/internal/sfnt.h
index 905ca8c..d558e86 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    High-level `sfnt' driver interface (specification).                  */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */
+/*  Copyright 1996-2006, 2009, 2012-2014 by                                */
 /*  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 );
 
 
-#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>                                                            */
@@ -363,88 +292,6 @@ FT_BEGIN_HEADER
                               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>                                                            */
@@ -558,14 +405,18 @@ FT_BEGIN_HEADER
   /* <Input>                                                               */
   /*    face     :: A handle to the target face object.                    */
   /*                                                                       */
-  /*    stream   :: The input stream.                                      */
-  /*                                                                       */
   /*    vertical :: A boolean flag.  If set, load vertical metrics.        */
   /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
+  /*    gindex   :: The glyph index.                                       */
   /*                                                                       */
-  typedef FT_Error
+  /* <Output>                                                              */
+  /*    abearing :: The horizontal (or vertical) bearing.  Set to zero in  */
+  /*                case of error.                                         */
+  /*                                                                       */
+  /*    aadvance :: The horizontal (or vertical) advance.  Set to zero in  */
+  /*                case of error.                                         */
+  /*                                                                       */
+  typedef void
   (*TT_Get_Metrics_Func)( TT_Face     face,
                           FT_Bool     vertical,
                           FT_UInt     gindex,
@@ -657,11 +508,6 @@ FT_BEGIN_HEADER
 
     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;
@@ -674,12 +520,6 @@ FT_BEGIN_HEADER
     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;
 
@@ -690,43 +530,12 @@ FT_BEGIN_HEADER
     /* 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;
 
-#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;
 
-#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' */
@@ -755,136 +564,141 @@ FT_BEGIN_HEADER
 
 #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_) \
+#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 */
similarity index 98%
rename from include/freetype/internal/t1types.h
rename to include/internal/t1types.h
index f859de2..e20237c 100644 (file)
@@ -5,7 +5,7 @@
 /*    Basic Type1/Type2 type definitions and interface (specification      */
 /*    only).                                                               */
 /*                                                                         */
-/*  Copyright 1996-2004, 2006, 2008, 2009, 2011 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,       */
@@ -205,10 +205,6 @@ FT_BEGIN_HEADER
     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;
 
similarity index 94%
rename from include/freetype/internal/tttypes.h
rename to include/internal/tttypes.h
index 57b1731..ad302b8 100644 (file)
@@ -5,7 +5,7 @@
 /*    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,       */
@@ -140,6 +140,75 @@ FT_BEGIN_HEADER
   /*************************************************************************/
   /*                                                                       */
   /* <Struct>                                                              */
+  /*    WOFF_HeaderRec                                                     */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    WOFF file format header.                                           */
+  /*                                                                       */
+  /* <Fields>                                                              */
+  /*    See                                                                */
+  /*                                                                       */
+  /*      http://www.w3.org/TR/WOFF/#WOFFHeader                            */
+  /*                                                                       */
+  typedef struct  WOFF_HeaderRec_
+  {
+    FT_ULong   signature;
+    FT_ULong   flavor;
+    FT_ULong   length;
+    FT_UShort  num_tables;
+    FT_UShort  reserved;
+    FT_ULong   totalSfntSize;
+    FT_UShort  majorVersion;
+    FT_UShort  minorVersion;
+    FT_ULong   metaOffset;
+    FT_ULong   metaLength;
+    FT_ULong   metaOrigLength;
+    FT_ULong   privOffset;
+    FT_ULong   privLength;
+
+  } WOFF_HeaderRec, *WOFF_Header;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
+  /*    WOFF_TableRec                                                      */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    This structure describes a given table of a WOFF font.             */
+  /*                                                                       */
+  /* <Fields>                                                              */
+  /*    Tag        :: A four-bytes tag describing the table.               */
+  /*                                                                       */
+  /*    Offset     :: The offset of the table from the start of the WOFF   */
+  /*                  font in its resource.                                */
+  /*                                                                       */
+  /*    CompLength :: Compressed table length (in bytes).                  */
+  /*                                                                       */
+  /*    OrigLength :: Unompressed table length (in bytes).                 */
+  /*                                                                       */
+  /*    CheckSum   :: The table checksum.  This value can be ignored.      */
+  /*                                                                       */
+  /*    OrigOffset :: The uncompressed table file offset.  This value gets */
+  /*                  computed while constructing the (uncompressed) SFNT  */
+  /*                  header.  It is not contained in the WOFF file.       */
+  /*                                                                       */
+  typedef struct  WOFF_TableRec_
+  {
+    FT_ULong  Tag;           /* table ID                  */
+    FT_ULong  Offset;        /* table file offset         */
+    FT_ULong  CompLength;    /* compressed table length   */
+    FT_ULong  OrigLength;    /* uncompressed table length */
+    FT_ULong  CheckSum;      /* uncompressed checksum     */
+
+    FT_ULong  OrigOffset;    /* uncompressed table file offset */
+                             /* (not in the WOFF file)         */
+  } WOFF_TableRec, *WOFF_Table;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
   /*    TT_LongMetricsRec                                                  */
   /*                                                                       */
   /* <Description>                                                         */
@@ -311,87 +380,6 @@ FT_BEGIN_HEADER
   } 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 */
-
-
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
@@ -434,16 +422,16 @@ FT_BEGIN_HEADER
   /*                                                                       */
   typedef struct  TT_SBit_MetricsRec_
   {
-    FT_Byte  height;
-    FT_Byte  width;
+    FT_UShort  height;
+    FT_UShort  width;
 
-    FT_Char  horiBearingX;
-    FT_Char  horiBearingY;
-    FT_Byte  horiAdvance;
+    FT_Short   horiBearingX;
+    FT_Short   horiBearingY;
+    FT_UShort  horiAdvance;
 
-    FT_Char  vertBearingX;
-    FT_Char  vertBearingY;
-    FT_Byte  vertAdvance;
+    FT_Short   vertBearingX;
+    FT_Short   vertBearingY;
+    FT_UShort  vertAdvance;
 
   } TT_SBit_MetricsRec, *TT_SBit_Metrics;
 
@@ -1060,6 +1048,20 @@ FT_BEGIN_HEADER
   (*TT_Loader_EndGlyphFunc)( TT_Loader  loader );
 
 
+  typedef enum TT_SbitTableType_
+  {
+    TT_SBIT_TABLE_TYPE_NONE = 0,
+    TT_SBIT_TABLE_TYPE_EBLC, /* `EBLC' (Microsoft), */
+                             /* `bloc' (Apple)      */
+    TT_SBIT_TABLE_TYPE_CBLC, /* `CBLC' (Google)     */
+    TT_SBIT_TABLE_TYPE_SBIX, /* `sbix' (Apple)      */
+
+    /* do not remove */
+    TT_SBIT_TABLE_TYPE_MAX
+
+  } TT_SbitTableType;
+
+
   /*************************************************************************/
   /*                                                                       */
   /*                         TrueType Face Type                            */
@@ -1171,13 +1173,6 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    pclt                 :: The `pclt' SFNT table.                     */
   /*                                                                       */
-  /*    num_sbit_strikes     :: The number of sbit strikes, i.e., bitmap   */
-  /*                            sizes, embedded in this font.              */
-  /*                                                                       */
-  /*    sbit_strikes         :: An array of sbit strikes embedded in this  */
-  /*                            font.  This table is optional in a         */
-  /*                            TrueType/OpenType font.                    */
-  /*                                                                       */
   /*    num_sbit_scales      :: The number of sbit scales for this font.   */
   /*                                                                       */
   /*    sbit_scales          :: Array of sbit scales embedded in this      */
@@ -1269,9 +1264,6 @@ FT_BEGIN_HEADER
     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 */
@@ -1308,11 +1300,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 */
 
@@ -1320,11 +1307,6 @@ FT_BEGIN_HEADER
     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;
 
@@ -1338,12 +1320,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;
@@ -1356,13 +1332,6 @@ FT_BEGIN_HEADER
     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;
@@ -1383,11 +1352,8 @@ FT_BEGIN_HEADER
 
     const char*           postscript_name;
 
-    /* since version 2.1.8, but was originally placed after */
-    /* `glyph_locations_stub'                               */
     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;
@@ -1412,6 +1378,7 @@ FT_BEGIN_HEADER
 
     FT_Byte*              sbit_table;
     FT_ULong              sbit_table_size;
+    TT_SbitTableType      sbit_table_type;
     FT_UInt               sbit_num_strikes;
 
     FT_Byte*              kern_table;
@@ -1428,6 +1395,13 @@ FT_BEGIN_HEADER
     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;
 
 
@@ -1443,7 +1417,7 @@ FT_BEGIN_HEADER
   /*  <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.           */
   /*                                                                       */
@@ -1505,7 +1479,6 @@ FT_BEGIN_HEADER
     FT_Int           advance;
     FT_Int           linear;
     FT_Bool          linear_def;
-    FT_Bool          preserve_pps;
     FT_Vector        pp1;
     FT_Vector        pp2;
 
similarity index 76%
rename from include/freetype/t1tables.h
rename to include/t1tables.h
index a14255e..61aefdd 100644 (file)
@@ -5,7 +5,7 @@
 /*    Basic Type 1/Type 2 tables definitions and interface (specification  */
 /*    only).                                                               */
 /*                                                                         */
-/*  Copyright 1996-2004, 2006, 2008, 2009, 2011 by                         */
+/*  Copyright 1996-2004, 2006, 2008, 2009, 2011, 2014 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -49,6 +49,26 @@ FT_BEGIN_HEADER
   /*    This section contains the definition of Type 1-specific tables,    */
   /*    including structures related to other PostScript font formats.     */
   /*                                                                       */
+  /* <Order>                                                               */
+  /*    PS_FontInfoRec                                                     */
+  /*    PS_FontInfo                                                        */
+  /*    PS_PrivateRec                                                      */
+  /*    PS_Private                                                         */
+  /*                                                                       */
+  /*    CID_FaceDictRec                                                    */
+  /*    CID_FaceDict                                                       */
+  /*    CID_FaceInfoRec                                                    */
+  /*    CID_FaceInfo                                                       */
+  /*                                                                       */
+  /*    FT_Has_PS_Glyph_Names                                              */
+  /*    FT_Get_PS_Font_Info                                                */
+  /*    FT_Get_PS_Font_Private                                             */
+  /*    FT_Get_PS_Font_Value                                               */
+  /*                                                                       */
+  /*    T1_Blend_Flags                                                     */
+  /*    T1_EncodingType                                                    */
+  /*    PS_Dict_Keys                                                       */
+  /*                                                                       */
   /*************************************************************************/
 
 
@@ -190,14 +210,30 @@ FT_BEGIN_HEADER
   /*    given blend dictionary (font info or private).  Used to support    */
   /*    Multiple Masters fonts.                                            */
   /*                                                                       */
+  /* <Values>                                                              */
+  /*    T1_BLEND_UNDERLINE_POSITION ::                                     */
+  /*    T1_BLEND_UNDERLINE_THICKNESS ::                                    */
+  /*    T1_BLEND_ITALIC_ANGLE ::                                           */
+  /*    T1_BLEND_BLUE_VALUES ::                                            */
+  /*    T1_BLEND_OTHER_BLUES ::                                            */
+  /*    T1_BLEND_STANDARD_WIDTH ::                                         */
+  /*    T1_BLEND_STANDARD_HEIGHT ::                                        */
+  /*    T1_BLEND_STEM_SNAP_WIDTHS ::                                       */
+  /*    T1_BLEND_STEM_SNAP_HEIGHTS ::                                      */
+  /*    T1_BLEND_BLUE_SCALE ::                                             */
+  /*    T1_BLEND_BLUE_SHIFT ::                                             */
+  /*    T1_BLEND_FAMILY_BLUES ::                                           */
+  /*    T1_BLEND_FAMILY_OTHER_BLUES ::                                     */
+  /*    T1_BLEND_FORCE_BOLD ::                                             */
+  /*                                                                       */
   typedef enum  T1_Blend_Flags_
   {
-    /*# required fields in a FontInfo blend dictionary */
+    /* required fields in a FontInfo blend dictionary */
     T1_BLEND_UNDERLINE_POSITION = 0,
     T1_BLEND_UNDERLINE_THICKNESS,
     T1_BLEND_ITALIC_ANGLE,
 
-    /*# required fields in a Private blend dictionary */
+    /* required fields in a Private blend dictionary */
     T1_BLEND_BLUE_VALUES,
     T1_BLEND_OTHER_BLUES,
     T1_BLEND_STANDARD_WIDTH,
@@ -210,15 +246,13 @@ FT_BEGIN_HEADER
     T1_BLEND_FAMILY_OTHER_BLUES,
     T1_BLEND_FORCE_BOLD,
 
-    /*# never remove */
-    T1_BLEND_MAX
+    T1_BLEND_MAX    /* do not remove */
 
   } T1_Blend_Flags;
 
-  /* */
 
-
-  /*# backwards compatible definitions */
+  /* these constants are deprecated; use the corresponding */
+  /* `T1_Blend_Flags' values instead                       */
 #define t1_blend_underline_position   T1_BLEND_UNDERLINE_POSITION
 #define t1_blend_underline_thickness  T1_BLEND_UNDERLINE_THICKNESS
 #define t1_blend_italic_angle         T1_BLEND_ITALIC_ANGLE
@@ -235,6 +269,8 @@ FT_BEGIN_HEADER
 #define t1_blend_force_bold           T1_BLEND_FORCE_BOLD
 #define t1_blend_max                  T1_BLEND_MAX
 
+  /* */
+
 
   /* maximum number of Multiple Masters designs, as defined in the spec */
 #define T1_MAX_MM_DESIGNS     16
@@ -333,10 +369,17 @@ FT_BEGIN_HEADER
   /*                                                                       */
   typedef struct CID_FaceDictRec_*  CID_FaceDict;
 
-  /* */
-
 
-  /* backwards-compatible definition */
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
+  /*    CID_FontDict                                                       */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    This type is equivalent to @CID_FaceDictRec.  It is deprecated but */
+  /*    kept to maintain source compatibility between various versions of  */
+  /*    FreeType.                                                          */
+  /*                                                                       */
   typedef CID_FaceDictRec  CID_FontDict;
 
 
@@ -503,6 +546,13 @@ FT_BEGIN_HEADER
   /*    An enumeration describing the `Encoding' entry in a Type 1         */
   /*    dictionary.                                                        */
   /*                                                                       */
+  /* <Values>                                                              */
+  /*    T1_ENCODING_TYPE_NONE ::                                           */
+  /*    T1_ENCODING_TYPE_ARRAY ::                                          */
+  /*    T1_ENCODING_TYPE_STANDARD ::                                       */
+  /*    T1_ENCODING_TYPE_ISOLATIN1 ::                                      */
+  /*    T1_ENCODING_TYPE_EXPERT ::                                         */
+  /*                                                                       */
   typedef enum  T1_EncodingType_
   {
     T1_ENCODING_TYPE_NONE = 0,
@@ -523,6 +573,54 @@ FT_BEGIN_HEADER
   /*    An enumeration used in calls to @FT_Get_PS_Font_Value to identify  */
   /*    the Type~1 dictionary entry to retrieve.                           */
   /*                                                                       */
+  /* <Values>                                                              */
+  /*    PS_DICT_FONT_TYPE ::                                               */
+  /*    PS_DICT_FONT_MATRIX ::                                             */
+  /*    PS_DICT_FONT_BBOX ::                                               */
+  /*    PS_DICT_PAINT_TYPE ::                                              */
+  /*    PS_DICT_FONT_NAME ::                                               */
+  /*    PS_DICT_UNIQUE_ID ::                                               */
+  /*    PS_DICT_NUM_CHAR_STRINGS ::                                        */
+  /*    PS_DICT_CHAR_STRING_KEY ::                                         */
+  /*    PS_DICT_CHAR_STRING ::                                             */
+  /*    PS_DICT_ENCODING_TYPE ::                                           */
+  /*    PS_DICT_ENCODING_ENTRY ::                                          */
+  /*    PS_DICT_NUM_SUBRS ::                                               */
+  /*    PS_DICT_SUBR ::                                                    */
+  /*    PS_DICT_STD_HW ::                                                  */
+  /*    PS_DICT_STD_VW ::                                                  */
+  /*    PS_DICT_NUM_BLUE_VALUES ::                                         */
+  /*    PS_DICT_BLUE_VALUE ::                                              */
+  /*    PS_DICT_BLUE_FUZZ ::                                               */
+  /*    PS_DICT_NUM_OTHER_BLUES ::                                         */
+  /*    PS_DICT_OTHER_BLUE ::                                              */
+  /*    PS_DICT_NUM_FAMILY_BLUES ::                                        */
+  /*    PS_DICT_FAMILY_BLUE ::                                             */
+  /*    PS_DICT_NUM_FAMILY_OTHER_BLUES ::                                  */
+  /*    PS_DICT_FAMILY_OTHER_BLUE ::                                       */
+  /*    PS_DICT_BLUE_SCALE ::                                              */
+  /*    PS_DICT_BLUE_SHIFT ::                                              */
+  /*    PS_DICT_NUM_STEM_SNAP_H ::                                         */
+  /*    PS_DICT_STEM_SNAP_H ::                                             */
+  /*    PS_DICT_NUM_STEM_SNAP_V ::                                         */
+  /*    PS_DICT_STEM_SNAP_V ::                                             */
+  /*    PS_DICT_FORCE_BOLD ::                                              */
+  /*    PS_DICT_RND_STEM_UP ::                                             */
+  /*    PS_DICT_MIN_FEATURE ::                                             */
+  /*    PS_DICT_LEN_IV ::                                                  */
+  /*    PS_DICT_PASSWORD ::                                                */
+  /*    PS_DICT_LANGUAGE_GROUP ::                                          */
+  /*    PS_DICT_VERSION ::                                                 */
+  /*    PS_DICT_NOTICE ::                                                  */
+  /*    PS_DICT_FULL_NAME ::                                               */
+  /*    PS_DICT_FAMILY_NAME ::                                             */
+  /*    PS_DICT_WEIGHT ::                                                  */
+  /*    PS_DICT_IS_FIXED_PITCH ::                                          */
+  /*    PS_DICT_UNDERLINE_POSITION ::                                      */
+  /*    PS_DICT_UNDERLINE_THICKNESS ::                                     */
+  /*    PS_DICT_FS_TYPE ::                                                 */
+  /*    PS_DICT_ITALIC_ANGLE ::                                            */
+  /*                                                                       */
   typedef enum  PS_Dict_Keys_
   {
     /* conventionally in the font dictionary */
similarity index 86%
rename from include/freetype/ttnameid.h
rename to include/ttnameid.h
index 66aef04..e65b558 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType name ID definitions (specification only).                   */
 /*                                                                         */
-/*  Copyright 1996-2002, 2003, 2004, 2006, 2007, 2008 by                   */
+/*  Copyright 1996-2004, 2006-2008, 2012-2014 by                           */
 /*  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          */
-  /* 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       */
   /*                                                                       */
-  /*   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
@@ -461,45 +462,34 @@ FT_BEGIN_HEADER
   /* 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          */
   /*                                                                       */
-  /* 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_IRAQ                       0x0801
-#define TT_MS_LANGID_ARABIC_EGYPT                      0x0c01
+#define TT_MS_LANGID_ARABIC_EGYPT                      0x0C01
 #define TT_MS_LANGID_ARABIC_LIBYA                      0x1001
 #define TT_MS_LANGID_ARABIC_ALGERIA                    0x1401
 #define TT_MS_LANGID_ARABIC_MOROCCO                    0x1801
-#define TT_MS_LANGID_ARABIC_TUNISIA                    0x1c01
+#define TT_MS_LANGID_ARABIC_TUNISIA                    0x1C01
 #define TT_MS_LANGID_ARABIC_OMAN                       0x2001
 #define TT_MS_LANGID_ARABIC_YEMEN                      0x2401
 #define TT_MS_LANGID_ARABIC_SYRIA                      0x2801
-#define TT_MS_LANGID_ARABIC_JORDAN                     0x2c01
+#define TT_MS_LANGID_ARABIC_JORDAN                     0x2C01
 #define TT_MS_LANGID_ARABIC_LEBANON                    0x3001
 #define TT_MS_LANGID_ARABIC_KUWAIT                     0x3401
 #define TT_MS_LANGID_ARABIC_UAE                        0x3801
-#define TT_MS_LANGID_ARABIC_BAHRAIN                    0x3c01
+#define TT_MS_LANGID_ARABIC_BAHRAIN                    0x3C01
 #define TT_MS_LANGID_ARABIC_QATAR                      0x4001
 #define TT_MS_LANGID_BULGARIAN_BULGARIA                0x0402
 #define TT_MS_LANGID_CATALAN_SPAIN                     0x0403
 #define TT_MS_LANGID_CHINESE_GENERAL                   0x0004
 #define TT_MS_LANGID_CHINESE_TAIWAN                    0x0404
 #define TT_MS_LANGID_CHINESE_PRC                       0x0804
-#define TT_MS_LANGID_CHINESE_HONG_KONG                 0x0c04
+#define TT_MS_LANGID_CHINESE_HONG_KONG                 0x0C04
 #define TT_MS_LANGID_CHINESE_SINGAPORE                 0x1004
 
 #if 1  /* this looks like the correct value */
@@ -517,7 +507,7 @@ FT_BEGIN_HEADER
 #define TT_MS_LANGID_DANISH_DENMARK                    0x0406
 #define TT_MS_LANGID_GERMAN_GERMANY                    0x0407
 #define TT_MS_LANGID_GERMAN_SWITZERLAND                0x0807
-#define TT_MS_LANGID_GERMAN_AUSTRIA                    0x0c07
+#define TT_MS_LANGID_GERMAN_AUSTRIA                    0x0C07
 #define TT_MS_LANGID_GERMAN_LUXEMBOURG                 0x1007
 #define TT_MS_LANGID_GERMAN_LIECHTENSTEI               0x1407
 #define TT_MS_LANGID_GREEK_GREECE                      0x0408
@@ -530,69 +520,69 @@ FT_BEGIN_HEADER
 #define TT_MS_LANGID_ENGLISH_GENERAL                   0x0009
 #define TT_MS_LANGID_ENGLISH_UNITED_STATES             0x0409
 #define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM            0x0809
-#define TT_MS_LANGID_ENGLISH_AUSTRALIA                 0x0c09
+#define TT_MS_LANGID_ENGLISH_AUSTRALIA                 0x0C09
 #define TT_MS_LANGID_ENGLISH_CANADA                    0x1009
 #define TT_MS_LANGID_ENGLISH_NEW_ZEALAND               0x1409
 #define TT_MS_LANGID_ENGLISH_IRELAND                   0x1809
-#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA              0x1c09
+#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA              0x1C09
 #define TT_MS_LANGID_ENGLISH_JAMAICA                   0x2009
 #define TT_MS_LANGID_ENGLISH_CARIBBEAN                 0x2409
 #define TT_MS_LANGID_ENGLISH_BELIZE                    0x2809
-#define TT_MS_LANGID_ENGLISH_TRINIDAD                  0x2c09
+#define TT_MS_LANGID_ENGLISH_TRINIDAD                  0x2C09
 #define TT_MS_LANGID_ENGLISH_ZIMBABWE                  0x3009
 #define TT_MS_LANGID_ENGLISH_PHILIPPINES               0x3409
 #define TT_MS_LANGID_ENGLISH_INDONESIA                 0x3809
-#define TT_MS_LANGID_ENGLISH_HONG_KONG                 0x3c09
+#define TT_MS_LANGID_ENGLISH_HONG_KONG                 0x3C09
 #define TT_MS_LANGID_ENGLISH_INDIA                     0x4009
 #define TT_MS_LANGID_ENGLISH_MALAYSIA                  0x4409
 #define TT_MS_LANGID_ENGLISH_SINGAPORE                 0x4809
-#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT    0x040a
-#define TT_MS_LANGID_SPANISH_MEXICO                    0x080a
-#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT  0x0c0a
-#define TT_MS_LANGID_SPANISH_GUATEMALA                 0x100a
-#define TT_MS_LANGID_SPANISH_COSTA_RICA                0x140a
-#define TT_MS_LANGID_SPANISH_PANAMA                    0x180a
-#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC        0x1c0a
-#define TT_MS_LANGID_SPANISH_VENEZUELA                 0x200a
-#define TT_MS_LANGID_SPANISH_COLOMBIA                  0x240a
-#define TT_MS_LANGID_SPANISH_PERU                      0x280a
-#define TT_MS_LANGID_SPANISH_ARGENTINA                 0x2c0a
-#define TT_MS_LANGID_SPANISH_ECUADOR                   0x300a
-#define TT_MS_LANGID_SPANISH_CHILE                     0x340a
-#define TT_MS_LANGID_SPANISH_URUGUAY                   0x380a
-#define TT_MS_LANGID_SPANISH_PARAGUAY                  0x3c0a
-#define TT_MS_LANGID_SPANISH_BOLIVIA                   0x400a
-#define TT_MS_LANGID_SPANISH_EL_SALVADOR               0x440a
-#define TT_MS_LANGID_SPANISH_HONDURAS                  0x480a
-#define TT_MS_LANGID_SPANISH_NICARAGUA                 0x4c0a
-#define TT_MS_LANGID_SPANISH_PUERTO_RICO               0x500a
-#define TT_MS_LANGID_SPANISH_UNITED_STATES             0x540a
+#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT    0x040A
+#define TT_MS_LANGID_SPANISH_MEXICO                    0x080A
+#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT  0x0C0A
+#define TT_MS_LANGID_SPANISH_GUATEMALA                 0x100A
+#define TT_MS_LANGID_SPANISH_COSTA_RICA                0x140A
+#define TT_MS_LANGID_SPANISH_PANAMA                    0x180A
+#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC        0x1C0A
+#define TT_MS_LANGID_SPANISH_VENEZUELA                 0x200A
+#define TT_MS_LANGID_SPANISH_COLOMBIA                  0x240A
+#define TT_MS_LANGID_SPANISH_PERU                      0x280A
+#define TT_MS_LANGID_SPANISH_ARGENTINA                 0x2C0A
+#define TT_MS_LANGID_SPANISH_ECUADOR                   0x300A
+#define TT_MS_LANGID_SPANISH_CHILE                     0x340A
+#define TT_MS_LANGID_SPANISH_URUGUAY                   0x380A
+#define TT_MS_LANGID_SPANISH_PARAGUAY                  0x3C0A
+#define TT_MS_LANGID_SPANISH_BOLIVIA                   0x400A
+#define TT_MS_LANGID_SPANISH_EL_SALVADOR               0x440A
+#define TT_MS_LANGID_SPANISH_HONDURAS                  0x480A
+#define TT_MS_LANGID_SPANISH_NICARAGUA                 0x4C0A
+#define TT_MS_LANGID_SPANISH_PUERTO_RICO               0x500A
+#define TT_MS_LANGID_SPANISH_UNITED_STATES             0x540A
   /* The following ID blatantly violate MS specs by using a */
   /* sublanguage > 0x1F.                                    */
-#define TT_MS_LANGID_SPANISH_LATIN_AMERICA             0xE40aU
-#define TT_MS_LANGID_FINNISH_FINLAND                   0x040b
-#define TT_MS_LANGID_FRENCH_FRANCE                     0x040c
-#define TT_MS_LANGID_FRENCH_BELGIUM                    0x080c
-#define TT_MS_LANGID_FRENCH_CANADA                     0x0c0c
-#define TT_MS_LANGID_FRENCH_SWITZERLAND                0x100c
-#define TT_MS_LANGID_FRENCH_LUXEMBOURG                 0x140c
-#define TT_MS_LANGID_FRENCH_MONACO                     0x180c
-#define TT_MS_LANGID_FRENCH_WEST_INDIES                0x1c0c
-#define TT_MS_LANGID_FRENCH_REUNION                    0x200c
-#define TT_MS_LANGID_FRENCH_CONGO                      0x240c
+#define TT_MS_LANGID_SPANISH_LATIN_AMERICA             0xE40AU
+#define TT_MS_LANGID_FINNISH_FINLAND                   0x040B
+#define TT_MS_LANGID_FRENCH_FRANCE                     0x040C
+#define TT_MS_LANGID_FRENCH_BELGIUM                    0x080C
+#define TT_MS_LANGID_FRENCH_CANADA                     0x0C0C
+#define TT_MS_LANGID_FRENCH_SWITZERLAND                0x100C
+#define TT_MS_LANGID_FRENCH_LUXEMBOURG                 0x140C
+#define TT_MS_LANGID_FRENCH_MONACO                     0x180C
+#define TT_MS_LANGID_FRENCH_WEST_INDIES                0x1C0C
+#define TT_MS_LANGID_FRENCH_REUNION                    0x200C
+#define TT_MS_LANGID_FRENCH_CONGO                      0x240C
   /* which was formerly: */
 #define TT_MS_LANGID_FRENCH_ZAIRE  TT_MS_LANGID_FRENCH_CONGO
-#define TT_MS_LANGID_FRENCH_SENEGAL                    0x280c
-#define TT_MS_LANGID_FRENCH_CAMEROON                   0x2c0c
-#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE              0x300c
-#define TT_MS_LANGID_FRENCH_MALI                       0x340c
-#define TT_MS_LANGID_FRENCH_MOROCCO                    0x380c
-#define TT_MS_LANGID_FRENCH_HAITI                      0x3c0c
-  /* and another violation of the spec (see 0xE40aU) */
-#define TT_MS_LANGID_FRENCH_NORTH_AFRICA               0xE40cU
-#define TT_MS_LANGID_HEBREW_ISRAEL                     0x040d
-#define TT_MS_LANGID_HUNGARIAN_HUNGARY                 0x040e
-#define TT_MS_LANGID_ICELANDIC_ICELAND                 0x040f
+#define TT_MS_LANGID_FRENCH_SENEGAL                    0x280C
+#define TT_MS_LANGID_FRENCH_CAMEROON                   0x2C0C
+#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE              0x300C
+#define TT_MS_LANGID_FRENCH_MALI                       0x340C
+#define TT_MS_LANGID_FRENCH_MOROCCO                    0x380C
+#define TT_MS_LANGID_FRENCH_HAITI                      0x3C0C
+  /* and another violation of the spec (see 0xE40AU) */
+#define TT_MS_LANGID_FRENCH_NORTH_AFRICA               0xE40CU
+#define TT_MS_LANGID_HEBREW_ISRAEL                     0x040D
+#define TT_MS_LANGID_HUNGARIAN_HUNGARY                 0x040E
+#define TT_MS_LANGID_ICELANDIC_ICELAND                 0x040F
 #define TT_MS_LANGID_ITALIAN_ITALY                     0x0410
 #define TT_MS_LANGID_ITALIAN_SWITZERLAND               0x0810
 #define TT_MS_LANGID_JAPANESE_JAPAN                    0x0411
@@ -610,27 +600,27 @@ FT_BEGIN_HEADER
 #define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA                0x0818
 #define TT_MS_LANGID_RUSSIAN_RUSSIA                    0x0419
 #define TT_MS_LANGID_RUSSIAN_MOLDAVIA                  0x0819
-#define TT_MS_LANGID_CROATIAN_CROATIA                  0x041a
-#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN              0x081a
-#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC           0x0c1a
+#define TT_MS_LANGID_CROATIAN_CROATIA                  0x041A
+#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN              0x081A
+#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC           0x0C1A
 
 #if 0  /* this used to be this value, but it looks like we were wrong */
-#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x101a
+#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x101A
 #else  /* current sources say */
-#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA       0x101a
-#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x141a
+#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA       0x101A
+#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x141A
        /* and XPsp2 Platform SDK added (2004-07-26) */
        /* Names are shortened to be significant within 40 chars. */
-#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN         0x181a
-#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC      0x181a
+#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN         0x181A
+#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC      0x181A
 #endif
 
-#define TT_MS_LANGID_SLOVAK_SLOVAKIA                   0x041b
-#define TT_MS_LANGID_ALBANIAN_ALBANIA                  0x041c
-#define TT_MS_LANGID_SWEDISH_SWEDEN                    0x041d
-#define TT_MS_LANGID_SWEDISH_FINLAND                   0x081d
-#define TT_MS_LANGID_THAI_THAILAND                     0x041e
-#define TT_MS_LANGID_TURKISH_TURKEY                    0x041f
+#define TT_MS_LANGID_SLOVAK_SLOVAKIA                   0x041B
+#define TT_MS_LANGID_ALBANIAN_ALBANIA                  0x041C
+#define TT_MS_LANGID_SWEDISH_SWEDEN                    0x041D
+#define TT_MS_LANGID_SWEDISH_FINLAND                   0x081D
+#define TT_MS_LANGID_THAI_THAILAND                     0x041E
+#define TT_MS_LANGID_TURKISH_TURKEY                    0x041F
 #define TT_MS_LANGID_URDU_PAKISTAN                     0x0420
 #define TT_MS_LANGID_URDU_INDIA                        0x0820
 #define TT_MS_LANGID_INDONESIAN_INDONESIA              0x0421
@@ -643,13 +633,13 @@ FT_BEGIN_HEADER
 #define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA      0x0827
 #define TT_MS_LANGID_TAJIK_TAJIKISTAN                  0x0428
 #define TT_MS_LANGID_FARSI_IRAN                        0x0429
-#define TT_MS_LANGID_VIETNAMESE_VIET_NAM               0x042a
-#define TT_MS_LANGID_ARMENIAN_ARMENIA                  0x042b
-#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN            0x042c
-#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC         0x082c
-#define TT_MS_LANGID_BASQUE_SPAIN                      0x042d
-#define TT_MS_LANGID_SORBIAN_GERMANY                   0x042e
-#define TT_MS_LANGID_MACEDONIAN_MACEDONIA              0x042f
+#define TT_MS_LANGID_VIETNAMESE_VIET_NAM               0x042A
+#define TT_MS_LANGID_ARMENIAN_ARMENIA                  0x042B
+#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN            0x042C
+#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC         0x082C
+#define TT_MS_LANGID_BASQUE_SPAIN                      0x042D
+#define TT_MS_LANGID_SORBIAN_GERMANY                   0x042E
+#define TT_MS_LANGID_MACEDONIAN_MACEDONIA              0x042F
 #define TT_MS_LANGID_SUTU_SOUTH_AFRICA                 0x0430
 #define TT_MS_LANGID_TSONGA_SOUTH_AFRICA               0x0431
 #define TT_MS_LANGID_TSWANA_SOUTH_AFRICA               0x0432
@@ -660,32 +650,32 @@ FT_BEGIN_HEADER
 #define TT_MS_LANGID_GEORGIAN_GEORGIA                  0x0437
 #define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS           0x0438
 #define TT_MS_LANGID_HINDI_INDIA                       0x0439
-#define TT_MS_LANGID_MALTESE_MALTA                     0x043a
+#define TT_MS_LANGID_MALTESE_MALTA                     0x043A
   /* Added by XPsp2 Platform SDK (2004-07-26) */
-#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY              0x043b
-#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN              0x083b
-#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND             0x0C3b
-#define TT_MS_LANGID_SAMI_LULE_NORWAY                  0x103b
-#define TT_MS_LANGID_SAMI_LULE_SWEDEN                  0x143b
-#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY              0x183b
-#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN              0x1C3b
-#define TT_MS_LANGID_SAMI_SKOLT_FINLAND                0x203b
-#define TT_MS_LANGID_SAMI_INARI_FINLAND                0x243b
+#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY              0x043B
+#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN              0x083B
+#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND             0x0C3B
+#define TT_MS_LANGID_SAMI_LULE_NORWAY                  0x103B
+#define TT_MS_LANGID_SAMI_LULE_SWEDEN                  0x143B
+#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY              0x183B
+#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN              0x1C3B
+#define TT_MS_LANGID_SAMI_SKOLT_FINLAND                0x203B
+#define TT_MS_LANGID_SAMI_INARI_FINLAND                0x243B
   /* ... and we also keep our old identifier... */
-#define TT_MS_LANGID_SAAMI_LAPONIA                     0x043b
+#define TT_MS_LANGID_SAAMI_LAPONIA                     0x043B
 
 #if 0 /* this seems to be a previous inversion */
-#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043c
-#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083c
+#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043C
+#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083C
 #else
-#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083c
-#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043c
+#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083C
+#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043C
 #endif
 
-#define TT_MS_LANGID_YIDDISH_GERMANY                   0x043d
-#define TT_MS_LANGID_MALAY_MALAYSIA                    0x043e
-#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM           0x083e
-#define TT_MS_LANGID_KAZAK_KAZAKSTAN                   0x043f
+#define TT_MS_LANGID_YIDDISH_GERMANY                   0x043D
+#define TT_MS_LANGID_MALAY_MALAYSIA                    0x043E
+#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM           0x083E
+#define TT_MS_LANGID_KAZAK_KAZAKSTAN                   0x043F
 #define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440
   /* alias declared in Windows 2000 */
 #define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \
@@ -703,12 +693,12 @@ FT_BEGIN_HEADER
 #define TT_MS_LANGID_GUJARATI_INDIA                    0x0447
 #define TT_MS_LANGID_ORIYA_INDIA                       0x0448
 #define TT_MS_LANGID_TAMIL_INDIA                       0x0449
-#define TT_MS_LANGID_TELUGU_INDIA                      0x044a
-#define TT_MS_LANGID_KANNADA_INDIA                     0x044b
-#define TT_MS_LANGID_MALAYALAM_INDIA                   0x044c
-#define TT_MS_LANGID_ASSAMESE_INDIA                    0x044d
-#define TT_MS_LANGID_MARATHI_INDIA                     0x044e
-#define TT_MS_LANGID_SANSKRIT_INDIA                    0x044f
+#define TT_MS_LANGID_TELUGU_INDIA                      0x044A
+#define TT_MS_LANGID_KANNADA_INDIA                     0x044B
+#define TT_MS_LANGID_MALAYALAM_INDIA                   0x044C
+#define TT_MS_LANGID_ASSAMESE_INDIA                    0x044D
+#define TT_MS_LANGID_MARATHI_INDIA                     0x044E
+#define TT_MS_LANGID_SANSKRIT_INDIA                    0x044F
 #define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450
 #define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN      0x0850
 #define TT_MS_LANGID_TIBETAN_CHINA                     0x0451
@@ -742,13 +732,13 @@ FT_BEGIN_HEADER
 #define TT_MS_LANGID_SINDHI_INDIA /* Arabic */         0x0459
 #define TT_MS_LANGID_SINDHI_PAKISTAN                   0x0859
   /* Missing a LCID for Sindhi in Devanagari script */
-#define TT_MS_LANGID_SYRIAC_SYRIA                      0x045a
-#define TT_MS_LANGID_SINHALESE_SRI_LANKA               0x045b
-#define TT_MS_LANGID_CHEROKEE_UNITED_STATES            0x045c
-#define TT_MS_LANGID_INUKTITUT_CANADA                  0x045d
-#define TT_MS_LANGID_AMHARIC_ETHIOPIA                  0x045e
-#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */    0x045f
-#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN           0x085f
+#define TT_MS_LANGID_SYRIAC_SYRIA                      0x045A
+#define TT_MS_LANGID_SINHALESE_SRI_LANKA               0x045B
+#define TT_MS_LANGID_CHEROKEE_UNITED_STATES            0x045C
+#define TT_MS_LANGID_INUKTITUT_CANADA                  0x045D
+#define TT_MS_LANGID_AMHARIC_ETHIOPIA                  0x045E
+#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */    0x045F
+#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN           0x085F
   /* Missing a LCID for Tifinagh script */
 #define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */    0x0460
   /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */
@@ -768,15 +758,15 @@ FT_BEGIN_HEADER
 #define TT_MS_LANGID_FULFULDE_NIGERIA                  0x0467
 #define TT_MS_LANGID_HAUSA_NIGERIA                     0x0468
 #define TT_MS_LANGID_IBIBIO_NIGERIA                    0x0469
-#define TT_MS_LANGID_YORUBA_NIGERIA                    0x046a
-#define TT_MS_LANGID_QUECHUA_BOLIVIA                   0x046b
-#define TT_MS_LANGID_QUECHUA_ECUADOR                   0x086b
-#define TT_MS_LANGID_QUECHUA_PERU                      0x0c6b
-#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA               0x046c
+#define TT_MS_LANGID_YORUBA_NIGERIA                    0x046A
+#define TT_MS_LANGID_QUECHUA_BOLIVIA                   0x046B
+#define TT_MS_LANGID_QUECHUA_ECUADOR                   0x086B
+#define TT_MS_LANGID_QUECHUA_PERU                      0x0C6B
+#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA               0x046C
   /* Also spelled by XPsp2 Platform SDK (2004-07-26) */
 #define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \
           TT_MS_LANGID_SEPEDI_SOUTH_AFRICA
-  /* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */
+  /* language codes 0x046D, 0x046E and 0x046F are (still) unknown. */
 #define TT_MS_LANGID_IGBO_NIGERIA                      0x0470
 #define TT_MS_LANGID_KANURI_NIGERIA                    0x0471
 #define TT_MS_LANGID_OROMO_ETHIOPIA                    0x0472
@@ -793,12 +783,12 @@ FT_BEGIN_HEADER
   /*       studying).                                                     */
 #define TT_MS_LANGID_YI_CHINA                          0x0478
 #define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES   0x0479
-  /* language codes from 0x047a to 0x047f are (still) unknown. */
+  /* language codes from 0x047A to 0x047F are (still) unknown. */
 #define TT_MS_LANGID_UIGHUR_CHINA                      0x0480
 #define TT_MS_LANGID_MAORI_NEW_ZEALAND                 0x0481
 
 #if 0  /* not deemed useful for fonts */
-#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE            0x04ff
+#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE            0x04FF
 #endif
 
 
@@ -1218,7 +1208,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* Here some alias #defines in order to be clearer.                      */
   /*                                                                       */
-  /* These are not always #defined to stay within the 31~character limit   */
+  /* These are not always #defined to stay within the 31~character limit,  */
   /* which some compilers have.                                            */
   /*                                                                       */
   /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern  */
similarity index 87%
rename from include/freetype/tttables.h
rename to include/tttables.h
index 02236c2..e1d8b05 100644 (file)
@@ -5,7 +5,7 @@
 /*    Basic SFNT/TrueType tables definitions and interface                 */
 /*    (specification only).                                                */
 /*                                                                         */
-/*  Copyright 1996-2005, 2008-2011 by                                      */
+/*  Copyright 1996-2005, 2008-2014 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -48,6 +48,25 @@ FT_BEGIN_HEADER
   /*    This section contains the definition of TrueType-specific tables   */
   /*    as well as some routines used to access and process them.          */
   /*                                                                       */
+  /* <Order>                                                               */
+  /*    TT_Header                                                          */
+  /*    TT_HoriHeader                                                      */
+  /*    TT_VertHeader                                                      */
+  /*    TT_OS2                                                             */
+  /*    TT_Postscript                                                      */
+  /*    TT_PCLT                                                            */
+  /*    TT_MaxProfile                                                      */
+  /*                                                                       */
+  /*    FT_Sfnt_Tag                                                        */
+  /*    FT_Get_Sfnt_Table                                                  */
+  /*    FT_Load_Sfnt_Table                                                 */
+  /*    FT_Sfnt_Table_Info                                                 */
+  /*                                                                       */
+  /*    FT_Get_CMap_Language_ID                                            */
+  /*    FT_Get_CMap_Format                                                 */
+  /*                                                                       */
+  /*    FT_PARAM_TAG_UNPATENTED_HINTING                                    */
+  /*                                                                       */
   /*************************************************************************/
 
 
@@ -170,8 +189,8 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Note>                                                                */
   /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */
-  /*               be identical except for the names of their fields which */
-  /*               are different.                                          */
+  /*               be identical except for the names of their fields,      */
+  /*               which are different.                                    */
   /*                                                                       */
   /*               This ensures that a single function in the `ttload'     */
   /*               module is able to read both the horizontal and vertical */
@@ -296,8 +315,8 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Note>                                                                */
   /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */
-  /*               be identical except for the names of their fields which */
-  /*               are different.                                          */
+  /*               be identical except for the names of their fields,      */
+  /*               which are different.                                    */
   /*                                                                       */
   /*               This ensures that a single function in the `ttload'     */
   /*               module is able to read both the horizontal and vertical */
@@ -340,12 +359,11 @@ FT_BEGIN_HEADER
   /*    TT_OS2                                                             */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    A structure used to model a TrueType OS/2 table. This is the long  */
-  /*    table version.  All fields comply to the TrueType specification.   */
+  /*    A structure used to model a TrueType OS/2 table.  All fields       */
+  /*    comply to the OpenType specification.                              */
   /*                                                                       */
-  /*    Note that we now support old Mac fonts which do not include an     */
-  /*    OS/2 table.  In this case, the `version' field is always set to    */
-  /*    0xFFFF.                                                            */
+  /*    Note that we now support old Mac fonts that do not include an OS/2 */
+  /*    table.  In this case, the `version' field is always set to 0xFFFF. */
   /*                                                                       */
   typedef struct  TT_OS2_
   {
@@ -384,12 +402,12 @@ FT_BEGIN_HEADER
     FT_UShort  usWinAscent;
     FT_UShort  usWinDescent;
 
-    /* only version 1 tables: */
+    /* only version 1 and higher: */
 
     FT_ULong   ulCodePageRange1;       /* Bits 0-31   */
     FT_ULong   ulCodePageRange2;       /* Bits 32-63  */
 
-    /* only version 2 tables: */
+    /* only version 2 and higher: */
 
     FT_Short   sxHeight;
     FT_Short   sCapHeight;
@@ -397,6 +415,11 @@ FT_BEGIN_HEADER
     FT_UShort  usBreakChar;
     FT_UShort  usMaxContext;
 
+    /* only version 5 and higher: */
+
+    FT_UShort  usLowerOpticalPointSize;       /* in twips (1/20th points) */
+    FT_UShort  usUpperOpticalPointSize;       /* in twips (1/20th points) */
+
   } TT_OS2;
 
 
@@ -465,7 +488,7 @@ FT_BEGIN_HEADER
   /*    TT_MaxProfile                                                      */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    The maximum profile is a table containing many max values which    */
+  /*    The maximum profile is a table containing many max values, which   */
   /*    can be used to pre-allocate arrays.  This ensures that no memory   */
   /*    allocation occurs during a glyph load.                             */
   /*                                                                       */
@@ -555,21 +578,44 @@ FT_BEGIN_HEADER
   /*    An enumeration used to specify the index of an SFNT table.         */
   /*    Used in the @FT_Get_Sfnt_Table API function.                       */
   /*                                                                       */
+  /* <Values>                                                              */
+  /*    FT_SFNT_HEAD :: To access the font's @TT_Header structure.         */
+  /*                                                                       */
+  /*    FT_SFNT_MAXP :: To access the font's @TT_MaxProfile structure.     */
+  /*                                                                       */
+  /*    FT_SFNT_OS2  :: To access the font's @TT_OS2 structure.            */
+  /*                                                                       */
+  /*    FT_SFNT_HHEA :: To access the font's @TT_HoriHeader structure.     */
+  /*                                                                       */
+  /*    FT_SFNT_VHEA :: To access the font's @TT_VertHeader struture.      */
+  /*                                                                       */
+  /*    FT_SFNT_POST :: To access the font's @TT_Postscript structure.     */
+  /*                                                                       */
+  /*    FT_SFNT_PCLT :: To access the font's @TT_PCLT structure.           */
+  /*                                                                       */
   typedef enum  FT_Sfnt_Tag_
   {
-    ft_sfnt_head = 0,    /* TT_Header     */
-    ft_sfnt_maxp = 1,    /* TT_MaxProfile */
-    ft_sfnt_os2  = 2,    /* TT_OS2        */
-    ft_sfnt_hhea = 3,    /* TT_HoriHeader */
-    ft_sfnt_vhea = 4,    /* TT_VertHeader */
-    ft_sfnt_post = 5,    /* TT_Postscript */
-    ft_sfnt_pclt = 6,    /* TT_PCLT       */
+    FT_SFNT_HEAD,
+    FT_SFNT_MAXP,
+    FT_SFNT_OS2,
+    FT_SFNT_HHEA,
+    FT_SFNT_VHEA,
+    FT_SFNT_POST,
+    FT_SFNT_PCLT,
 
-    sfnt_max   /* internal end mark */
+    FT_SFNT_MAX
 
   } FT_Sfnt_Tag;
 
-  /* */
+  /* these constants are deprecated; use the corresponding `FT_Sfnt_Tag' */
+  /* values instead                                                      */
+#define ft_sfnt_head  FT_SFNT_HEAD
+#define ft_sfnt_maxp  FT_SFNT_MAXP
+#define ft_sfnt_os2   FT_SFNT_OS2
+#define ft_sfnt_hhea  FT_SFNT_HHEA
+#define ft_sfnt_vhea  FT_SFNT_VHEA
+#define ft_sfnt_post  FT_SFNT_POST
+#define ft_sfnt_pclt  FT_SFNT_PCLT
 
 
   /*************************************************************************/
@@ -600,6 +646,16 @@ FT_BEGIN_HEADER
   /*    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 );
@@ -662,6 +718,12 @@ FT_BEGIN_HEADER
   *       error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
   *       if ( error ) { ... could not load table ... }
   *     }
+  *
+  *   Note that structures like @TT_Header or @TT_OS2 can't be used with
+  *   this function; they are limited to @FT_Get_Sfnt_Table.  Reason is that
+  *   those structures depend on the processor architecture, with varying
+  *   size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian).
+  *
   */
   FT_EXPORT( FT_Error )
   FT_Load_Sfnt_Table( FT_Face    face,
@@ -702,7 +764,8 @@ FT_BEGIN_HEADER
   *   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 )
@@ -719,7 +782,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    Return TrueType/sfnt specific cmap language ID.  Definitions of    */
-  /*    language ID values are in `freetype/ttnameid.h'.                   */
+  /*    language ID values are in `ttnameid.h'.                            */
   /*                                                                       */
   /* <Input>                                                               */
   /*    charmap ::                                                         */
@@ -729,6 +792,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.            */
   /*                                                                       */
+  /*    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 );
 
similarity index 94%
rename from include/freetype/tttags.h
rename to include/tttags.h
index 307ce4b..d59aa19 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -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_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' )
@@ -86,6 +88,7 @@ FT_BEGIN_HEADER
 #define TTAG_post  FT_MAKE_TAG( 'p', 'o', 's', 't' )
 #define TTAG_prep  FT_MAKE_TAG( 'p', 'r', 'e', 'p' )
 #define TTAG_prop  FT_MAKE_TAG( 'p', 'r', 'o', 'p' )
+#define TTAG_sbix  FT_MAKE_TAG( 's', 'b', 'i', 'x' )
 #define TTAG_sfnt  FT_MAKE_TAG( 's', 'f', 'n', 't' )
 #define TTAG_SING  FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
 #define TTAG_trak  FT_MAKE_TAG( 't', 'r', 'a', 'k' )
@@ -97,6 +100,7 @@ FT_BEGIN_HEADER
 #define TTAG_VDMX  FT_MAKE_TAG( 'V', 'D', 'M', 'X' )
 #define TTAG_vhea  FT_MAKE_TAG( 'v', 'h', 'e', 'a' )
 #define TTAG_vmtx  FT_MAKE_TAG( 'v', 'm', 't', 'x' )
+#define TTAG_wOFF  FT_MAKE_TAG( 'w', 'O', 'F', 'F' )
 
 
 FT_END_HEADER
similarity index 99%
rename from include/freetype/ttunpat.h
rename to include/ttunpat.h
index a016275..bf53ddd 100644 (file)
@@ -48,7 +48,8 @@ FT_BEGIN_HEADER
   */
 #define FT_PARAM_TAG_UNPATENTED_HINTING  FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
 
- /* */
+  /* */
+
 
 FT_END_HEADER
 
index a85378e..4e52594 100644 (file)
@@ -1,6 +1,6 @@
 # modules.cfg
 #
-# Copyright 2005-2007, 2009-2011 by
+# Copyright 2005-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,
@@ -19,7 +19,7 @@
 # activate a module, remove the comment character.
 #
 # Note that many modules and components are further controlled with macros
-# in the file `include/freetype/config/ftoption.h'.
+# in the file `include/config/ftoption.h'.
 
 
 ####
@@ -85,7 +85,7 @@ HINTING_MODULES += autofit
 HINTING_MODULES += pshinter
 
 # The TrueType hinting engine doesn't have a module of its own but is
-# controlled in file include/freetype/config/ftoption.h
+# controlled in file include/config/ftoption.h
 # (TT_CONFIG_OPTION_BYTECODE_INTERPRETER and friends).
 
 
@@ -106,7 +106,7 @@ RASTER_MODULES += smooth
 
 # FreeType's cache sub-system (quite stable but still in beta -- this means
 # that its public API is subject to change if necessary).  See
-# include/freetype/ftcache.h.  Needs ftglyph.c.
+# include/ftcache.h.  Needs ftglyph.c.
 AUX_MODULES += cache
 
 # TrueType GX/AAT table validation.  Needs ftgxval.c below.
@@ -114,17 +114,17 @@ AUX_MODULES += cache
 
 # Support for streams compressed with gzip (files with suffix .gz).
 #
-# See include/freetype/ftgzip.h for the API.
+# See include/ftgzip.h for the API.
 AUX_MODULES += gzip
 
 # Support for streams compressed with LZW (files with suffix .Z).
 #
-# See include/freetype/ftlzw.h for the API.
+# See include/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.
+# See include/ftbzip2.h for the API.
 AUX_MODULES += bzip2
 
 # OpenType table validation.  Needs ftotval.c below.
@@ -149,95 +149,95 @@ AUX_MODULES += psnames
 
 # Exact bounding box calculation.
 #
-# See include/freetype/ftbbox.h for the API.
+# See include/ftbbox.h for the API.
 BASE_EXTENSIONS += ftbbox.c
 
 # Access BDF-specific strings.  Needs BDF font driver.
 #
-# See include/freetype/ftbdf.h for the API.
+# See include/ftbdf.h for the API.
 BASE_EXTENSIONS += ftbdf.c
 
 # Utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp bitmaps into
 # 8bpp format, and for emboldening of bitmap glyphs.
 #
-# See include/freetype/ftbitmap.h for the API.
+# See include/ftbitmap.h for the API.
 BASE_EXTENSIONS += ftbitmap.c
 
 # Access CID font information.
 #
-# See include/freetype/ftcid.h for the API.
+# See include/ftcid.h for the API.
 BASE_EXTENSIONS += ftcid.c
 
 # Access FSType information.  Needs fttype1.c.
 #
-# See include/freetype/freetype.h for the API.
+# See include/freetype.h for the API.
 BASE_EXTENSIONS += ftfstype.c
 
 # Support for GASP table queries.
 #
-# See include/freetype/ftgasp.h for the API.
+# See include/ftgasp.h for the API.
 BASE_EXTENSIONS += ftgasp.c
 
 # Convenience functions to handle glyphs.  Needs ftbitmap.c.
 #
-# See include/freetype/ftglyph.h for the API.
+# See include/ftglyph.h for the API.
 BASE_EXTENSIONS += ftglyph.c
 
 # Interface for gxvalid module.
 #
-# See include/freetype/ftgxval.h for the API.
+# See include/ftgxval.h for the API.
 BASE_EXTENSIONS += ftgxval.c
 
 # Support for LCD color filtering of subpixel bitmaps.
 #
-# See include/freetype/ftlcdfil.h for the API.
+# See include/ftlcdfil.h for the API.
 BASE_EXTENSIONS += ftlcdfil.c
 
 # Multiple Master font interface.
 #
-# See include/freetype/ftmm.h for the API.
+# See include/ftmm.h for the API.
 BASE_EXTENSIONS += ftmm.c
 
 # Interface for otvalid module.
 #
-# See include/freetype/ftotval.h for the API.
+# See include/ftotval.h for the API.
 BASE_EXTENSIONS += ftotval.c
 
 # Support for FT_Face_CheckTrueTypePatents.
 #
-# See include/freetype/freetype.h for the API.
+# See include/freetype.h for the API.
 BASE_EXTENSIONS += ftpatent.c
 
 # Interface for accessing PFR-specific data.  Needs PFR font driver.
 #
-# See include/freetype/ftpfr.h for the API.
+# See include/ftpfr.h for the API.
 BASE_EXTENSIONS += ftpfr.c
 
 # Path stroker.  Needs ftglyph.c.
 #
-# See include/freetype/ftstroke.h for the API.
+# See include/ftstroke.h for the API.
 BASE_EXTENSIONS += ftstroke.c
 
 # Support for synthetic embolding and slanting of fonts.  Needs ftbitmap.c.
 #
-# See include/freetype/ftsynth.h for the API.
+# See include/ftsynth.h for the API.
 BASE_EXTENSIONS += ftsynth.c
 
 # Interface to access data specific to PostScript Type 1 and Type 2 (CFF)
 # fonts.
 #
-# See include/freetype/t1tables.h for the API.
+# See include/t1tables.h for the API.
 BASE_EXTENSIONS += fttype1.c
 
 # Interface for accessing data specific to Windows FNT files.  Needs winfnt
 # driver.
 #
-# See include/freetype/ftwinfnt.h for the API.
+# See include/ftwinfnt.h for the API.
 BASE_EXTENSIONS += ftwinfnt.c
 
 # Support functions for X11.
 #
-# See include/freetype/ftxf86.h for the API.
+# See include/ftxf86.h for the API.
 BASE_EXTENSIONS += ftxf86.c
 
 ####
index ad264ce..21b67f6 100644 (file)
@@ -7,3 +7,9 @@ ftoption.h
 libfreetype.la
 .libs
 *.lo
+*.o
+*.a
+debug*/
+release*/
+win32/
+win64/
diff --git a/packaging/freetype.manifest b/packaging/freetype.manifest
new file mode 100644 (file)
index 0000000..97e8c31
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+       <request>
+               <domain name="_"/>
+       </request>
+</manifest>
index b0187f1..7c32def 100644 (file)
@@ -1,11 +1,14 @@
 Name:       freetype
 Summary:    A free and portable font rendering engine
-Version:    2.4.9
+Version:    2.5.5
 Release:    1
 Group:      System/Libraries
-License:    FTL or GPLv2+
+License:    FTL or GPL-2.0+
 URL:        http://www.freetype.org
 Source0:    http://download.savannah.gnu.org/releases-noredirect/freetype/freetype-%{version}.tar.gz
+Source1001: packaging/freetype.manifest
+BuildRequires:  which
+BuildRequires:  pkgconfig(libpng)
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 Provides:   %{name}-bytecode
@@ -41,6 +44,7 @@ FreeType.
 %setup -q
 
 %build
+cp %{SOURCE1001} .
 
 %configure --disable-static
 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' builds/unix/libtool
@@ -51,6 +55,8 @@ make %{?_smp_mflags}
 rm -rf %{buildroot}
 
 %makeinstall gnulocaledir=$RPM_BUILD_ROOT%{_datadir}/locale
+mkdir -p %{buildroot}/usr/share/license
+cat docs/FTL.TXT > %{buildroot}/usr/share/license/%{name}
 
 
 # fix multilib issues
@@ -60,9 +66,9 @@ rm -rf %{buildroot}
 %define wordsize 32
 %endif
 
-mv $RPM_BUILD_ROOT%{_includedir}/freetype2/freetype/config/ftconfig.h \
-$RPM_BUILD_ROOT%{_includedir}/freetype2/freetype/config/ftconfig-%{wordsize}.h
-cat >$RPM_BUILD_ROOT%{_includedir}/freetype2/freetype/config/ftconfig.h <<EOF
+mv $RPM_BUILD_ROOT%{_includedir}/freetype2/config/ftconfig.h \
+$RPM_BUILD_ROOT%{_includedir}/freetype2/config/ftconfig-%{wordsize}.h
+cat >$RPM_BUILD_ROOT%{_includedir}/freetype2/config/ftconfig.h <<EOF
 #ifndef __FTCONFIG_H__MULTILIB
 #define __FTCONFIG_H__MULTILIB
 
@@ -88,16 +94,19 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.{a,la}
 %postun -p /sbin/ldconfig
 
 %files
+%manifest freetype.manifest
 %defattr(-,root,root,-)
 %{_libdir}/libfreetype.so.*
+/usr/share/license/%{name}
 
 %files devel
+%manifest freetype.manifest
 %defattr(-,root,root,-)
 %dir %{_includedir}/freetype2
 %{_datadir}/aclocal/freetype2.m4
 %{_includedir}/freetype2/*
-%{_includedir}/*.h
 %{_libdir}/libfreetype.so
 %{_bindir}/freetype-config
 %{_libdir}/pkgconfig/*.pc
+%{_datadir}/man/man1/*
 
index 76ee0f4..1cc0685 100644 (file)
@@ -1,6 +1,6 @@
 # FreeType 2 src Jamfile
 #
-# Copyright 2001, 2002 by
+# Copyright 2001, 2002, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -11,7 +11,7 @@
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) ;
 
-# The file <freetype/internal/internal.h> is used to define macros that are
+# The file <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.
 #
index 790af17..f8b095b 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).      */
 /*                                                                         */
-/*  Copyright 2003-2006, 2011 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,       */
 #include "aftypes.h"
 
 
-#if 0
-
-  FT_LOCAL_DEF( FT_Int )
-  af_corner_is_flat( FT_Pos  x_in,
-                     FT_Pos  y_in,
-                     FT_Pos  x_out,
-                     FT_Pos  y_out )
-  {
-    FT_Pos  ax = x_in;
-    FT_Pos  ay = y_in;
-
-    FT_Pos  d_in, d_out, d_corner;
-
-
-    if ( ax < 0 )
-      ax = -ax;
-    if ( ay < 0 )
-      ay = -ay;
-    d_in = ax + ay;
-
-    ax = x_out;
-    if ( ax < 0 )
-      ax = -ax;
-    ay = y_out;
-    if ( ay < 0 )
-      ay = -ay;
-    d_out = ax + ay;
-
-    ax = x_out + x_in;
-    if ( ax < 0 )
-      ax = -ax;
-    ay = y_out + y_in;
-    if ( ay < 0 )
-      ay = -ay;
-    d_corner = ax + ay;
-
-    return ( d_in + d_out - d_corner ) < ( d_corner >> 4 );
-  }
-
-
-  FT_LOCAL_DEF( FT_Int )
-  af_corner_orientation( FT_Pos  x_in,
-                         FT_Pos  y_in,
-                         FT_Pos  x_out,
-                         FT_Pos  y_out )
-  {
-    FT_Pos  delta;
-
-
-    delta = x_in * y_out - y_in * x_out;
-
-    if ( delta == 0 )
-      return 0;
-    else
-      return 1 - 2 * ( delta < 0 );
-  }
-
-#endif /* 0 */
-
-
   /*
    *  We are not using `af_angle_atan' anymore, but we keep the source
    *  code below just in case...
     {
       for ( j = i; j > 0; j-- )
       {
-        if ( table[j] > table[j - 1] )
+        if ( table[j] >= table[j - 1] )
           break;
 
         swap         = table[j];
 
 
   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      cur_idx;
+    FT_Pos       cur_val;
+    FT_Pos       sum;
     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-- )
       {
-        if ( table[j].org > table[j - 1].org )
+        if ( table[j].org >= table[j - 1].org )
           break;
 
         swap         = table[j];
         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;
   }
 
 
diff --git a/src/autofit/afblue.c b/src/autofit/afblue.c
new file mode 100644 (file)
index 0000000..811226e
--- /dev/null
@@ -0,0 +1,177 @@
+/* This file has been generated by the Perl script `afblue.pl', */
+/* using data from file `afblue.dat'.                           */
+
+/***************************************************************************/
+/*                                                                         */
+/*  afblue.c                                                               */
+/*                                                                         */
+/*    Auto-fitter data for blue strings (body).                            */
+/*                                                                         */
+/*  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.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include "aftypes.h"
+
+
+  FT_LOCAL_ARRAY_DEF( char )
+  af_blue_strings[] =
+  {
+    /* */
+    '\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\x9F', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD',  /* БВЕПЗОСЭ */
+    '\0',
+    '\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\xA8', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD',  /* БВЕШЗОСЭ */
+    '\0',
+    '\xD1', '\x85', '\xD0', '\xBF', '\xD0', '\xBD', '\xD1', '\x88', '\xD0', '\xB5', '\xD0', '\xB7', '\xD0', '\xBE', '\xD1', '\x81',  /* хпншезос */
+    '\0',
+    '\xD1', '\x80', '\xD1', '\x83', '\xD1', '\x84',  /* руф */
+    '\0',
+    '\xE0', '\xA4', '\x95', '\xE0', '\xA4', '\xAE', '\xE0', '\xA4', '\x85', '\xE0', '\xA4', '\x86', '\xE0', '\xA4', '\xA5', '\xE0', '\xA4', '\xA7', '\xE0', '\xA4', '\xAD', '\xE0', '\xA4', '\xB6',  /* क म अ आ थ ध भ श */
+    '\0',
+    '\xE0', '\xA4', '\x88', '\xE0', '\xA4', '\x90', '\xE0', '\xA4', '\x93', '\xE0', '\xA4', '\x94', '\xE0', '\xA4', '\xBF', '\xE0', '\xA5', '\x80', '\xE0', '\xA5', '\x8B', '\xE0', '\xA5', '\x8C',  /* ई ऐ ओ औ ि ी ो ौ */
+    '\0',
+    '\xE0', '\xA4', '\x95', '\xE0', '\xA4', '\xAE', '\xE0', '\xA4', '\x85', '\xE0', '\xA4', '\x86', '\xE0', '\xA4', '\xA5', '\xE0', '\xA4', '\xA7', '\xE0', '\xA4', '\xAD', '\xE0', '\xA4', '\xB6',  /* क म अ आ थ ध भ श */
+    '\0',
+    '\xE0', '\xA5', '\x81', '\xE0', '\xA5', '\x83',  /* ु ृ */
+    '\0',
+    '\xCE', '\x93', '\xCE', '\x92', '\xCE', '\x95', '\xCE', '\x96', '\xCE', '\x98', '\xCE', '\x9F', '\xCE', '\xA9',  /* ΓΒΕΖΘΟΩ */
+    '\0',
+    '\xCE', '\x92', '\xCE', '\x94', '\xCE', '\x96', '\xCE', '\x9E', '\xCE', '\x98', '\xCE', '\x9F',  /* ΒΔΖΞΘΟ */
+    '\0',
+    '\xCE', '\xB2', '\xCE', '\xB8', '\xCE', '\xB4', '\xCE', '\xB6', '\xCE', '\xBB', '\xCE', '\xBE',  /* βθδζλξ */
+    '\0',
+    '\xCE', '\xB1', '\xCE', '\xB5', '\xCE', '\xB9', '\xCE', '\xBF', '\xCF', '\x80', '\xCF', '\x83', '\xCF', '\x84', '\xCF', '\x89',  /* αειοπστω */
+    '\0',
+    '\xCE', '\xB2', '\xCE', '\xB3', '\xCE', '\xB7', '\xCE', '\xBC', '\xCF', '\x81', '\xCF', '\x86', '\xCF', '\x87', '\xCF', '\x88',  /* βγημρφχψ */
+    '\0',
+    '\xD7', '\x91', '\xD7', '\x93', '\xD7', '\x94', '\xD7', '\x97', '\xD7', '\x9A', '\xD7', '\x9B', '\xD7', '\x9D', '\xD7', '\xA1',  /* בדהחךכםס */
+    '\0',
+    '\xD7', '\x91', '\xD7', '\x98', '\xD7', '\x9B', '\xD7', '\x9D', '\xD7', '\xA1', '\xD7', '\xA6',  /* בטכםסצ */
+    '\0',
+    '\xD7', '\xA7', '\xD7', '\x9A', '\xD7', '\x9F', '\xD7', '\xA3', '\xD7', '\xA5',  /* קךןףץ */
+    '\0',
+    'T', 'H', 'E', 'Z', 'O', 'C', 'Q', 'S',  /* THEZOCQS */
+    '\0',
+    'H', 'E', 'Z', 'L', 'O', 'C', 'U', 'S',  /* HEZLOCUS */
+    '\0',
+    'f', 'i', 'j', 'k', 'd', 'b', 'h',  /* fijkdbh */
+    '\0',
+    'x', 'z', 'r', 'o', 'e', 's', 'c',  /* xzroesc */
+    '\0',
+    'p', 'q', 'g', 'j', 'y',  /* pqgjy */
+    '\0',
+    '\xE0', '\xB0', '\x87', '\xE0', '\xB0', '\x8C', '\xE0', '\xB0', '\x99', '\xE0', '\xB0', '\x9E', '\xE0', '\xB0', '\xA3', '\xE0', '\xB0', '\xB1', '\xE0', '\xB1', '\xAF',  /* ఇ ఌ ఙ ఞ ణ ఱ ౯ */
+    '\0',
+    '\xE0', '\xB0', '\x85', '\xE0', '\xB0', '\x95', '\xE0', '\xB0', '\x9A', '\xE0', '\xB0', '\xB0', '\xE0', '\xB0', '\xBD', '\xE0', '\xB1', '\xA8', '\xE0', '\xB1', '\xAC',  /* అ క చ ర ఽ ౨ ౬ */
+#ifdef AF_CONFIG_OPTION_CJK
+    '\0',
+    '\xE4', '\xBB', '\x96', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\x9C', '\xB0',  /* 他们你來們到和地 */
+    '\xE5', '\xAF', '\xB9', '\xE5', '\xB0', '\x8D', '\xE5', '\xB0', '\xB1', '\xE5', '\xB8', '\xAD', '\xE6', '\x88', '\x91', '\xE6', '\x97', '\xB6', '\xE6', '\x99', '\x82', '\xE6', '\x9C', '\x83',  /* 对對就席我时時會 */
+    '\xE6', '\x9D', '\xA5', '\xE7', '\x82', '\xBA', '\xE8', '\x83', '\xBD', '\xE8', '\x88', '\xB0', '\xE8', '\xAA', '\xAA', '\xE8', '\xAF', '\xB4', '\xE8', '\xBF', '\x99', '\xE9', '\x80', '\x99',  /* 来為能舰說说这這 */
+    '\xE9', '\xBD', '\x8A', '|',  /* 齊 | */
+    '\xE5', '\x86', '\x9B', '\xE5', '\x90', '\x8C', '\xE5', '\xB7', '\xB2', '\xE6', '\x84', '\xBF', '\xE6', '\x97', '\xA2', '\xE6', '\x98', '\x9F', '\xE6', '\x98', '\xAF', '\xE6', '\x99', '\xAF',  /* 军同已愿既星是景 */
+    '\xE6', '\xB0', '\x91', '\xE7', '\x85', '\xA7', '\xE7', '\x8E', '\xB0', '\xE7', '\x8F', '\xBE', '\xE7', '\x90', '\x86', '\xE7', '\x94', '\xA8', '\xE7', '\xBD', '\xAE', '\xE8', '\xA6', '\x81',  /* 民照现現理用置要 */
+    '\xE8', '\xBB', '\x8D', '\xE9', '\x82', '\xA3', '\xE9', '\x85', '\x8D', '\xE9', '\x87', '\x8C', '\xE9', '\x96', '\x8B', '\xE9', '\x9B', '\xB7', '\xE9', '\x9C', '\xB2', '\xE9', '\x9D', '\xA2',  /* 軍那配里開雷露面 */
+    '\xE9', '\xA1', '\xBE',  /* 顾 */
+    '\0',
+    '\xE4', '\xB8', '\xAA', '\xE4', '\xB8', '\xBA', '\xE4', '\xBA', '\xBA', '\xE4', '\xBB', '\x96', '\xE4', '\xBB', '\xA5', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86',  /* 个为人他以们你來 */
+    '\xE5', '\x80', '\x8B', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\xA4', '\xA7', '\xE5', '\xAF', '\xB9', '\xE5', '\xB0', '\x8D', '\xE5', '\xB0', '\xB1',  /* 個們到和大对對就 */
+    '\xE6', '\x88', '\x91', '\xE6', '\x97', '\xB6', '\xE6', '\x99', '\x82', '\xE6', '\x9C', '\x89', '\xE6', '\x9D', '\xA5', '\xE7', '\x82', '\xBA', '\xE8', '\xA6', '\x81', '\xE8', '\xAA', '\xAA',  /* 我时時有来為要說 */
+    '\xE8', '\xAF', '\xB4', '|',  /* 说 | */
+    '\xE4', '\xB8', '\xBB', '\xE4', '\xBA', '\x9B', '\xE5', '\x9B', '\xA0', '\xE5', '\xAE', '\x83', '\xE6', '\x83', '\xB3', '\xE6', '\x84', '\x8F', '\xE7', '\x90', '\x86', '\xE7', '\x94', '\x9F',  /* 主些因它想意理生 */
+    '\xE7', '\x95', '\xB6', '\xE7', '\x9C', '\x8B', '\xE7', '\x9D', '\x80', '\xE7', '\xBD', '\xAE', '\xE8', '\x80', '\x85', '\xE8', '\x87', '\xAA', '\xE8', '\x91', '\x97', '\xE8', '\xA3', '\xA1',  /* 當看着置者自著裡 */
+    '\xE8', '\xBF', '\x87', '\xE8', '\xBF', '\x98', '\xE8', '\xBF', '\x9B', '\xE9', '\x80', '\xB2', '\xE9', '\x81', '\x8E', '\xE9', '\x81', '\x93', '\xE9', '\x82', '\x84', '\xE9', '\x87', '\x8C',  /* 过还进進過道還里 */
+    '\xE9', '\x9D', '\xA2',  /* 面 */
+#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
+    '\0',
+    '\xE4', '\xBA', '\x9B', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\x9C', '\xB0',  /* 些们你來們到和地 */
+    '\xE5', '\xA5', '\xB9', '\xE5', '\xB0', '\x86', '\xE5', '\xB0', '\x87', '\xE5', '\xB0', '\xB1', '\xE5', '\xB9', '\xB4', '\xE5', '\xBE', '\x97', '\xE6', '\x83', '\x85', '\xE6', '\x9C', '\x80',  /* 她将將就年得情最 */
+    '\xE6', '\xA0', '\xB7', '\xE6', '\xA8', '\xA3', '\xE7', '\x90', '\x86', '\xE8', '\x83', '\xBD', '\xE8', '\xAA', '\xAA', '\xE8', '\xAF', '\xB4', '\xE8', '\xBF', '\x99', '\xE9', '\x80', '\x99',  /* 样樣理能說说这這 */
+    '\xE9', '\x80', '\x9A', '|',  /* 通 | */
+    '\xE5', '\x8D', '\xB3', '\xE5', '\x90', '\x97', '\xE5', '\x90', '\xA7', '\xE5', '\x90', '\xAC', '\xE5', '\x91', '\xA2', '\xE5', '\x93', '\x81', '\xE5', '\x93', '\x8D', '\xE5', '\x97', '\x8E',  /* 即吗吧听呢品响嗎 */
+    '\xE5', '\xB8', '\x88', '\xE5', '\xB8', '\xAB', '\xE6', '\x94', '\xB6', '\xE6', '\x96', '\xAD', '\xE6', '\x96', '\xB7', '\xE6', '\x98', '\x8E', '\xE7', '\x9C', '\xBC', '\xE9', '\x96', '\x93',  /* 师師收断斷明眼間 */
+    '\xE9', '\x97', '\xB4', '\xE9', '\x99', '\x85', '\xE9', '\x99', '\x88', '\xE9', '\x99', '\x90', '\xE9', '\x99', '\xA4', '\xE9', '\x99', '\xB3', '\xE9', '\x9A', '\x8F', '\xE9', '\x9A', '\x9B',  /* 间际陈限除陳随際 */
+    '\xE9', '\x9A', '\xA8',  /* 隨 */
+    '\0',
+    '\xE4', '\xBA', '\x8B', '\xE5', '\x89', '\x8D', '\xE5', '\xAD', '\xB8', '\xE5', '\xB0', '\x86', '\xE5', '\xB0', '\x87', '\xE6', '\x83', '\x85', '\xE6', '\x83', '\xB3', '\xE6', '\x88', '\x96',  /* 事前學将將情想或 */
+    '\xE6', '\x94', '\xBF', '\xE6', '\x96', '\xAF', '\xE6', '\x96', '\xB0', '\xE6', '\xA0', '\xB7', '\xE6', '\xA8', '\xA3', '\xE6', '\xB0', '\x91', '\xE6', '\xB2', '\x92', '\xE6', '\xB2', '\xA1',  /* 政斯新样樣民沒没 */
+    '\xE7', '\x84', '\xB6', '\xE7', '\x89', '\xB9', '\xE7', '\x8E', '\xB0', '\xE7', '\x8F', '\xBE', '\xE7', '\x90', '\x83', '\xE7', '\xAC', '\xAC', '\xE7', '\xB6', '\x93', '\xE8', '\xB0', '\x81',  /* 然特现現球第經谁 */
+    '\xE8', '\xB5', '\xB7', '|',  /* 起 | */
+    '\xE4', '\xBE', '\x8B', '\xE5', '\x88', '\xA5', '\xE5', '\x88', '\xAB', '\xE5', '\x88', '\xB6', '\xE5', '\x8A', '\xA8', '\xE5', '\x8B', '\x95', '\xE5', '\x90', '\x97', '\xE5', '\x97', '\x8E',  /* 例別别制动動吗嗎 */
+    '\xE5', '\xA2', '\x9E', '\xE6', '\x8C', '\x87', '\xE6', '\x98', '\x8E', '\xE6', '\x9C', '\x9D', '\xE6', '\x9C', '\x9F', '\xE6', '\x9E', '\x84', '\xE7', '\x89', '\xA9', '\xE7', '\xA1', '\xAE',  /* 增指明朝期构物确 */
+    '\xE7', '\xA7', '\x8D', '\xE8', '\xAA', '\xBF', '\xE8', '\xB0', '\x83', '\xE8', '\xB2', '\xBB', '\xE8', '\xB4', '\xB9', '\xE9', '\x82', '\xA3', '\xE9', '\x83', '\xBD', '\xE9', '\x96', '\x93',  /* 种調调費费那都間 */
+    '\xE9', '\x97', '\xB4',  /* 间 */
+#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
+#endif /* AF_CONFIG_OPTION_CJK                */
+    '\0',
+
+  };
+
+
+  /* stringsets are specific to styles */
+  FT_LOCAL_ARRAY_DEF( AF_Blue_StringRec )
+  af_blue_stringsets[] =
+  {
+    /* */
+    { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        },
+    { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM,  0                                 },
+    { AF_BLUE_STRING_CYRILLIC_SMALL,           AF_BLUE_PROPERTY_LATIN_TOP      |
+                                               AF_BLUE_PROPERTY_LATIN_X_HEIGHT   },
+    { AF_BLUE_STRING_CYRILLIC_SMALL,           0                                 },
+    { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0                                 },
+    { AF_BLUE_STRING_MAX,                      0                                 },
+    { AF_BLUE_STRING_DEVANAGARI_TOP,    AF_BLUE_PROPERTY_LATIN_TOP        },
+    { AF_BLUE_STRING_DEVANAGARI_HEAD,   AF_BLUE_PROPERTY_LATIN_TOP        },
+    { AF_BLUE_STRING_DEVANAGARI_BASE,   AF_BLUE_PROPERTY_LATIN_TOP      |
+                                        AF_BLUE_PROPERTY_LATIN_NEUTRAL  |
+                                        AF_BLUE_PROPERTY_LATIN_X_HEIGHT   },
+    { AF_BLUE_STRING_DEVANAGARI_BASE,   0                                 },
+    { AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0                                 },
+    { AF_BLUE_STRING_MAX,               0                                 },
+    { AF_BLUE_STRING_GREEK_CAPITAL_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        },
+    { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM,  0                                 },
+    { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP,  AF_BLUE_PROPERTY_LATIN_TOP        },
+    { AF_BLUE_STRING_GREEK_SMALL,           AF_BLUE_PROPERTY_LATIN_TOP      |
+                                            AF_BLUE_PROPERTY_LATIN_X_HEIGHT   },
+    { AF_BLUE_STRING_GREEK_SMALL,           0                                 },
+    { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0                                 },
+    { AF_BLUE_STRING_MAX,                   0                                 },
+    { AF_BLUE_STRING_HEBREW_TOP,       AF_BLUE_PROPERTY_LATIN_TOP  |
+                                       AF_BLUE_PROPERTY_LATIN_LONG   },
+    { AF_BLUE_STRING_HEBREW_BOTTOM,    0                             },
+    { AF_BLUE_STRING_HEBREW_DESCENDER, 0                             },
+    { AF_BLUE_STRING_MAX,              0                             },
+    { AF_BLUE_STRING_LATIN_CAPITAL_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        },
+    { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM,  0                                 },
+    { AF_BLUE_STRING_LATIN_SMALL_F_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        },
+    { AF_BLUE_STRING_LATIN_SMALL,           AF_BLUE_PROPERTY_LATIN_TOP      |
+                                            AF_BLUE_PROPERTY_LATIN_X_HEIGHT   },
+    { AF_BLUE_STRING_LATIN_SMALL,           0                                 },
+    { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0                                 },
+    { AF_BLUE_STRING_MAX,                   0                                 },
+    { AF_BLUE_STRING_TELUGU_TOP,    AF_BLUE_PROPERTY_LATIN_TOP },
+    { AF_BLUE_STRING_TELUGU_BOTTOM, 0                          },
+    { AF_BLUE_STRING_MAX,           0                          },
+#ifdef AF_CONFIG_OPTION_CJK
+    { AF_BLUE_STRING_CJK_TOP,    AF_BLUE_PROPERTY_CJK_TOP     },
+    { AF_BLUE_STRING_CJK_BOTTOM, 0                            },
+#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
+    { AF_BLUE_STRING_CJK_LEFT,   AF_BLUE_PROPERTY_CJK_HORIZ   },
+    { AF_BLUE_STRING_CJK_RIGHT,  AF_BLUE_PROPERTY_CJK_HORIZ |
+                                 AF_BLUE_PROPERTY_CJK_RIGHT   },
+#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
+    { AF_BLUE_STRING_MAX,        0                            },
+#endif /* AF_CONFIG_OPTION_CJK                */
+
+  };
+
+
+/* END */
diff --git a/src/autofit/afblue.cin b/src/autofit/afblue.cin
new file mode 100644 (file)
index 0000000..c6762be
--- /dev/null
@@ -0,0 +1,39 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afblue.c                                                               */
+/*                                                                         */
+/*    Auto-fitter data for blue strings (body).                            */
+/*                                                                         */
+/*  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.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include "aftypes.h"
+
+
+  FT_LOCAL_ARRAY_DEF( char )
+  af_blue_strings[] =
+  {
+    /* */
+@AF_BLUE_STRINGS_ARRAY@
+  };
+
+
+  /* stringsets are specific to styles */
+  FT_LOCAL_ARRAY_DEF( AF_Blue_StringRec )
+  af_blue_stringsets[] =
+  {
+    /* */
+@AF_BLUE_STRINGSETS_ARRAY@
+  };
+
+
+/* END */
diff --git a/src/autofit/afblue.dat b/src/autofit/afblue.dat
new file mode 100644 (file)
index 0000000..3f98c13
--- /dev/null
@@ -0,0 +1,337 @@
+//  afblue.dat
+//
+//    Auto-fitter data for blue strings.
+//
+//  Copyright 2013, 2014 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 data specific to blue zones.  It gets processed by
+// a script to simulate `jagged arrays', with enumeration values holding
+// offsets into the arrays.
+//
+// The format of the file is rather simple:  A section starts with three
+// labels separated by whitespace and followed by a colon (everything in a
+// single line); the first label gives the name of the enumeration template,
+// the second the name of the array template, and the third the name of the
+// `maximum' template, holding the size of the largest array element.  The
+// script then fills the corresponding templates (indicated by `@'
+// characters around the name).
+//
+// A section contains one or more data records.  Each data record consists
+// of two or more lines.  The first line holds the enumeration name, and the
+// remaining lines the corresponding array data.
+//
+// There are two possible representations for array data.
+//
+// - A string of characters in UTF-8 encoding enclosed in double quotes,
+//   using C syntax.  There can be only one string per line, thus the
+//   starting and ending double quote must be the first and last character
+//   in the line, respectively, ignoring whitespace before and after the
+//   string.  Space characters within the string are ignored too.  If there
+//   are multiple strings (in multiple lines), they are concatenated to a
+//   single string.  In the output, a string gets represented as a series of
+//   singles bytes, followed by a zero byte.  The enumeration values simply
+//   hold byte offsets to the start of the corresponding strings.
+//
+// - Data blocks enclosed in balanced braces, which get copied verbatim and
+//   which can span multiple lines.  The opening brace of a block must be
+//   the first character of a line (ignoring whitespace), and the closing
+//   brace the last (ignoring whitespace also).  The script appends a comma
+//   character after each block and counts the number of blocks to set the
+//   enumeration values.
+//
+// A section can contain either strings only or data blocks only.
+//
+// A comment line starts with `//'; it gets removed.  A preprocessor
+// directive line (using the standard syntax of `cpp') starts with `#' and
+// gets copied verbatim to both the enumeration and the array.  Whitespace
+// outside of a string is insignificant.
+//
+// Preprocessor directives are ignored while the script computes maximum
+// values; this essentially means that the maximum values can easily be too
+// large.  Given that the purpose of those values is to create local
+// fixed-size arrays at compile time for further processing of the blue zone
+// data, this isn't a problem.  Note the the final zero byte of a string is
+// not counted.  Note also that the count holds the number of UTF-8 encoded
+// characters, not bytes.
+
+
+// The blue zone string data, to be used in the blue stringsets below.
+
+AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
+
+  AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP
+    "БВЕПЗОСЭ"
+  AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM
+    "БВЕШЗОСЭ"
+  AF_BLUE_STRING_CYRILLIC_SMALL
+    "хпншезос"
+  AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER
+    "руф"
+
+  // we separate the letters with spaces to avoid ligatures;
+  // this is just for convenience to simplify reading
+  AF_BLUE_STRING_DEVANAGARI_BASE
+    "क म अ आ थ ध भ श"
+  AF_BLUE_STRING_DEVANAGARI_TOP
+    "ई ऐ ओ औ ि ी ो ौ"
+  // note that some fonts have extreme variation in the height of the
+  // round head elements; for this reason we also define the `base'
+  // blue zone, which must be always present
+  AF_BLUE_STRING_DEVANAGARI_HEAD
+    "क म अ आ थ ध भ श"
+  AF_BLUE_STRING_DEVANAGARI_BOTTOM
+    "ु ृ"
+
+  AF_BLUE_STRING_GREEK_CAPITAL_TOP
+    "ΓΒΕΖΘΟΩ"
+  AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM
+    "ΒΔΖΞΘΟ"
+  AF_BLUE_STRING_GREEK_SMALL_BETA_TOP
+    "βθδζλξ"
+  AF_BLUE_STRING_GREEK_SMALL
+    "αειοπστω"
+  AF_BLUE_STRING_GREEK_SMALL_DESCENDER
+    "βγημρφχψ"
+
+  AF_BLUE_STRING_HEBREW_TOP
+    "בדהחךכםס"
+  AF_BLUE_STRING_HEBREW_BOTTOM
+    "בטכםסצ"
+  AF_BLUE_STRING_HEBREW_DESCENDER
+    "קךןףץ"
+
+  AF_BLUE_STRING_LATIN_CAPITAL_TOP
+    "THEZOCQS"
+  AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM
+    "HEZLOCUS"
+  AF_BLUE_STRING_LATIN_SMALL_F_TOP
+    "fijkdbh"
+  AF_BLUE_STRING_LATIN_SMALL
+    "xzroesc"
+  AF_BLUE_STRING_LATIN_SMALL_DESCENDER
+    "pqgjy"
+
+  // we separate the letters with spaces to avoid ligatures;
+  // this is just for convenience to simplify reading
+  AF_BLUE_STRING_TELUGU_TOP
+    "ఇ ఌ ఙ ఞ ణ ఱ ౯"
+
+  AF_BLUE_STRING_TELUGU_BOTTOM
+    "అ క చ ర ఽ ౨ ౬"
+
+#ifdef AF_CONFIG_OPTION_CJK
+
+  AF_BLUE_STRING_CJK_TOP
+    "他们你來們到和地"
+    "对對就席我时時會"
+    "来為能舰說说这這"
+    "齊 |"
+    "军同已愿既星是景"
+    "民照现現理用置要"
+    "軍那配里開雷露面"
+    "顾"
+  AF_BLUE_STRING_CJK_BOTTOM
+    "个为人他以们你來"
+    "個們到和大对對就"
+    "我时時有来為要說"
+    "说 |"
+    "主些因它想意理生"
+    "當看着置者自著裡"
+    "过还进進過道還里"
+    "面"
+
+#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
+
+  AF_BLUE_STRING_CJK_LEFT
+    "些们你來們到和地"
+    "她将將就年得情最"
+    "样樣理能說说这這"
+    "通 |"
+    "即吗吧听呢品响嗎"
+    "师師收断斷明眼間"
+    "间际陈限除陳随際"
+    "隨"
+  AF_BLUE_STRING_CJK_RIGHT
+    "事前學将將情想或"
+    "政斯新样樣民沒没"
+    "然特现現球第經谁"
+    "起 |"
+    "例別别制动動吗嗎"
+    "增指明朝期构物确"
+    "种調调費费那都間"
+    "间"
+
+#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
+
+#endif /* AF_CONFIG_OPTION_CJK                */
+
+
+// The blue zone stringsets, as used in the script styles, cf. `afstyles.h'.
+//
+// The AF_BLUE_PROPERTY_XXX flags are defined in `afblue.h'; here some
+// explanations.
+//
+// A blue zone in general is defined by a reference and an overshoot line.
+// During the hinting process, all coordinate values between those two lines
+// are set equal to the reference value, provided that the blue zone is not
+// wider than 0.75 pixels (otherwise the blue zone gets ignored).  All
+// entries must have `AF_BLUE_STRING_MAX' as the final line.
+//
+// During the glyph analysis, edges are sorted from bottom to top, and then
+// sequentially checked, edge by edge, against the blue zones in the order
+// given below.
+//
+//
+// latin auto-hinter
+// -----------------
+//
+// Characters in a blue string are automatically classified as having a flat
+// (reference) or a round (overshoot) extremum.  The blue zone is then set
+// up by the mean values of all flat extrema and all round extrema,
+// respectively.  Only horizontal blue zones (i.e., adjusting vertical
+// coordinate values) are supported.
+//
+// For the latin auto-hinter, the overshoot should be larger than the
+// reference for top zones, and vice versa for bottom zones.
+//
+//   LATIN_TOP
+//     Take the maximum flat and round coordinate values of the blue string
+//     characters for computing the blue zone's reference and overshoot
+//     values.
+//
+//     If not set, take the minimum values.
+//
+//   LATIN_NEUTRAL
+//     Ignore round extrema and define the blue zone with flat values only.
+//     Both top and bottom of contours can match.  This is useful for
+//     scripts like Devanagari where vowel signs attach to the base
+//     character and are implemented as components of composite glyphs.
+//
+//     If not set, both round and flat extrema are taken into account.
+//     Additionally, only the top or the bottom of a contour can match,
+//     depending on the LATIN_TOP flag.
+//
+//     Neutral blue zones should always follow non-neutral blue zones.
+//
+//   LATIN_X_HEIGHT
+//     Scale all glyphs vertically from the corresponding script to make the
+//     reference line of this blue zone align on the grid.  The scaling
+//     takes place before all other blue zones get aligned to the grid.
+//     Only one blue character string of a script style can have this flag.
+//
+//   LATIN_LONG
+//     Apply an additional constraint for blue zone values: Don't
+//     necessarily use the extremum as-is but a segment of the topmost (or
+//     bottommost) contour that is longer than a heuristic threshold, and
+//     which is not too far away vertically from the real extremum.  This
+//     ensures that small bumps in the outline are ignored (for example, the
+//     `vertical serifs' found in many Hebrew glyph designs).
+//
+//     The segment must be at least EM/25 font units long, and the distance
+//     to the extremum must be smaller than EM/4.
+//
+//
+// cjk auto-hinter
+// ---------------
+//
+// Characters in a blue string are *not* automatically classified.  Instead,
+// first come the characters used for the overshoot value, then the
+// character `|', then the characters used for the reference value.  The
+// blue zone is then set up by the mean values of all reference values and
+// all overshoot values, respectively.  Both horizontal and vertical blue
+// zones (i.e., adjusting vertical and horizontal coordinate values,
+// respectively) are supported.
+//
+// For the cjk auto-hinter, the overshoot should be smaller than the
+// reference for top zones, and vice versa for bottom zones.
+//
+//   CJK_TOP
+//     Take the maximum flat and round coordinate values of the blue string
+//     characters.  If not set, take the minimum values.
+//
+//   CJK_RIGHT
+//     A synonym for CJK_TOP.  If CJK_HORIZ is set, this flag indicates the
+//     right blue zone, taking horizontal maximum values.
+//
+//   CJK_HORIZ
+//     Define a blue zone for horizontal hinting (i.e., vertical blue
+//     zones).  If not set, this is a blue zone for vertical hinting.
+
+
+AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
+
+  AF_BLUE_STRINGSET_CYRL
+    { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        }
+    { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM,  0                                 }
+    { AF_BLUE_STRING_CYRILLIC_SMALL,           AF_BLUE_PROPERTY_LATIN_TOP      |
+                                               AF_BLUE_PROPERTY_LATIN_X_HEIGHT   }
+    { AF_BLUE_STRING_CYRILLIC_SMALL,           0                                 }
+    { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0                                 }
+    { AF_BLUE_STRING_MAX,                      0                                 }
+
+  AF_BLUE_STRINGSET_DEVA
+    { AF_BLUE_STRING_DEVANAGARI_TOP,    AF_BLUE_PROPERTY_LATIN_TOP        }
+    { AF_BLUE_STRING_DEVANAGARI_HEAD,   AF_BLUE_PROPERTY_LATIN_TOP        }
+    { AF_BLUE_STRING_DEVANAGARI_BASE,   AF_BLUE_PROPERTY_LATIN_TOP      |
+                                        AF_BLUE_PROPERTY_LATIN_NEUTRAL  |
+                                        AF_BLUE_PROPERTY_LATIN_X_HEIGHT   }
+    { AF_BLUE_STRING_DEVANAGARI_BASE,   0                                 }
+    { AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0                                 }
+    { AF_BLUE_STRING_MAX,               0                                 }
+
+  AF_BLUE_STRINGSET_GREK
+    { AF_BLUE_STRING_GREEK_CAPITAL_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        }
+    { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM,  0                                 }
+    { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP,  AF_BLUE_PROPERTY_LATIN_TOP        }
+    { AF_BLUE_STRING_GREEK_SMALL,           AF_BLUE_PROPERTY_LATIN_TOP      |
+                                            AF_BLUE_PROPERTY_LATIN_X_HEIGHT   }
+    { AF_BLUE_STRING_GREEK_SMALL,           0                                 }
+    { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0                                 }
+    { AF_BLUE_STRING_MAX,                   0                                 }
+
+  AF_BLUE_STRINGSET_HEBR
+    { AF_BLUE_STRING_HEBREW_TOP,       AF_BLUE_PROPERTY_LATIN_TOP  |
+                                       AF_BLUE_PROPERTY_LATIN_LONG   }
+    { AF_BLUE_STRING_HEBREW_BOTTOM,    0                             }
+    { AF_BLUE_STRING_HEBREW_DESCENDER, 0                             }
+    { AF_BLUE_STRING_MAX,              0                             }
+
+  AF_BLUE_STRINGSET_LATN
+    { AF_BLUE_STRING_LATIN_CAPITAL_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        }
+    { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM,  0                                 }
+    { AF_BLUE_STRING_LATIN_SMALL_F_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        }
+    { AF_BLUE_STRING_LATIN_SMALL,           AF_BLUE_PROPERTY_LATIN_TOP      |
+                                            AF_BLUE_PROPERTY_LATIN_X_HEIGHT   }
+    { AF_BLUE_STRING_LATIN_SMALL,           0                                 }
+    { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0                                 }
+    { AF_BLUE_STRING_MAX,                   0                                 }
+
+  AF_BLUE_STRINGSET_TELU
+    { AF_BLUE_STRING_TELUGU_TOP,    AF_BLUE_PROPERTY_LATIN_TOP }
+    { AF_BLUE_STRING_TELUGU_BOTTOM, 0                          }
+    { AF_BLUE_STRING_MAX,           0                          }
+
+#ifdef AF_CONFIG_OPTION_CJK
+
+  AF_BLUE_STRINGSET_HANI
+    { AF_BLUE_STRING_CJK_TOP,    AF_BLUE_PROPERTY_CJK_TOP     }
+    { AF_BLUE_STRING_CJK_BOTTOM, 0                            }
+#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
+    { AF_BLUE_STRING_CJK_LEFT,   AF_BLUE_PROPERTY_CJK_HORIZ   }
+    { AF_BLUE_STRING_CJK_RIGHT,  AF_BLUE_PROPERTY_CJK_HORIZ |
+                                 AF_BLUE_PROPERTY_CJK_RIGHT   }
+#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
+    { AF_BLUE_STRING_MAX,        0                            }
+
+#endif /* AF_CONFIG_OPTION_CJK                */
+
+
+// END
diff --git a/src/autofit/afblue.h b/src/autofit/afblue.h
new file mode 100644 (file)
index 0000000..a861841
--- /dev/null
@@ -0,0 +1,203 @@
+/* This file has been generated by the Perl script `afblue.pl', */
+/* using data from file `afblue.dat'.                           */
+
+/***************************************************************************/
+/*                                                                         */
+/*  afblue.h                                                               */
+/*                                                                         */
+/*    Auto-fitter data for blue strings (specification).                   */
+/*                                                                         */
+/*  Copyright 2013, 2014 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 __AFBLUE_H__
+#define __AFBLUE_H__
+
+
+FT_BEGIN_HEADER
+
+
+  /* an auxiliary macro to decode a UTF-8 character -- since we only use */
+  /* hard-coded, self-converted data, no error checking is performed     */
+#define GET_UTF8_CHAR( ch, p )                    \
+          ch = (unsigned char)*p++;               \
+          if ( ch >= 0x80 )                       \
+          {                                       \
+            FT_UInt  len;                         \
+                                                  \
+                                                  \
+            if ( ch < 0xE0 )                      \
+            {                                     \
+              len = 1;                            \
+              ch &= 0x1F;                         \
+            }                                     \
+            else if ( ch < 0xF0 )                 \
+            {                                     \
+              len = 2;                            \
+              ch &= 0x0F;                         \
+            }                                     \
+            else                                  \
+            {                                     \
+              len = 3;                            \
+              ch &= 0x07;                         \
+            }                                     \
+                                                  \
+            for ( ; len > 0; len-- )              \
+              ch = ( ch << 6 ) | ( *p++ & 0x3F ); \
+          }
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****                    B L U E   S T R I N G S                    *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+  /* At the bottommost level, we define strings for finding blue zones. */
+
+
+#define AF_BLUE_STRING_MAX_LEN  51
+
+  /* The AF_Blue_String enumeration values are offsets into the */
+  /* `af_blue_strings' array.                                   */
+
+  typedef enum  AF_Blue_String_
+  {
+    AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 0,
+    AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 17,
+    AF_BLUE_STRING_CYRILLIC_SMALL = 34,
+    AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 51,
+    AF_BLUE_STRING_DEVANAGARI_BASE = 58,
+    AF_BLUE_STRING_DEVANAGARI_TOP = 83,
+    AF_BLUE_STRING_DEVANAGARI_HEAD = 108,
+    AF_BLUE_STRING_DEVANAGARI_BOTTOM = 133,
+    AF_BLUE_STRING_GREEK_CAPITAL_TOP = 140,
+    AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 155,
+    AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 168,
+    AF_BLUE_STRING_GREEK_SMALL = 181,
+    AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 198,
+    AF_BLUE_STRING_HEBREW_TOP = 215,
+    AF_BLUE_STRING_HEBREW_BOTTOM = 232,
+    AF_BLUE_STRING_HEBREW_DESCENDER = 245,
+    AF_BLUE_STRING_LATIN_CAPITAL_TOP = 256,
+    AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 265,
+    AF_BLUE_STRING_LATIN_SMALL_F_TOP = 274,
+    AF_BLUE_STRING_LATIN_SMALL = 282,
+    AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 290,
+    AF_BLUE_STRING_TELUGU_TOP = 296,
+    AF_BLUE_STRING_TELUGU_BOTTOM = 318,
+    af_blue_1_1 = 339,
+#ifdef AF_CONFIG_OPTION_CJK
+    AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1,
+    AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 153,
+    af_blue_1_1_1 = af_blue_1_1 + 304,
+#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
+    AF_BLUE_STRING_CJK_LEFT = af_blue_1_1_1 + 1,
+    AF_BLUE_STRING_CJK_RIGHT = af_blue_1_1_1 + 153,
+    af_blue_1_1_2 = af_blue_1_1_1 + 304,
+#else
+    af_blue_1_1_2 = af_blue_1_1_1 + 0,
+#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
+    af_blue_1_2 = af_blue_1_1_2 + 0,
+#else
+    af_blue_1_2 = af_blue_1_1 + 0,
+#endif /* AF_CONFIG_OPTION_CJK                */
+
+
+    AF_BLUE_STRING_MAX   /* do not remove */
+
+  } AF_Blue_String;
+
+
+  FT_LOCAL_ARRAY( char )
+  af_blue_strings[];
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****                 B L U E   S T R I N G S E T S                 *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+  /* The next level is to group blue strings into style-specific sets. */
+
+
+  /* Properties are specific to a writing system.  We assume that a given  */
+  /* blue string can't be used in more than a single writing system, which */
+  /* is a safe bet.                                                        */
+#define AF_BLUE_PROPERTY_LATIN_TOP       ( 1 << 0 )   /* must have value 1 */
+#define AF_BLUE_PROPERTY_LATIN_NEUTRAL   ( 1 << 1 )
+#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT  ( 1 << 2 )
+#define AF_BLUE_PROPERTY_LATIN_LONG      ( 1 << 3 )
+
+#define AF_BLUE_PROPERTY_CJK_TOP    ( 1 << 0 )        /* must have value 1 */
+#define AF_BLUE_PROPERTY_CJK_HORIZ  ( 1 << 1 )        /* must have value 2 */
+#define AF_BLUE_PROPERTY_CJK_RIGHT  AF_BLUE_PROPERTY_CJK_TOP
+
+
+#define AF_BLUE_STRINGSET_MAX_LEN  7
+
+  /* The AF_Blue_Stringset enumeration values are offsets into the */
+  /* `af_blue_stringsets' array.                                   */
+
+  typedef enum  AF_Blue_Stringset_
+  {
+    AF_BLUE_STRINGSET_CYRL = 0,
+    AF_BLUE_STRINGSET_DEVA = 6,
+    AF_BLUE_STRINGSET_GREK = 12,
+    AF_BLUE_STRINGSET_HEBR = 19,
+    AF_BLUE_STRINGSET_LATN = 23,
+    AF_BLUE_STRINGSET_TELU = 30,
+    af_blue_2_1 = 33,
+#ifdef AF_CONFIG_OPTION_CJK
+    AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,
+    af_blue_2_1_1 = af_blue_2_1 + 2,
+#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
+    af_blue_2_1_2 = af_blue_2_1_1 + 2,
+#else
+    af_blue_2_1_2 = af_blue_2_1_1 + 0,
+#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
+    af_blue_2_2 = af_blue_2_1_2 + 1,
+#else
+    af_blue_2_2 = af_blue_2_1 + 0,
+#endif /* AF_CONFIG_OPTION_CJK                */
+
+
+    AF_BLUE_STRINGSET_MAX   /* do not remove */
+
+  } AF_Blue_Stringset;
+
+
+  typedef struct  AF_Blue_StringRec_
+  {
+    AF_Blue_String  string;
+    FT_UShort       properties;
+
+  } AF_Blue_StringRec;
+
+
+  FT_LOCAL_ARRAY( AF_Blue_StringRec )
+  af_blue_stringsets[];
+
+/* */
+
+FT_END_HEADER
+
+
+#endif /* __AFBLUE_H__ */
+
+
+/* END */
diff --git a/src/autofit/afblue.hin b/src/autofit/afblue.hin
new file mode 100644 (file)
index 0000000..0b4b48d
--- /dev/null
@@ -0,0 +1,142 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afblue.h                                                               */
+/*                                                                         */
+/*    Auto-fitter data for blue strings (specification).                   */
+/*                                                                         */
+/*  Copyright 2013, 2014 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 __AFBLUE_H__
+#define __AFBLUE_H__
+
+
+FT_BEGIN_HEADER
+
+
+  /* an auxiliary macro to decode a UTF-8 character -- since we only use */
+  /* hard-coded, self-converted data, no error checking is performed     */
+#define GET_UTF8_CHAR( ch, p )                    \
+          ch = (unsigned char)*p++;               \
+          if ( ch >= 0x80 )                       \
+          {                                       \
+            FT_UInt  len;                         \
+                                                  \
+                                                  \
+            if ( ch < 0xE0 )                      \
+            {                                     \
+              len = 1;                            \
+              ch &= 0x1F;                         \
+            }                                     \
+            else if ( ch < 0xF0 )                 \
+            {                                     \
+              len = 2;                            \
+              ch &= 0x0F;                         \
+            }                                     \
+            else                                  \
+            {                                     \
+              len = 3;                            \
+              ch &= 0x07;                         \
+            }                                     \
+                                                  \
+            for ( ; len > 0; len-- )              \
+              ch = ( ch << 6 ) | ( *p++ & 0x3F ); \
+          }
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****                    B L U E   S T R I N G S                    *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+  /* At the bottommost level, we define strings for finding blue zones. */
+
+
+#define AF_BLUE_STRING_MAX_LEN  @AF_BLUE_STRING_MAX_LEN@
+
+  /* The AF_Blue_String enumeration values are offsets into the */
+  /* `af_blue_strings' array.                                   */
+
+  typedef enum  AF_Blue_String_
+  {
+@AF_BLUE_STRING_ENUM@
+
+    AF_BLUE_STRING_MAX   /* do not remove */
+
+  } AF_Blue_String;
+
+
+  FT_LOCAL_ARRAY( char )
+  af_blue_strings[];
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****                 B L U E   S T R I N G S E T S                 *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+  /* The next level is to group blue strings into style-specific sets. */
+
+
+  /* Properties are specific to a writing system.  We assume that a given  */
+  /* blue string can't be used in more than a single writing system, which */
+  /* is a safe bet.                                                        */
+#define AF_BLUE_PROPERTY_LATIN_TOP       ( 1 << 0 )   /* must have value 1 */
+#define AF_BLUE_PROPERTY_LATIN_NEUTRAL   ( 1 << 1 )
+#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT  ( 1 << 2 )
+#define AF_BLUE_PROPERTY_LATIN_LONG      ( 1 << 3 )
+
+#define AF_BLUE_PROPERTY_CJK_TOP    ( 1 << 0 )        /* must have value 1 */
+#define AF_BLUE_PROPERTY_CJK_HORIZ  ( 1 << 1 )        /* must have value 2 */
+#define AF_BLUE_PROPERTY_CJK_RIGHT  AF_BLUE_PROPERTY_CJK_TOP
+
+
+#define AF_BLUE_STRINGSET_MAX_LEN  @AF_BLUE_STRINGSET_MAX_LEN@
+
+  /* The AF_Blue_Stringset enumeration values are offsets into the */
+  /* `af_blue_stringsets' array.                                   */
+
+  typedef enum  AF_Blue_Stringset_
+  {
+@AF_BLUE_STRINGSET_ENUM@
+
+    AF_BLUE_STRINGSET_MAX   /* do not remove */
+
+  } AF_Blue_Stringset;
+
+
+  typedef struct  AF_Blue_StringRec_
+  {
+    AF_Blue_String  string;
+    FT_UShort       properties;
+
+  } AF_Blue_StringRec;
+
+
+  FT_LOCAL_ARRAY( AF_Blue_StringRec )
+  af_blue_stringsets[];
+
+/* */
+
+FT_END_HEADER
+
+
+#endif /* __AFBLUE_H__ */
+
+
+/* END */
index 8e407c8..048e0e7 100644 (file)
@@ -2,9 +2,9 @@
 /*                                                                         */
 /*  afcjk.c                                                                */
 /*                                                                         */
-/*    Auto-fitter hinting routines for CJK script (body).                  */
+/*    Auto-fitter hinting routines for CJK writing system (body).          */
 /*                                                                         */
-/*  Copyright 2006-2012 by                                                 */
+/*  Copyright 2006-2014 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -26,7 +26,8 @@
 #include FT_ADVANCES_H
 #include FT_INTERNAL_DEBUG_H
 
-#include "aftypes.h"
+#include "afglobal.h"
+#include "afpic.h"
 #include "aflatin.h"
 
 
 
   FT_LOCAL_DEF( void )
   af_cjk_metrics_init_widths( AF_CJKMetrics  metrics,
-                              FT_Face        face,
-                              FT_ULong       charcode )
+                              FT_Face        face )
   {
     /* scan the array of segments in each direction */
     AF_GlyphHintsRec  hints[1];
 
 
+    FT_TRACE5(( "\n"
+                "cjk standard widths computation (style `%s')\n"
+                "===================================================\n"
+                "\n",
+                af_style_names[metrics->root.style_class->style] ));
+
     af_glyph_hints_init( hints, face->memory );
 
     metrics->axis[AF_DIMENSION_HORZ].width_count = 0;
 
     {
       FT_Error          error;
-      FT_UInt           glyph_index;
+      FT_ULong          glyph_index;
+      FT_Long           y_offset;
       int               dim;
       AF_CJKMetricsRec  dummy[1];
       AF_Scaler         scaler = &dummy->root.scaler;
 
+#ifdef FT_CONFIG_OPTION_PIC
+      AF_FaceGlobals  globals = metrics->root.globals;
+#endif
 
-      glyph_index = FT_Get_Char_Index( face, charcode );
-      if ( glyph_index == 0 )
-        goto Exit;
+      AF_StyleClass   style_class  = metrics->root.style_class;
+      AF_ScriptClass  script_class = AF_SCRIPT_CLASSES_GET
+                                       [style_class->script];
+
+      FT_UInt32  standard_char;
+
+
+      standard_char = script_class->standard_char1;
+      af_get_char_index( &metrics->root,
+                         standard_char,
+                         &glyph_index,
+                         &y_offset );
+      if ( !glyph_index )
+      {
+        if ( script_class->standard_char2 )
+        {
+          standard_char = script_class->standard_char2;
+          af_get_char_index( &metrics->root,
+                             standard_char,
+                             &glyph_index,
+                             &y_offset );
+          if ( !glyph_index )
+          {
+            if ( script_class->standard_char3 )
+            {
+              standard_char = script_class->standard_char3;
+              af_get_char_index( &metrics->root,
+                                 standard_char,
+                                 &glyph_index,
+                                 &y_offset );
+              if ( !glyph_index )
+                goto Exit;
+            }
+            else
+              goto Exit;
+          }
+        }
+        else
+          goto Exit;
+      }
+
+      FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n",
+                  standard_char, glyph_index ));
 
       error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
       if ( error || face->glyph->outline.n_points <= 0 )
       scaler->render_mode = FT_RENDER_MODE_NORMAL;
       scaler->flags       = 0;
 
-      af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy );
+      af_glyph_hints_rescale( hints, (AF_StyleMetrics)dummy );
 
       error = af_glyph_hints_reload( hints, &face->glyph->outline );
       if ( error )
         FT_UInt       num_widths = 0;
 
 
-        error = af_latin_hints_compute_segments( hints, (AF_Dimension)dim );
+        error = af_latin_hints_compute_segments( hints,
+                                                 (AF_Dimension)dim );
         if ( error )
           goto Exit;
 
-        af_latin_hints_link_segments( hints, (AF_Dimension)dim );
+        af_latin_hints_link_segments( hints,
+                                      0,
+                                      NULL,
+                                      (AF_Dimension)dim );
 
         seg   = axhints->segments;
         limit = seg + axhints->num_segments;
           }
         }
 
-        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->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 );
   }
 
 
-#define AF_CJK_MAX_TEST_CHARACTERS  32
+  /* Find all blue zones. */
 
-
-  /* Each blue zone has two types of fill and unfill, this is, */
-  /* filling the entire glyph square or not.                   */
-
-  enum
+  static void
+  af_cjk_metrics_init_blues( AF_CJKMetrics  metrics,
+                             FT_Face        face )
   {
-    AF_CJK_BLUE_TYPE_FILL,
-    AF_CJK_BLUE_TYPE_UNFILL,
-    AF_CJK_BLUE_TYPE_MAX
-  };
+    FT_Pos      fills[AF_BLUE_STRING_MAX_LEN];
+    FT_Pos      flats[AF_BLUE_STRING_MAX_LEN];
 
+    FT_Int      num_fills;
+    FT_Int      num_flats;
 
-  /* 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 */
-  };
+    FT_Bool     fill;
 
+    AF_CJKBlue  blue;
+    FT_Error    error;
+    AF_CJKAxis  axis;
+    FT_Outline  outline;
 
-  /* Calculate blue zones for all the CJK_BLUE_XXX's. */
+    AF_StyleClass  sc = metrics->root.style_class;
 
-  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];
+    AF_Blue_Stringset         bss = sc->blue_stringset;
+    const AF_Blue_StringRec*  bs  = &af_blue_stringsets[bss];
 
-    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;
+    /* we walk over the blue character strings as specified in the   */
+    /* style's entry in the `af_blue_stringset' array, computing its */
+    /* extremum points (depending on the string properties)          */
 
-#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
+    FT_TRACE5(( "cjk blue zones computation\n"
+                "==========================\n"
+                "\n" ));
 
+    for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ )
+    {
+      const char*  p = &af_blue_strings[bs->string];
+      FT_Pos*      blue_ref;
+      FT_Pos*      blue_shoot;
 
-    /* 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" ));
+      if ( AF_CJK_IS_HORIZ_BLUE( bs ) )
+        axis = &metrics->axis[AF_DIMENSION_HORZ];
+      else
+        axis = &metrics->axis[AF_DIMENSION_VERT];
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+      {
+        FT_String*  cjk_blue_name[4] =
+        {
+          (FT_String*)"bottom",    /* --   , --  */
+          (FT_String*)"top",       /* --   , TOP */
+          (FT_String*)"left",      /* HORIZ, --  */
+          (FT_String*)"right"      /* HORIZ, TOP */
+        };
 
-    for ( bb = 0; bb < AF_CJK_BLUE_MAX; bb++ )
-    {
-      FT_Int   fill_type;
-      FT_Pos*  blue_ref;
-      FT_Pos*  blue_shoot;
 
+        FT_TRACE5(( "blue zone %d (%s):\n",
+                    axis->blue_count,
+                    cjk_blue_name[AF_CJK_IS_HORIZ_BLUE( bs ) |
+                                  AF_CJK_IS_TOP_BLUE( bs )   ] ));
+      }
+#endif /* FT_DEBUG_LEVEL_TRACE */
 
       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 );
+      fill = 1;  /* start with characters that define fill values */
+      FT_TRACE5(( "  [overshoot values]\n" ));
 
+      while ( *p )
+      {
+        FT_ULong    ch;
+        FT_ULong    glyph_index;
+        FT_Long     y_offset;
+        FT_Pos      best_pos;       /* same as points.y or points.x, resp. */
+        FT_Int      best_point;
+        FT_Vector*  points;
 
-        FT_TRACE5(( "cjk blue %s/%s\n", cjk_blue_name[bb],
-                                        cjk_blue_type_name[fill_type] ));
 
+        GET_UTF8_CHAR( ch, p );
 
-        for ( ; p < limit && *p; p++ )
+        /* switch to characters that define flat values */
+        if ( ch == '|' )
         {
-          FT_UInt     glyph_index;
-          FT_Pos      best_pos; /* same as points.y */
-          FT_Int      best_point;
-          FT_Vector*  points;
+          fill = 0;
+          FT_TRACE5(( "  [reference values]\n" ));
+          continue;
+        }
 
+        /* load the character in the face -- skip unknown or empty ones */
+        af_get_char_index( &metrics->root, ch, &glyph_index, &y_offset );
+        if ( glyph_index == 0 )
+        {
+          FT_TRACE5(( "  U+%04lX unavailable\n", ch ));
+          continue;
+        }
 
-          FT_TRACE5(( "  U+%lX...", *p ));
+        error   = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
+        outline = face->glyph->outline;
+        if ( error || outline.n_points <= 0 )
+        {
+          FT_TRACE5(( "  U+%04lX contains no outlines\n", ch ));
+          continue;
+        }
 
-          /* 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;
-          }
+        /* now compute min or max point indices and coordinates */
+        points     = outline.points;
+        best_point = -1;
+        best_pos   = 0;  /* make compiler happy */
 
-          error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
-          if ( error || glyph->outline.n_points <= 0 )
-          {
-            FT_TRACE5(( "no outline\n" ));
-            continue;
-          }
+        {
+          FT_Int  nn;
+          FT_Int  first = 0;
+          FT_Int  last  = -1;
 
-          /* now compute min or max point indices and coordinates */
-          points     = glyph->outline.points;
-          best_point = -1;
-          best_pos   = 0;  /* make compiler happy */
 
+          for ( nn = 0; nn < outline.n_contours; first = last + 1, nn++ )
           {
-            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;
+            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 )
-                continue;
+            /* 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 )
+            if ( AF_CJK_IS_HORIZ_BLUE( bs ) )
+            {
+              if ( AF_CJK_IS_RIGHT_BLUE( bs ) )
               {
-              case AF_CJK_BLUE_TOP:
                 for ( pp = first; pp <= last; pp++ )
-                  if ( best_point < 0 || points[pp].y > best_pos )
+                  if ( best_point < 0 || points[pp].x > best_pos )
                   {
                     best_point = pp;
-                    best_pos   = points[pp].y;
+                    best_pos   = points[pp].x;
                   }
-                break;
-
-              case AF_CJK_BLUE_BOTTOM:
+              }
+              else
+              {
                 for ( pp = first; pp <= last; pp++ )
-                  if ( best_point < 0 || points[pp].y < best_pos )
+                  if ( best_point < 0 || points[pp].x < best_pos )
                   {
                     best_point = pp;
-                    best_pos   = points[pp].y;
+                    best_pos   = points[pp].x;
                   }
-                break;
-
-              case AF_CJK_BLUE_LEFT:
+              }
+            }
+            else
+            {
+              if ( AF_CJK_IS_TOP_BLUE( bs ) )
+              {
                 for ( pp = first; pp <= last; pp++ )
-                  if ( best_point < 0 || points[pp].x < best_pos )
+                  if ( best_point < 0 || points[pp].y > best_pos )
                   {
                     best_point = pp;
-                    best_pos   = points[pp].x;
+                    best_pos   = points[pp].y;
                   }
-                break;
-
-              case AF_CJK_BLUE_RIGHT:
+              }
+              else
+              {
                 for ( pp = first; pp <= last; pp++ )
-                  if ( best_point < 0 || points[pp].x > best_pos )
+                  if ( best_point < 0 || points[pp].y < best_pos )
                   {
                     best_point = pp;
-                    best_pos   = points[pp].x;
+                    best_pos   = points[pp].y;
                   }
-                break;
-
-              default:
-                ;
               }
             }
-            FT_TRACE5(( "best_pos=%5ld\n", best_pos ));
           }
 
-          if ( fill )
-            fills[num_fills++] = best_pos;
-          else
-            flats[num_flats++] = best_pos;
+          FT_TRACE5(( "  U+%04lX: best_pos = %5ld\n", ch, 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" ));
+        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 );
+      /* we have computed the contents of the `fill' and `flats' tables,   */
+      /* now determine the reference and overshoot position of the blue -- */
+      /* we simply take the median value after a simple sort               */
       af_sort_pos( num_fills, fills );
+      af_sort_pos( num_flats, flats );
 
-      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;
+      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_ref   =
         *blue_shoot = fills[num_fills / 2];
       }
       else if ( num_fills == 0 )
       {
-        *blue_ref   = flats[num_flats / 2];
+        *blue_ref   =
         *blue_shoot = flats[num_flats / 2];
       }
       else
         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;
+        /* AF_CJK_IS_TOP_BLUE covers `right' and `top' */
+        if ( AF_CJK_IS_TOP_BLUE( bs ) ^ under_ref )
+        {
+          *blue_ref   =
+          *blue_shoot = ( shoot + ref ) / 2;
+
+          FT_TRACE5(( "  [reference smaller than overshoot,"
+                      " taking mean value]\n" ));
+        }
       }
 
       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;
+      if ( AF_CJK_IS_TOP_BLUE( bs ) )
+        blue->flags |= AF_CJK_BLUE_TOP;
 
-      FT_TRACE5(( "-- cjk %s bluezone ref = %ld shoot = %ld\n",
-                  cjk_blue_name[bb], *blue_ref, *blue_shoot ));
+      FT_TRACE5(( "    -> reference = %ld\n"
+                  "       overshoot = %ld\n",
+                  *blue_ref, *blue_shoot ));
     }
 
+    FT_TRACE5(( "\n" ));
+
     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_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;
+      FT_ULong  glyph_index;
+      FT_Long   y_offset;
 
 
-      glyph_index = FT_Get_Char_Index( face, i );
+      af_get_char_index( &metrics->root, i, &glyph_index, &y_offset );
       if ( glyph_index == 0 )
         continue;
 
   }
 
 
+  /* Initialize global metrics. */
+
   FT_LOCAL_DEF( FT_Error )
   af_cjk_metrics_init( AF_CJKMetrics  metrics,
                        FT_Face        face )
 
     metrics->units_per_em = face->units_per_EM;
 
-    if ( FT_Select_Charmap( face, FT_ENCODING_UNICODE ) )
-      face->charmap = NULL;
-    else
+    if ( !FT_Select_Charmap( face, FT_ENCODING_UNICODE ) )
     {
-      af_cjk_metrics_init_widths( metrics, face, 0x7530 );
-      af_cjk_metrics_init_blues( metrics, face, af_cjk_hani_blue_chars );
+      af_cjk_metrics_init_widths( metrics, face );
+      af_cjk_metrics_init_blues( metrics, face );
       af_cjk_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_cjk_metrics_scale_dim( AF_CJKMetrics  metrics,
                             AF_Scaler      scaler,
     FT_UInt     nn;
 
 
-    axis = &metrics->axis[dim];
-
     if ( dim == AF_DIMENSION_HORZ )
     {
       scale = scaler->x_scale;
       delta = scaler->y_delta;
     }
 
+    axis = &metrics->axis[dim];
+
     if ( axis->org_scale == scale && axis->org_delta == delta )
       return;
 
 
         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 ));
+        FT_TRACE5(( ">> active cjk blue zone %c%d[%ld/%ld]:\n"
+                    "     ref:   cur=%.2f fit=%.2f\n"
+                    "     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;
       }
   }
 
 
+  /* Scale global values in both directions. */
+
   FT_LOCAL_DEF( void )
   af_cjk_metrics_scale( AF_CJKMetrics  metrics,
                         AF_Scaler      scaler )
   {
+    /* we copy the whole structure since the x and y scaling values */
+    /* are not modified, contrary to e.g. the `latin' auto-hinter   */
     metrics->root.scaler = *scaler;
 
     af_cjk_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ );
   /*************************************************************************/
   /*************************************************************************/
 
+
+  /* Walk over all contours and compute its segments. */
+
   static FT_Error
   af_cjk_hints_compute_segments( AF_GlyphHints  hints,
                                  AF_Dimension   dim )
     {
       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;
 
 
       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;
       }
     }
 
-    return AF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     /* now compare each segment to the others */
     for ( seg1 = segments; seg1 < segment_limit; seg1++ )
     {
-      /* the fake segments are for metrics hinting only */
-      if ( seg1->first == seg1->last )
-        continue;
-
       if ( seg1->dir != major_dir )
         continue;
 
                               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_CJKAxis    laxis  = &((AF_CJKMetrics)hints->metrics)->axis[dim];
 
 
     for ( seg = segments; seg < segment_limit; seg++ )
     {
-      AF_Edge  found = 0;
+      AF_Edge  found = NULL;
       FT_Pos   best  = 0xFFFFU;
       FT_Int   ee;
 
           /* 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
             {
-              link1 = seg1->link;
+              AF_Segment  link1 = seg1->link;
+
+
               if ( link1 )
               {
                 dist2 = AF_SEGMENT_DIST( link, link1 );
 
         edge->first    = seg;
         edge->last     = seg;
+        edge->dir      = seg->dir;
         edge->fpos     = seg->pos;
-        edge->opos     = edge->pos = FT_MulFix( seg->pos, scale );
+        edge->opos     = FT_MulFix( seg->pos, scale );
+        edge->pos      = edge->opos;
         seg->edge_next = seg;
-        edge->dir      = seg->dir;
       }
       else
       {
       }
     }
 
-    /*********************************************************************/
-    /*                                                                   */
-    /* Good, we now compute each edge's properties according to segments */
-    /* found on its position.  Basically, these are as follows.          */
-    /*                                                                   */
-    /*  - 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                           */
-    /*                                                                   */
-    /* Note that removing this loop and setting the `edge' field of each */
-    /* segment directly in the code above slows down execution speed for */
-    /* some reasons on platforms like the Sun.                           */
+    /******************************************************************/
+    /*                                                                */
+    /* 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                       */
 
+    /*
+     * Note that removing this loop and setting the `edge' field of each
+     * segment directly in the code above slows down execution speed for
+     * some reasons on platforms like the Sun.
+     */
     {
       AF_Edge  edges      = axis->edges;
       AF_Edge  edge_limit = edges + axis->num_edges;
   }
 
 
+  /* Detect segments and edges for given dimension. */
+
   static FT_Error
   af_cjk_hints_detect_features( AF_GlyphHints  hints,
                                 AF_Dimension   dim )
   }
 
 
+  /* Compute all edges which lie within blue zones. */
+
   FT_LOCAL_DEF( void )
   af_cjk_hints_compute_blue_edges( AF_GlyphHints  hints,
                                    AF_CJKMetrics  metrics,
         /* 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 );
+        is_top_right_blue =
+          (FT_Byte)( ( blue->flags & AF_CJK_BLUE_TOP ) != 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 */
   }
 
 
+  /* Initalize hinting engine. */
+
   FT_LOCAL_DEF( FT_Error )
   af_cjk_hints_init( AF_GlyphHints  hints,
                      AF_CJKMetrics  metrics )
     FT_UInt32       scaler_flags, other_flags;
 
 
-    af_glyph_hints_rescale( hints, (AF_ScriptMetrics)metrics );
+    af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
 
     /*
      *  correct x_scale and y_scale when needed, since they may have
     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_cjk_snap_width( AF_Width  widths,
   }
 
 
-  /* compute the snapped width of a given stem */
+  /* Compute the snapped width of a given stem.                          */
+  /* There is a lot of voodoo in this function; changing the hard-coded  */
+  /* parameters influence the whole hinting process.                     */
 
   static FT_Pos
   af_cjk_compute_stem_width( AF_GlyphHints  hints,
                              AF_Edge_Flags  base_flags,
                              AF_Edge_Flags  stem_flags )
   {
-    AF_CJKMetrics  metrics  = (AF_CJKMetrics) hints->metrics;
-    AF_CJKAxis     axis     = & metrics->axis[dim];
+    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 );
   }
 
 
-  /* align one stem edge relative to the previous stem edge */
+  /* Align one stem edge relative to the previous stem edge. */
 
   static void
   af_cjk_align_linked_edge( AF_GlyphHints  hints,
 
 
     stem_edge->pos = base_edge->pos + fitted_width;
+
+    FT_TRACE5(( "  CJKLINK: edge %d @%d (opos=%.2f) linked to %.2f,"
+                " dist was %.2f, now %.2f\n",
+                stem_edge - hints->axis[dim].edges, stem_edge->fpos,
+                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_cjk_align_serif_edge( AF_GlyphHints  hints,
                            AF_Edge        base,
   }
 
 
+  /* The main grid-fitting routine. */
+
   static void
   af_cjk_hint_edges( AF_GlyphHints  hints,
                      AF_Dimension   dim )
     FT_Bool       has_last_stem = FALSE;
     FT_Pos        last_stem_pos = 0;
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+    FT_UInt       num_actions = 0;
+#endif
+
+
+    FT_TRACE5(( "cjk %s edge hinting (style `%s')\n",
+                dim == AF_DIMENSION_VERT ? "horizontal" : "vertical",
+                af_style_names[hints->metrics->style_class->style] ));
 
     /* 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 ) )
     {
         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 ));
+#ifdef FT_DEBUG_LEVEL_TRACE
+        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 ));
+
+        num_actions++;
+#endif
 
         edge1->pos    = blue->fit;
         edge1->flags |= AF_EDGE_DONE;
         {
           af_cjk_align_linked_edge( hints, dim, edge1, edge2 );
           edge2->flags |= AF_EDGE_DONE;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+          num_actions++;
+#endif
         }
 
         if ( !anchor )
       }
 
       /* now align the stem */
+
       /* this should not happen, but it's better to be safe */
       if ( edge2->blue_edge )
       {
 
         af_cjk_align_linked_edge( hints, dim, edge2, edge );
         edge->flags |= AF_EDGE_DONE;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+        num_actions++;
+#endif
+
         continue;
       }
 
       {
         af_cjk_align_linked_edge( hints, dim, edge2, edge );
         edge->flags |= AF_EDGE_DONE;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+        num_actions++;
+#endif
+
         /* We rarely reaches here it seems;
          * usually the two edges belonging
          * to one stem are marked as DONE together
     }
 
     if ( !skipped )
-      return;
+      goto Exit;
 
     /*
      *  now hint the remaining edges (serifs and single) in order
     }
 
     if ( !skipped )
-      return;
+      goto Exit;
 
     for ( edge = edges; edge < edge_limit; edge++ )
     {
         }
       }
     }
+
+  Exit:
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+    if ( !num_actions )
+      FT_TRACE5(( "  (none)\n" ));
+    FT_TRACE5(( "\n" ));
+#endif
+
+    return;
   }
 
 
   }
 
 
+  /* Apply the complete hinting algorithm to a CJK glyph. */
+
   FT_LOCAL_DEF( FT_Error )
   af_cjk_hints_apply( AF_GlyphHints  hints,
                       FT_Outline*    outline,
   /*************************************************************************/
 
 
-  /* this corresponds to Unicode 6.0 */
+  AF_DEFINE_WRITING_SYSTEM_CLASS(
+    af_cjk_writing_system_class,
 
-  static const AF_Script_UniRangeRec  af_cjk_uniranges[] =
-  {
-    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(  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(  0x3200UL,  0x32FFUL ),  /* Enclosed CJK Letters and Months         */
-    AF_UNIRANGE_REC(  0x3300UL,  0x33FFUL ),  /* CJK Compatibility                       */
-    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(  0xFE10UL,  0xFE1FUL ),  /* Vertical 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( 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_DEFINE_SCRIPT_CLASS( af_cjk_script_class,
-    AF_SCRIPT_CJK,
-    af_cjk_uniranges,
+    AF_WRITING_SYSTEM_CJK,
 
     sizeof ( AF_CJKMetricsRec ),
 
-    (AF_Script_InitMetricsFunc) af_cjk_metrics_init,
-    (AF_Script_ScaleMetricsFunc)af_cjk_metrics_scale,
-    (AF_Script_DoneMetricsFunc) NULL,
+    (AF_WritingSystem_InitMetricsFunc) af_cjk_metrics_init,
+    (AF_WritingSystem_ScaleMetricsFunc)af_cjk_metrics_scale,
+    (AF_WritingSystem_DoneMetricsFunc) NULL,
 
-    (AF_Script_InitHintsFunc)   af_cjk_hints_init,
-    (AF_Script_ApplyHintsFunc)  af_cjk_hints_apply
+    (AF_WritingSystem_InitHintsFunc)   af_cjk_hints_init,
+    (AF_WritingSystem_ApplyHintsFunc)  af_cjk_hints_apply
   )
 
+
 #else /* !AF_CONFIG_OPTION_CJK */
 
-  static const AF_Script_UniRangeRec  af_cjk_uniranges[] =
-  {
-    AF_UNIRANGE_REC( 0UL, 0UL )
-  };
 
+  AF_DEFINE_WRITING_SYSTEM_CLASS(
+    af_cjk_writing_system_class,
 
-  AF_DEFINE_SCRIPT_CLASS( af_cjk_script_class,
-    AF_SCRIPT_CJK,
-    af_cjk_uniranges,
+    AF_WRITING_SYSTEM_CJK,
 
     sizeof ( AF_CJKMetricsRec ),
 
-    (AF_Script_InitMetricsFunc) NULL,
-    (AF_Script_ScaleMetricsFunc)NULL,
-    (AF_Script_DoneMetricsFunc) NULL,
+    (AF_WritingSystem_InitMetricsFunc) NULL,
+    (AF_WritingSystem_ScaleMetricsFunc)NULL,
+    (AF_WritingSystem_DoneMetricsFunc) NULL,
 
-    (AF_Script_InitHintsFunc)   NULL,
-    (AF_Script_ApplyHintsFunc)  NULL
+    (AF_WritingSystem_InitHintsFunc)   NULL,
+    (AF_WritingSystem_ApplyHintsFunc)  NULL
   )
 
+
 #endif /* !AF_CONFIG_OPTION_CJK */
 
 
index 8416c0d..4dd4f39 100644 (file)
@@ -2,9 +2,9 @@
 /*                                                                         */
 /*  afcjk.h                                                                */
 /*                                                                         */
-/*    Auto-fitter hinting routines for CJK script (specification).         */
+/*    Auto-fitter hinting routines for CJK writing system (specification). */
 /*                                                                         */
-/*  Copyright 2006, 2007, 2011 by                                          */
+/*  Copyright 2006, 2007, 2011-2014 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 FT_BEGIN_HEADER
 
 
-  /* the CJK-specific script class */
+  /* the CJK-specific writing system */
 
-  AF_DECLARE_SCRIPT_CLASS(af_cjk_script_class)
+  AF_DECLARE_WRITING_SYSTEM_CLASS( af_cjk_writing_system_class )
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****              C J K   G L O B A L   M E T R I C S              *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
 
-  /* 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_IS_TOP_BLUE( b ) \
+          ( (b)->properties & AF_BLUE_PROPERTY_CJK_TOP )
+#define AF_CJK_IS_HORIZ_BLUE( b ) \
+          ( (b)->properties & AF_BLUE_PROPERTY_CJK_HORIZ )
+#define AF_CJK_IS_RIGHT_BLUE  AF_CJK_IS_TOP_BLUE
 
 #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_ACTIVE     = 1 << 0,  /* set if zone height is <= 3/4px */
+    AF_CJK_BLUE_TOP        = 1 << 1,  /* result of AF_CJK_IS_TOP_BLUE   */
+    AF_CJK_BLUE_ADJUSTMENT = 1 << 2,  /* used for scale adjustment      */
+                                      /* optimization                   */
     AF_CJK_BLUE_FLAG_MAX
   };
 
@@ -77,16 +79,16 @@ FT_BEGIN_HEADER
     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;
+    FT_UInt        width_count;                   /* number of used widths */
+    AF_WidthRec    widths[AF_CJK_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? */
 
     /* used for horizontal metrics too for CJK */
     FT_Bool        control_overshoot;
     FT_UInt        blue_count;
-    AF_CJKBlueRec  blues[AF_CJK_BLUE_MAX];
+    AF_CJKBlueRec  blues[AF_BLUE_STRINGSET_MAX];
 
     FT_Fixed       org_scale;
     FT_Pos         org_delta;
@@ -96,13 +98,14 @@ FT_BEGIN_HEADER
 
   typedef struct  AF_CJKMetricsRec_
   {
-    AF_ScriptMetricsRec  root;
-    FT_UInt              units_per_em;
-    AF_CJKAxisRec        axis[AF_DIMENSION_MAX];
+    AF_StyleMetricsRec  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 )
   af_cjk_metrics_init( AF_CJKMetrics  metrics,
                        FT_Face        face );
@@ -120,15 +123,15 @@ FT_BEGIN_HEADER
                       FT_Outline*    outline,
                       AF_CJKMetrics  metrics );
 
-  /* Shared. called from afindic.c */
+  /* 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,
-                              FT_ULong       charcode );
+                              FT_Face        face );
+#endif /* AF_CONFIG_OPTION_CJK */
 
 
 /* */
diff --git a/src/autofit/afcover.h b/src/autofit/afcover.h
new file mode 100644 (file)
index 0000000..d5ac969
--- /dev/null
@@ -0,0 +1,105 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afcover.h                                                              */
+/*                                                                         */
+/*    Auto-fitter coverages (specification only).                          */
+/*                                                                         */
+/*  Copyright 2013, 2014 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 header file can be included multiple times. */
+  /* Define `COVERAGE' as needed.                     */
+
+
+  /* Add new coverages here.  The first and second arguments are the   */
+  /* coverage name in lowercase and uppercase, respectively, followed  */
+  /* by a description string.  The last four arguments are the four    */
+  /* characters defining the corresponding OpenType feature.           */
+
+#if 0
+  /* XXX: It's not possible to define blue zone characters in advance. */
+  COVERAGE( alternative_fractions, ALTERNATIVE_FRACTIONS,
+            "alternative fractions",
+            'a', 'f', 'r', 'c' )
+#endif
+
+  COVERAGE( petite_capitals_from_capitals, PETITE_CAPITALS_FROM_CAPITALS,
+            "petite capitals from capitals",
+            'c', '2', 'c', 'p' )
+
+  COVERAGE( small_capitals_from_capitals, SMALL_CAPITALS_FROM_CAPITALS,
+            "small capitals from capitals",
+            'c', '2', 's', 'c' )
+
+#if 0
+  /* XXX: Only digits are in this coverage, however, both normal style */
+  /*      and oldstyle representation forms are possible.              */
+  COVERAGE( denominators, DENOMINATORS,
+            "denominators",
+            'd', 'n', 'o', 'm' )
+#endif
+
+#if 0
+  /* XXX: It's not possible to define blue zone characters in advance. */
+  COVERAGE( fractions, FRACTIONS,
+            "fractions",
+            'f', 'r', 'a', 'c' )
+#endif
+
+#if 0
+  /* XXX: Only digits are in this coverage, however, both normal style */
+  /*      and oldstyle representation forms are possible.              */
+  COVERAGE( numerators, NUMERATORS,
+            "numerators",
+            'n', 'u', 'm', 'r' )
+#endif
+
+  COVERAGE( ordinals, ORDINALS,
+            "ordinals",
+            'o', 'r', 'd', 'n' )
+
+  COVERAGE( petite_capitals, PETITE_CAPITALS,
+            "petite capitals",
+            'p', 'c', 'a', 'p' )
+
+  COVERAGE( ruby, RUBY,
+            "ruby",
+            'r', 'u', 'b', 'y' )
+
+  COVERAGE( scientific_inferiors, SCIENTIFIC_INFERIORS,
+            "scientific inferiors",
+            's', 'i', 'n', 'f' )
+
+  COVERAGE( small_capitals, SMALL_CAPITALS,
+            "small capitals",
+            's', 'm', 'c', 'p' )
+
+  COVERAGE( subscript, SUBSCRIPT,
+            "subscript",
+            's', 'u', 'b', 's' )
+
+  COVERAGE( superscript, SUPERSCRIPT,
+            "superscript",
+            's', 'u', 'p', 's' )
+
+  COVERAGE( titling, TITLING,
+            "titling",
+            't', 'i', 't', 'l' )
+
+#if 0
+  /* to be always excluded */
+  COVERAGE(nalt, 'n', 'a', 'l', 't'); /* Alternate Annotation Forms (?) */
+  COVERAGE(ornm, 'o', 'r', 'n', 'm'); /* Ornaments (?) */
+#endif
+
+
+/* END */
index 4bf278c..f8702a1 100644 (file)
@@ -5,7 +5,7 @@
 /*    Auto-fitter dummy routines to be used if no hinting should be        */
 /*    performed (body).                                                    */
 /*                                                                         */
-/*  Copyright 2003-2005, 2011 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,       */
 
 
   static FT_Error
-  af_dummy_hints_init( AF_GlyphHints     hints,
-                       AF_ScriptMetrics  metrics )
+  af_dummy_hints_init( AF_GlyphHints    hints,
+                       AF_StyleMetrics  metrics )
   {
-    af_glyph_hints_rescale( hints,
-                            metrics );
-    return AF_Err_Ok;
+    af_glyph_hints_rescale( hints, metrics );
+
+    hints->x_scale = metrics->scaler.x_scale;
+    hints->y_scale = metrics->scaler.y_scale;
+    hints->x_delta = metrics->scaler.x_delta;
+    hints->y_delta = metrics->scaler.y_delta;
+
+    return FT_Err_Ok;
   }
 
 
   af_dummy_hints_apply( AF_GlyphHints  hints,
                         FT_Outline*    outline )
   {
-    FT_UNUSED( hints );
-    FT_UNUSED( outline );
+    FT_Error  error;
+
 
-    return AF_Err_Ok;
+    error = af_glyph_hints_reload( hints, outline );
+    if ( !error )
+      af_glyph_hints_save( hints, outline );
+
+    return error;
   }
 
 
-  AF_DEFINE_SCRIPT_CLASS( af_dummy_script_class,
-    AF_SCRIPT_NONE,
-    NULL,
+  AF_DEFINE_WRITING_SYSTEM_CLASS(
+    af_dummy_writing_system_class,
+
+    AF_WRITING_SYSTEM_DUMMY,
 
-    sizeof ( AF_ScriptMetricsRec ),
+    sizeof ( AF_StyleMetricsRec ),
 
-    (AF_Script_InitMetricsFunc) NULL,
-    (AF_Script_ScaleMetricsFunc)NULL,
-    (AF_Script_DoneMetricsFunc) NULL,
+    (AF_WritingSystem_InitMetricsFunc) NULL,
+    (AF_WritingSystem_ScaleMetricsFunc)NULL,
+    (AF_WritingSystem_DoneMetricsFunc) NULL,
 
-    (AF_Script_InitHintsFunc)   af_dummy_hints_init,
-    (AF_Script_ApplyHintsFunc)  af_dummy_hints_apply
+    (AF_WritingSystem_InitHintsFunc)   af_dummy_hints_init,
+    (AF_WritingSystem_ApplyHintsFunc)  af_dummy_hints_apply
   )
 
 
index 95d8f8c..ad1b0d3 100644 (file)
@@ -5,7 +5,7 @@
 /*    Auto-fitter dummy routines to be used if no hinting should be        */
 /*    performed (specification).                                           */
 /*                                                                         */
-/*  Copyright 2003-2005, 2011 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,       */
 
 FT_BEGIN_HEADER
 
- /*  A dummy script metrics class used when no hinting should
-  *  be performed.  This is the default for non-latin glyphs!
-  */
+  /* A dummy writing system used when no hinting should be performed. */
 
-  AF_DECLARE_SCRIPT_CLASS( af_dummy_script_class )
+  AF_DECLARE_WRITING_SYSTEM_CLASS( af_dummy_writing_system_class )
 
 /* */
 
index 3e0c02d..a54c20c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter routines to compute global hinting values (body).        */
 /*                                                                         */
-/*  Copyright 2003-2011 by                                                 */
+/*  Copyright 2003-2014 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 
 #include "afglobal.h"
-#include "afdummy.h"
-#include "aflatin.h"
-#include "afcjk.h"
-#include "afindic.h"
-#include "afpic.h"
+#include "afranges.h"
+#include "hbshim.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_afglobal
+
+
+  /* get writing system specific header files */
+#undef  WRITING_SYSTEM
+#define WRITING_SYSTEM( ws, WS )  /* empty */
+#include "afwrtsys.h"
 
 #include "aferrors.h"
+#include "afpic.h"
+
+
+#undef  SCRIPT
+#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \
+          AF_DEFINE_SCRIPT_CLASS(           \
+            af_ ## s ## _script_class,      \
+            AF_SCRIPT_ ## S,                \
+            af_ ## s ## _uniranges,         \
+            sc1, sc2, sc3 )
+
+#include "afscript.h"
+
+
+#undef  STYLE
+#define STYLE( s, S, d, ws, sc, ss, c )  \
+          AF_DEFINE_STYLE_CLASS(         \
+            af_ ## s ## _style_class,    \
+            AF_STYLE_ ## S,              \
+            ws,                          \
+            sc,                          \
+            ss,                          \
+            c )
+
+#include "afstyles.h"
 
-#ifdef FT_OPTION_AUTOFIT2
-#include "aflatin2.h"
-#endif
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-  /* when updating this table, don't forget to update          */
-  /* AF_SCRIPT_CLASSES_COUNT and autofit_module_class_pic_init */
+#undef  WRITING_SYSTEM
+#define WRITING_SYSTEM( ws, WS )               \
+          &af_ ## ws ## _writing_system_class,
 
-  /* populate this list when you add new scripts */
-  static AF_ScriptClass const  af_script_classes[] =
+  FT_LOCAL_ARRAY_DEF( AF_WritingSystemClass )
+  af_writing_system_classes[] =
   {
-    &af_dummy_script_class,
-#ifdef FT_OPTION_AUTOFIT2
-    &af_latin2_script_class,
-#endif
-    &af_latin_script_class,
-    &af_cjk_script_class,
-    &af_indic_script_class,
+
+#include "afwrtsys.h"
+
+    NULL  /* do not remove */
+  };
+
+
+#undef  SCRIPT
+#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \
+          &af_ ## s ## _script_class,
+
+  FT_LOCAL_ARRAY_DEF( AF_ScriptClass )
+  af_script_classes[] =
+  {
+
+#include "afscript.h"
+
+    NULL  /* do not remove */
+  };
+
+
+#undef  STYLE
+#define STYLE( s, S, d, ws, sc, ss, c ) \
+          &af_ ## s ## _style_class,
+
+  FT_LOCAL_ARRAY_DEF( AF_StyleClass )
+  af_style_classes[] =
+  {
+
+#include "afstyles.h"
+
     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
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+
+#undef  STYLE
+#define STYLE( s, S, d, ws, sc, ss, c )  #s,
 
-  /*
-   *  Note that glyph_scripts[] is used to map each glyph into
-   *  an index into the `af_script_classes' array.
-   *
-   */
-  typedef struct  AF_FaceGlobalsRec_
+  FT_LOCAL_ARRAY_DEF( char* )
+  af_style_names[] =
   {
-    FT_Face           face;
-    FT_Long           glyph_count;    /* same as face->num_glyphs */
-    FT_Byte*          glyph_scripts;
 
-    AF_ScriptMetrics  metrics[AF_SCRIPT_MAX];
+#include "afstyles.h"
+
+  };
 
-  } AF_FaceGlobalsRec;
+#endif /* FT_DEBUG_LEVEL_TRACE */
 
 
-  /* Compute the script index of each glyph within a given face. */
+  /* Compute the style index of each glyph within a given face. */
 
   static FT_Error
-  af_face_globals_compute_script_coverage( AF_FaceGlobals  globals )
+  af_face_globals_compute_style_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_UInt     ss, i;
+    FT_Byte*    gstyles     = globals->glyph_styles;
+    FT_UInt     ss;
+    FT_UInt     i;
+    FT_UInt     dflt        = ~0U; /* a non-valid value */
 
 
-    /* the value AF_SCRIPT_LIST_NONE means `uncovered glyph' */
-    FT_MEM_SET( globals->glyph_scripts,
-                AF_SCRIPT_LIST_NONE,
+    /* the value AF_STYLE_UNASSIGNED means `uncovered glyph' */
+    FT_MEM_SET( globals->glyph_styles,
+                AF_STYLE_UNASSIGNED,
                 globals->glyph_count );
 
     error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
     if ( error )
     {
-     /*
-      *  Ignore this error; we simply use the default script.
-       XXX: Shouldn't we rather disable hinting?
-      */
-      error = AF_Err_Ok;
+      /*
+       * Ignore this error; we simply use the fallback style.
+       * XXX: Shouldn't we rather disable hinting?
+       */
+      error = FT_Err_Ok;
       goto Exit;
     }
 
-    /* scan each script in a Unicode charmap */
-    for ( ss = 0; AF_SCRIPT_CLASSES_GET[ss]; ss++ )
+    /* scan each style in a Unicode charmap */
+    for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
     {
-      AF_ScriptClass      clazz = AF_SCRIPT_CLASSES_GET[ss];
+      AF_StyleClass       style_class =
+                            AF_STYLE_CLASSES_GET[ss];
+      AF_ScriptClass      script_class =
+                            AF_SCRIPT_CLASSES_GET[style_class->script];
       AF_Script_UniRange  range;
 
 
-      if ( clazz->script_uni_ranges == NULL )
+      if ( script_class->script_uni_ranges == NULL )
         continue;
 
       /*
-       *  Scan all unicode points in the range and set the corresponding
-       *  glyph script index.
+       *  Scan all Unicode points in the range and set the corresponding
+       *  glyph style index.
        */
-      for ( range = clazz->script_uni_ranges; range->first != 0; range++ )
+      if ( style_class->coverage == AF_COVERAGE_DEFAULT )
       {
-        FT_ULong  charcode = range->first;
-        FT_UInt   gindex;
+        if ( (FT_UInt)style_class->script ==
+             globals->module->default_script )
+          dflt = ss;
 
+        for ( range = script_class->script_uni_ranges;
+              range->first != 0;
+              range++ )
+        {
+          FT_ULong  charcode = range->first;
+          FT_UInt   gindex;
 
-        gindex = FT_Get_Char_Index( face, charcode );
 
-        if ( gindex != 0                             &&
-             gindex < (FT_ULong)globals->glyph_count &&
-             gscripts[gindex] == AF_SCRIPT_LIST_NONE )
-          gscripts[gindex] = (FT_Byte)ss;
+          gindex = FT_Get_Char_Index( face, charcode );
 
-        for (;;)
-        {
-          charcode = FT_Get_Next_Char( face, charcode, &gindex );
+          if ( gindex != 0                             &&
+               gindex < (FT_ULong)globals->glyph_count &&
+               gstyles[gindex] == AF_STYLE_UNASSIGNED  )
+            gstyles[gindex] = (FT_Byte)ss;
+
+          for (;;)
+          {
+            charcode = FT_Get_Next_Char( face, charcode, &gindex );
 
-          if ( gindex == 0 || charcode > range->last )
-            break;
+            if ( gindex == 0 || charcode > range->last )
+              break;
 
-          if ( gindex < (FT_ULong)globals->glyph_count &&
-               gscripts[gindex] == AF_SCRIPT_LIST_NONE )
-            gscripts[gindex] = (FT_Byte)ss;
+            if ( gindex < (FT_ULong)globals->glyph_count &&
+                 gstyles[gindex] == AF_STYLE_UNASSIGNED  )
+              gstyles[gindex] = (FT_Byte)ss;
+          }
         }
       }
+      else
+      {
+        /* get glyphs not directly addressable by cmap */
+        af_get_coverage( globals, style_class, gstyles );
+      }
+    }
+
+    /* handle the default OpenType features of the default script ... */
+    af_get_coverage( globals, AF_STYLE_CLASSES_GET[dflt], gstyles );
+
+    /* ... and the remaining default OpenType features */
+    for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
+    {
+      AF_StyleClass  style_class = AF_STYLE_CLASSES_GET[ss];
+
+
+      if ( ss != dflt && style_class->coverage == AF_COVERAGE_DEFAULT )
+        af_get_coverage( globals, style_class, gstyles );
     }
 
     /* mark ASCII digits */
 
 
       if ( gindex != 0 && gindex < (FT_ULong)globals->glyph_count )
-        gscripts[gindex] |= AF_DIGIT;
+        gstyles[gindex] |= AF_DIGIT;
     }
 
   Exit:
     /*
-     *  By default, all uncovered glyphs are set to the latin script.
+     *  By default, all uncovered glyphs are set to the fallback style.
      *  XXX: Shouldn't we disable hinting or do something similar?
      */
+    if ( globals->module->fallback_style != AF_STYLE_UNASSIGNED )
     {
       FT_Long  nn;
 
 
       for ( nn = 0; nn < globals->glyph_count; nn++ )
       {
-        if ( ( gscripts[nn] & ~AF_DIGIT ) == AF_SCRIPT_LIST_NONE )
+        if ( ( gstyles[nn] & ~AF_DIGIT ) == AF_STYLE_UNASSIGNED )
         {
-          gscripts[nn] &= ~AF_SCRIPT_LIST_NONE;
-          gscripts[nn] |= AF_SCRIPT_LIST_DEFAULT;
+          gstyles[nn] &= ~AF_STYLE_UNASSIGNED;
+          gstyles[nn] |= globals->module->fallback_style;
         }
       }
     }
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+
+    FT_TRACE4(( "\n"
+                "style coverage\n"
+                "==============\n"
+                "\n" ));
+
+    for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
+    {
+      AF_StyleClass  style_class = AF_STYLE_CLASSES_GET[ss];
+      FT_UInt        count       = 0;
+      FT_Long        idx;
+
+
+      FT_TRACE4(( "%s:\n", af_style_names[style_class->style] ));
+
+      for ( idx = 0; idx < globals->glyph_count; idx++ )
+      {
+        if ( ( gstyles[idx] & ~AF_DIGIT ) == style_class->style )
+        {
+          if ( !( count % 10 ) )
+            FT_TRACE4(( " " ));
+
+          FT_TRACE4(( " %d", idx ));
+          count++;
+
+          if ( !( count % 10 ) )
+            FT_TRACE4(( "\n" ));
+        }
+      }
+
+      if ( !count )
+        FT_TRACE4(( "  (none)\n" ));
+      if ( count % 10 )
+        FT_TRACE4(( "\n" ));
+    }
+
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
     FT_Set_Charmap( face, old_charmap );
     return error;
   }
 
   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;
 
     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_styles = (FT_Byte*)( globals + 1 );
+    globals->module       = module;
+
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+    globals->hb_font = hb_ft_font_create( face, NULL );
+#endif
+
+    error = af_face_globals_compute_style_coverage( globals );
+    if ( error )
+    {
+      af_face_globals_free( globals );
+      globals = NULL;
     }
+    else
+      globals->increase_x_height = AF_PROP_INCREASE_X_HEIGHT_MAX;
 
+  Exit:
     *aglobals = globals;
     return error;
   }
       FT_UInt    nn;
 
 
-      for ( nn = 0; nn < AF_SCRIPT_MAX; nn++ )
+      for ( nn = 0; nn < AF_STYLE_MAX; nn++ )
       {
         if ( globals->metrics[nn] )
         {
-          AF_ScriptClass  clazz = AF_SCRIPT_CLASSES_GET[nn];
-
+          AF_StyleClass          style_class =
+            AF_STYLE_CLASSES_GET[nn];
+          AF_WritingSystemClass  writing_system_class =
+            AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];
 
-          FT_ASSERT( globals->metrics[nn]->clazz == clazz );
 
-          if ( clazz->script_metrics_done )
-            clazz->script_metrics_done( globals->metrics[nn] );
+          if ( writing_system_class->style_metrics_done )
+            writing_system_class->style_metrics_done( globals->metrics[nn] );
 
           FT_FREE( globals->metrics[nn] );
         }
       }
 
-      globals->glyph_count   = 0;
-      globals->glyph_scripts = NULL;  /* no need to free this one! */
-      globals->face          = NULL;
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+      hb_font_destroy( globals->hb_font );
+      globals->hb_font = NULL;
+#endif
+
+      globals->glyph_count  = 0;
+      globals->glyph_styles = NULL;  /* no need to free this one! */
+      globals->face         = NULL;
 
       FT_FREE( globals );
     }
 
 
   FT_LOCAL_DEF( FT_Error )
-  af_face_globals_get_metrics( AF_FaceGlobals     globals,
-                               FT_UInt            gindex,
-                               FT_UInt            options,
-                               AF_ScriptMetrics  *ametrics )
+  af_face_globals_get_metrics( AF_FaceGlobals    globals,
+                               FT_UInt           gindex,
+                               FT_UInt           options,
+                               AF_StyleMetrics  *ametrics )
   {
-    AF_ScriptMetrics  metrics = NULL;
-    FT_UInt           gidx;
-    AF_ScriptClass    clazz;
-    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;
+    AF_StyleMetrics  metrics = NULL;
+
+    AF_Style               style = (AF_Style)options;
+    AF_WritingSystemClass  writing_system_class;
+    AF_StyleClass          style_class;
+
+    FT_Error  error = FT_Err_Ok;
 
 
     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 )
-      gidx = globals->glyph_scripts[gindex] & AF_SCRIPT_LIST_NONE;
+    /* if we have a forced style (via `options'), use it, */
+    /* otherwise look into `glyph_styles' array           */
+    if ( style == AF_STYLE_NONE_DFLT || style + 1 >= AF_STYLE_MAX )
+      style = (AF_Style)( globals->glyph_styles[gindex] &
+                          AF_STYLE_UNASSIGNED           );
 
-    clazz = AF_SCRIPT_CLASSES_GET[gidx];
-    if ( script == 0 )
-      script = clazz->script;
+    style_class          = AF_STYLE_CLASSES_GET[style];
+    writing_system_class = AF_WRITING_SYSTEM_CLASSES_GET
+                             [style_class->writing_system];
 
-    metrics = globals->metrics[clazz->script];
+    metrics = globals->metrics[style];
     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 ) )
+      if ( FT_ALLOC( metrics, writing_system_class->style_metrics_size ) )
         goto Exit;
 
-      metrics->clazz = clazz;
+      metrics->style_class = style_class;
+      metrics->globals     = globals;
 
-      if ( clazz->script_metrics_init )
+      if ( writing_system_class->style_metrics_init )
       {
-        error = clazz->script_metrics_init( metrics, globals->face );
+        error = writing_system_class->style_metrics_init( metrics,
+                                                          globals->face );
         if ( error )
         {
-          if ( clazz->script_metrics_done )
-            clazz->script_metrics_done( metrics );
+          if ( writing_system_class->style_metrics_done )
+            writing_system_class->style_metrics_done( metrics );
 
           FT_FREE( metrics );
           goto Exit;
         }
       }
 
-      globals->metrics[clazz->script] = metrics;
+      globals->metrics[style] = metrics;
     }
 
   Exit:
                             FT_UInt         gindex )
   {
     if ( gindex < (FT_ULong)globals->glyph_count )
-      return (FT_Bool)( globals->glyph_scripts[gindex] & AF_DIGIT );
+      return (FT_Bool)( globals->glyph_styles[gindex] & AF_DIGIT );
 
     return (FT_Bool)0;
   }
index cc6860b..38d8d69 100644 (file)
@@ -5,7 +5,7 @@
 /*    Auto-fitter routines to compute global hinting values                */
 /*    (specification).                                                     */
 /*                                                                         */
-/*  Copyright 2003-2005, 2007, 2009, 2011 by                               */
+/*  Copyright 2003-2005, 2007, 2009, 2011-2014 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 
 #include "aftypes.h"
+#include "afmodule.h"
+#include "hbshim.h"
 
 
 FT_BEGIN_HEADER
 
 
+  FT_LOCAL_ARRAY( AF_WritingSystemClass )
+  af_writing_system_classes[];
+
+
+#undef  SCRIPT
+#define SCRIPT( s, S, d, h, sc1, sc2, sc3 )                    \
+          AF_DECLARE_SCRIPT_CLASS( af_ ## s ## _script_class )
+
+#include "afscript.h"
+
+  FT_LOCAL_ARRAY( AF_ScriptClass )
+  af_script_classes[];
+
+
+#undef  STYLE
+#define STYLE( s, S, d, ws, sc, ss, c )                      \
+          AF_DECLARE_STYLE_CLASS( af_ ## s ## _style_class )
+
+#include "afstyles.h"
+
+  FT_LOCAL_ARRAY( AF_StyleClass )
+  af_style_classes[];
+
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+  FT_LOCAL_ARRAY( char* )
+  af_style_names[];
+#endif
+
+
+  /*
+   *  Default values and flags for both autofitter globals (found in
+   *  AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).
+   */
+
+  /* index of fallback style in `af_style_classes' */
+#ifdef AF_CONFIG_OPTION_CJK
+#define AF_STYLE_FALLBACK    AF_STYLE_HANI_DFLT
+#else
+#define AF_STYLE_FALLBACK    AF_STYLE_NONE_DFLT
+#endif
+  /* default script for OpenType; ignored if HarfBuzz isn't used */
+#define AF_SCRIPT_DEFAULT    AF_SCRIPT_LATN
+  /* a bit mask indicating an uncovered glyph        */
+#define AF_STYLE_UNASSIGNED  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
+
+
   /************************************************************************/
   /************************************************************************/
   /*****                                                              *****/
@@ -37,21 +92,45 @@ FT_BEGIN_HEADER
 
 
   /*
-   *  model the global hints data for a given face, decomposed into
-   *  script-specific items
+   *  Note that glyph_styles[] maps each glyph to an index into the
+   *  `af_style_classes' array.
+   *
    */
-  typedef struct AF_FaceGlobalsRec_*   AF_FaceGlobals;
+  typedef struct  AF_FaceGlobalsRec_
+  {
+    FT_Face          face;
+    FT_Long          glyph_count;    /* same as face->num_glyphs */
+    FT_Byte*         glyph_styles;
+
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+    hb_font_t*       hb_font;
+#endif
+
+    /* per-face auto-hinter properties */
+    FT_UInt          increase_x_height;
 
+    AF_StyleMetrics  metrics[AF_STYLE_MAX];
+
+    AF_Module        module;         /* to access global properties */
+
+  } AF_FaceGlobalsRec;
+
+
+  /*
+   *  model the global hints data for a given face, decomposed into
+   *  style-specific items
+   */
 
   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_UInt            gindex,
-                               FT_UInt            options,
-                               AF_ScriptMetrics  *ametrics );
+  af_face_globals_get_metrics( AF_FaceGlobals    globals,
+                               FT_UInt           gindex,
+                               FT_UInt           options,
+                               AF_StyleMetrics  *ametrics );
 
   FT_LOCAL( void )
   af_face_globals_free( AF_FaceGlobals  globals );
index f51066f..f3cc50f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter hinting routines (body).                                 */
 /*                                                                         */
-/*  Copyright 2003-2007, 2009-2011 by                                      */
+/*  Copyright 2003-2007, 2009-2014 by                                      */
 /*  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 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. */
@@ -28,7 +39,7 @@
                              FT_Memory     memory,
                              AF_Segment   *asegment )
   {
-    FT_Error    error   = AF_Err_Ok;
+    FT_Error    error   = FT_Err_Ok;
     AF_Segment  segment = NULL;
 
 
@@ -41,7 +52,7 @@
 
       if ( old_max >= big_max )
       {
-        error = AF_Err_Out_Of_Memory;
+        error = FT_THROW( Out_Of_Memory );
         goto Exit;
       }
 
   }
 
 
-  /* Get new edge for given axis, direction, and position. */
+  /* Get new edge for given axis, direction, and position, */
+  /* without initializing the edge itself.                 */
 
   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;
 
@@ -86,7 +98,7 @@
 
       if ( old_max >= big_max )
       {
-        error = AF_Err_Out_Of_Memory;
+        error = FT_THROW( Out_Of_Memory );
         goto Exit;
       }
 
 
     axis->num_edges++;
 
-    FT_ZERO( edge );
-    edge->fpos = (FT_Short)fpos;
-    edge->dir  = (FT_Char)dir;
-
   Exit:
-    *aedge = edge;
+    *anedge = edge;
     return error;
   }
 
 
 #include FT_CONFIG_STANDARD_LIBRARY_H
 
+  /* The dump functions are used in the `ftgrid' demo program, too. */
+#define AF_DUMP( varformat )          \
+          do                          \
+          {                           \
+            if ( to_stdout )          \
+              printf varformat;       \
+            else                      \
+              FT_TRACE7( varformat ); \
+          } while ( 0 )
+
+
   static const char*
   af_dir_str( AF_Direction  dir )
   {
   }
 
 
-#define AF_INDEX_NUM( ptr, base )  ( (ptr) ? ( (ptr) - (base) ) : -1 )
+#define AF_INDEX_NUM( ptr, base )  (int)( (ptr) ? ( (ptr) - (base) ) : -1 )
 
 
 #ifdef __cplusplus
   extern "C" {
 #endif
   void
-  af_glyph_hints_dump_points( AF_GlyphHints  hints )
+  af_glyph_hints_dump_points( AF_GlyphHints  hints,
+                              FT_Bool        to_stdout )
   {
     AF_Point  points = hints->points;
     AF_Point  limit  = points + hints->num_points;
     AF_Point  point;
 
 
-    printf( "Table of points:\n" );
-    printf(   "  [ index |  xorg |  yorg | xscale | yscale"
-              " |  xfit |  yfit |  flags ]\n" );
+    AF_DUMP(( "Table of points:\n"
+              "  [ index |  xorg |  yorg | xscale | yscale"
+              " |  xfit |  yfit |  flags ]\n" ));
 
     for ( point = points; point < limit; point++ )
-    {
-      printf( "  [ %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' : ' ');
-    }
-    printf( "\n" );
+      AF_DUMP(( "  [ %5d | %5d | %5d | %6.2f | %6.2f"
+                " | %5.2f | %5.2f | %c ]\n",
+                AF_INDEX_NUM( 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' : ' '));
+    AF_DUMP(( "\n" ));
   }
 #ifdef __cplusplus
   }
     if ( pos == 0 )
       return "normal";
 
-    temp[pos] = 0;
+    temp[pos] = '\0';
 
     return temp;
   }
   extern "C" {
 #endif
   void
-  af_glyph_hints_dump_segments( AF_GlyphHints  hints )
+  af_glyph_hints_dump_segments( AF_GlyphHints  hints,
+                                FT_Bool        to_stdout )
   {
     FT_Int  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;
 
 
-      printf ( "Table of %s segments:\n",
-               dimension == AF_DIMENSION_HORZ ? "vertical" : "horizontal" );
-      printf ( "  [ index |  pos  |  dir  | link | serif |"
-               " height | extra |    flags    ]\n" );
+      AF_DUMP(( "Table of %s segments:\n",
+                dimension == AF_DIMENSION_HORZ ? "vertical"
+                                               : "horizontal" ));
+      if ( axis->num_segments )
+        AF_DUMP(( "  [ index |  pos  |  dir  | from"
+                  " |  to  | link | serif | edge"
+                  " | height | extra |    flags    ]\n" ));
+      else
+        AF_DUMP(( "  (none)\n" ));
 
       for ( seg = segments; seg < limit; seg++ )
-      {
-        printf ( "  [ %5d | %5.2g | %5s | %4d | %5d | %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->link, segments ),
-                 AF_INDEX_NUM( seg->serif, segments ),
-                 seg->height,
-                 seg->height - ( seg->max_coord - seg->min_coord ),
-                 af_edge_flags_to_string( (AF_Edge_Flags)seg->flags ) );
-      }
-      printf( "\n" );
+        AF_DUMP(( "  [ %5d | %5.2g | %5s | %4d"
+                  " | %4d | %4d | %5d | %4d"
+                  " | %6d | %5d | %11s ]\n",
+                  AF_INDEX_NUM( 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 ) ));
+      AF_DUMP(( "\n" ));
     }
   }
 #ifdef __cplusplus
     axis          = &hints->axis[dim];
     *num_segments = axis->num_segments;
 
-    return AF_Err_Ok;
+    return FT_Err_Ok;
   }
 #ifdef __cplusplus
   }
   af_glyph_hints_get_segment_offset( AF_GlyphHints  hints,
                                      FT_Int         dimension,
                                      FT_Int         idx,
-                                     FT_Pos*        offset )
+                                     FT_Pos        *offset,
+                                     FT_Bool       *is_blue,
+                                     FT_Pos        *blue_offset )
   {
     AF_Dimension  dim;
     AF_AxisHints  axis;
 
 
     if ( !offset )
-      return AF_Err_Invalid_Argument;
+      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 AF_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
+
+    seg      = &axis->segments[idx];
+    *offset  = ( dim == AF_DIMENSION_HORZ ) ? seg->first->ox
+                                            : seg->first->oy;
+    if ( seg->edge )
+      *is_blue = (FT_Bool)( seg->edge->blue_edge != 0 );
+    else
+      *is_blue = FALSE;
 
-    seg     = &axis->segments[idx];
-    *offset = (dim == AF_DIMENSION_HORZ) ? seg->first->ox
-                                         : seg->first->oy;
+    if ( *is_blue )
+      *blue_offset = seg->edge->blue_edge->cur;
+    else
+      *blue_offset = 0;
 
-    return AF_Err_Ok;
+    return FT_Err_Ok;
   }
 #ifdef __cplusplus
   }
   extern "C" {
 #endif
   void
-  af_glyph_hints_dump_edges( AF_GlyphHints  hints )
+  af_glyph_hints_dump_edges( AF_GlyphHints  hints,
+                             FT_Bool        to_stdout )
   {
     FT_Int  dimension;
 
        *  note: AF_DIMENSION_HORZ corresponds to _vertical_ edges
        *        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" );
+      AF_DUMP(( "Table of %s edges:\n",
+                dimension == AF_DIMENSION_HORZ ? "vertical"
+                                               : "horizontal" ));
+      if ( axis->num_edges )
+        AF_DUMP(( "  [ index |  pos  |  dir  | link"
+                  " | serif | blue | opos  |  pos  |    flags    ]\n" ));
+      else
+        AF_DUMP(( "  (none)\n" ));
 
       for ( edge = edges; edge < limit; edge++ )
-      {
-        printf ( "  [ %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 ) );
-      }
-      printf( "\n" );
+        AF_DUMP(( "  [ %5d | %5.2g | %5s | %4d"
+                  " | %5d |   %c  | %5.2f | %5.2f | %11s ]\n",
+                  AF_INDEX_NUM( 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 ) ));
+      AF_DUMP(( "\n" ));
     }
   }
 #ifdef __cplusplus
   }
 #endif
 
-#else /* !FT_DEBUG_AUTOFIT */
-
-  /* these empty stubs are only used to link the `ftgrid' test program */
-  /* if debugging is disabled                                          */
-
-#ifdef __cplusplus
-  extern "C" {
-#endif
-
-  void
-  af_glyph_hints_dump_points( AF_GlyphHints  hints )
-  {
-    FT_UNUSED( hints );
-  }
-
-
-  void
-  af_glyph_hints_dump_segments( AF_GlyphHints  hints )
-  {
-    FT_UNUSED( 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 );
-  }
-
-#ifdef __cplusplus
-  }
-#endif
+#undef AF_DUMP
 
 #endif /* !FT_DEBUG_AUTOFIT */
 
       }
     }
 
-    /* return no direction if arm lengths differ too much */
-    /* (value 14 is heuristic)                            */
+    /* 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;
   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 );
 
-      FT_FREE( hints->contours );
-      hints->max_contours = 0;
-      hints->num_contours = 0;
+      axis->num_edges = 0;
+      axis->max_edges = 0;
+      FT_FREE( axis->edges );
+    }
 
-      FT_FREE( hints->points );
-      hints->num_points = 0;
-      hints->max_points = 0;
+    FT_FREE( hints->contours );
+    hints->max_contours = 0;
+    hints->num_contours = 0;
 
-      hints->memory = NULL;
-    }
+    FT_FREE( hints->points );
+    hints->num_points = 0;
+    hints->max_points = 0;
+
+    hints->memory = NULL;
   }
 
 
   /* Reset metrics. */
 
   FT_LOCAL_DEF( void )
-  af_glyph_hints_rescale( AF_GlyphHints     hints,
-                          AF_ScriptMetrics  metrics )
+  af_glyph_hints_rescale( AF_GlyphHints    hints,
+                          AF_StyleMetrics  metrics )
   {
     hints->metrics      = metrics;
     hints->scaler_flags = metrics->scaler.flags;
   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;
 
         for ( point = points; point < point_limit; point++, vec++, tag++ )
         {
+          point->in_dir  = (FT_Char)AF_DIR_NONE;
+          point->out_dir = (FT_Char)AF_DIR_NONE;
+
           point->fx = (FT_Short)vec->x;
           point->fy = (FT_Short)vec->y;
           point->ox = point->x = FT_MulFix( vec->x, x_scale ) + x_delta;
         }
       }
 
-      /* compute directions of in & out vectors */
       {
-        AF_Point      first  = points;
-        AF_Point      prev   = NULL;
-        FT_Pos        in_x   = 0;
-        FT_Pos        in_y   = 0;
-        AF_Direction  in_dir = AF_DIR_NONE;
+        /*
+         *  Compute directions of `in' and `out' vectors.
+         *
+         *  Note that distances between points that are very near to each
+         *  other are accumulated.  In other words, the auto-hinter
+         *  prepends the small vectors between near points to the first
+         *  non-near vector.  All intermediate points are tagged as
+         *  weak; the directions are adjusted also to be equal to the
+         *  accumulated one.
+         */
+
+        /* value 20 in `near_limit' is heuristic */
+        FT_UInt  units_per_em = hints->metrics->scaler.face->units_per_EM;
+        FT_Int   near_limit   = 20 * units_per_em / 2048;
+        FT_Int   near_limit2  = 2 * near_limit - 1;
+
+        AF_Point*  contour;
+        AF_Point*  contour_limit = hints->contours + hints->num_contours;
+
+
+        for ( contour = hints->contours; contour < contour_limit; contour++ )
+        {
+          AF_Point  first = *contour;
+          AF_Point  next, prev, curr;
 
+          FT_Pos  out_x, out_y;
+
+          FT_Bool  is_first;
 
-        for ( point = points; point < point_limit; point++ )
-        {
-          AF_Point  next;
-          FT_Pos    out_x, out_y;
 
+          /* since the first point of a contour could be part of a */
+          /* series of near points, go backwards to find the first */
+          /* non-near point and adjust `first'                     */
 
-          if ( point == first )
+          point = first;
+          prev  = first->prev;
+
+          while ( prev != first )
           {
-            prev   = first->prev;
-            in_x   = first->fx - prev->fx;
-            in_y   = first->fy - prev->fy;
-            in_dir = af_direction_compute( in_x, in_y );
-            first  = prev + 1;
+            out_x = point->fx - prev->fx;
+            out_y = point->fy - prev->fy;
+
+            /*
+             *  We use Taxicab metrics to measure the vector length.
+             *
+             *  Note that the accumulated distances so far could have the
+             *  opposite direction of the distance measured here.  For this
+             *  reason we use `near_limit2' for the comparison to get a
+             *  non-near point even in the worst case.
+             */
+            if ( FT_ABS( out_x ) + FT_ABS( out_y ) >= near_limit2 )
+              break;
+
+            point = prev;
+            prev  = prev->prev;
           }
 
-          point->in_dir = (FT_Char)in_dir;
+          /* adjust first point */
+          first = point;
+
+          /* now loop over all points of the contour to get */
+          /* `in' and `out' vector directions               */
 
-          next  = point->next;
-          out_x = next->fx - point->fx;
-          out_y = next->fy - point->fy;
+          curr  = first;
 
-          in_dir         = af_direction_compute( out_x, out_y );
-          point->out_dir = (FT_Char)in_dir;
+          /*
+           *  We abuse the `u' and `v' fields to store index deltas to the
+           *  next and previous non-near point, respectively.
+           *
+           *  To avoid problems with not having non-near points, we point to
+           *  `first' by default as the next non-near point.
+           *
+           */
+          curr->u  = (FT_Pos)( first - curr );
+          first->v = -curr->u;
 
-          /* check for weak points */
+          out_x = 0;
+          out_y = 0;
 
-          if ( point->flags & ( AF_FLAG_CONIC | AF_FLAG_CUBIC ) )
+          is_first = 1;
+
+          for ( point = first;
+                point != first || is_first;
+                point = point->next )
           {
+            AF_Direction  out_dir;
+
+
+            is_first = 0;
+
+            next = point->next;
+
+            out_x += next->fx - point->fx;
+            out_y += next->fy - point->fy;
+
+            if ( FT_ABS( out_x ) + FT_ABS( out_y ) < near_limit )
+            {
+              next->flags |= AF_FLAG_WEAK_INTERPOLATION;
+              continue;
+            }
+
+            curr->u = (FT_Pos)( next - curr );
+            next->v = -curr->u;
+
+            out_dir = af_direction_compute( out_x, out_y );
+
+            /* adjust directions for all points inbetween; */
+            /* the loop also updates position of `curr'    */
+            curr->out_dir = (FT_Char)out_dir;
+            for ( curr = curr->next; curr != next; curr = curr->next )
+            {
+              curr->in_dir  = (FT_Char)out_dir;
+              curr->out_dir = (FT_Char)out_dir;
+            }
+            next->in_dir = (FT_Char)out_dir;
+
+            curr->u  = (FT_Pos)( first - curr );
+            first->v = -curr->u;
+
+            out_x = 0;
+            out_y = 0;
+          }
+        }
+
+        /*
+         *  The next step is to `simplify' an outline's topology so that we
+         *  can identify local extrema more reliably: A series of
+         *  non-horizontal or non-vertical vectors pointing into the same
+         *  quadrant are handled as a single, long vector.  From a
+         *  topological point of the view, the intermediate points are of no
+         *  interest and thus tagged as weak.
+         */
+
+        for ( point = points; point < point_limit; point++ )
+        {
+          if ( point->flags & AF_FLAG_WEAK_INTERPOLATION )
+            continue;
+
+          if ( point->in_dir  == AF_DIR_NONE &&
+               point->out_dir == AF_DIR_NONE )
+          {
+            /* check whether both vectors point into the same quadrant */
+
+            FT_Pos  in_x, in_y;
+            FT_Pos  out_x, out_y;
+
+            AF_Point  next_u = point + point->u;
+            AF_Point  prev_v = point + point->v;
+
+
+            in_x = point->fx - prev_v->fx;
+            in_y = point->fy - prev_v->fy;
+
+            out_x = next_u->fx - point->fx;
+            out_y = next_u->fy - point->fy;
+
+            if ( ( in_x ^ out_x ) >= 0 && ( in_y ^ out_y ) >= 0 )
+            {
+              /* yes, so tag current point as weak */
+              /* and update index deltas           */
+
+              point->flags |= AF_FLAG_WEAK_INTERPOLATION;
+
+              prev_v->u = (FT_Pos)( next_u - prev_v );
+              next_u->v = -prev_v->u;
+            }
+          }
+        }
+
+        /*
+         *  Finally, check for remaining weak points.  Everything else not
+         *  collected in edges so far is then implicitly classified as strong
+         *  points.
+         */
+
+        for ( point = points; point < point_limit; point++ )
+        {
+          if ( point->flags & AF_FLAG_WEAK_INTERPOLATION )
+            continue;
+
+          if ( point->flags & AF_FLAG_CONTROL )
+          {
+            /* control points are always weak */
           Is_Weak_Point:
             point->flags |= AF_FLAG_WEAK_INTERPOLATION;
           }
           else if ( point->out_dir == point->in_dir )
           {
             if ( point->out_dir != AF_DIR_NONE )
+            {
+              /* current point lies on a horizontal or          */
+              /* vertical segment (but doesn't start or end it) */
               goto Is_Weak_Point;
+            }
 
-            if ( ft_corner_is_flat( in_x, in_y, out_x, out_y ) )
-              goto Is_Weak_Point;
+            {
+              AF_Point  next_u = point + point->u;
+              AF_Point  prev_v = point + point->v;
+
+
+              if ( ft_corner_is_flat( point->fx  - prev_v->fx,
+                                      point->fy  - prev_v->fy,
+                                      next_u->fx - point->fx,
+                                      next_u->fy - point->fy ) )
+              {
+                /* either the `in' or the `out' vector is much more  */
+                /* dominant than the other one, so tag current point */
+                /* as weak and update index deltas                   */
+
+                prev_v->u = (FT_Pos)( next_u - prev_v );
+                next_u->v = -prev_v->u;
+
+                goto Is_Weak_Point;
+              }
+            }
           }
           else if ( point->in_dir == -point->out_dir )
+          {
+            /* current point forms a spike */
             goto Is_Weak_Point;
-
-          in_x = out_x;
-          in_y = out_y;
-          prev = point;
+          }
         }
       }
     }
         /* if this point is candidate to weak interpolation, we       */
         /* interpolate it after all strong points have been processed */
 
-        if (  ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) &&
-             !( point->flags & AF_FLAG_INFLECTION )         )
+        if ( ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) )
           continue;
 
         if ( dim == AF_DIMENSION_VERT )
       }
     }
 
-    point = points;
-
     for ( ; contour < contour_limit; contour++ )
     {
       AF_Point  first_touched, last_touched;
       }
 
       first_touched = point;
-      last_touched  = point;
 
       for (;;)
       {
index 1c52e0d..92101de 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter hinting routines (specification).                        */
 /*                                                                         */
-/*  Copyright 2003-2008, 2010-2011 by                                      */
+/*  Copyright 2003-2008, 2010-2012, 2014 by                                */
 /*  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 definition of outline glyph hints.  These are shared by all
-   *  script analysis routines (until now).
+   *  writing system analysis routines (until now).
    */
 
   typedef enum  AF_Dimension_
@@ -62,33 +62,34 @@ FT_BEGIN_HEADER
    *
    *  by David Turner and Werner Lemberg
    *
-   *   http://www.tug.org/TUGboat/Articles/tb24-3/lemberg.pdf
+   *    http://www.tug.org/TUGboat/Articles/tb24-3/lemberg.pdf
+   *
+   *  with appropriate updates.
    *
    *
    *  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.
+   *    find segments in an outline.
    *
-   *    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.
+   *    A segment is a series of at least two consecutive points that are
+   *    approximately aligned along a coordinate axis.  The analysis to do
+   *    so is specific to a writing system.
    *
    *
    *  Edges
    *
+   *    `af_{cjk,latin,...}_hints_compute_edges' are the functions to find
+   *    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.
+   *    As an example, the `latin' writing system first tries to grid-fit
+   *    edges, then to align segments on the edges unless it detects that
+   *    they form a serif.
    *
    *
    *                      A          H
@@ -107,6 +108,8 @@ FT_BEGIN_HEADER
    *
    *  Stems
    *
+   *    Stems are detected by `af_{cjk,latin,...}_hint_edges'.
+   *
    *    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
@@ -127,17 +130,21 @@ FT_BEGIN_HEADER
    *    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.
    *
+   *    The detection and handling of stems is dependent on the writing
+   *    system.
+   *
    *
    *  Serifs
    *
-   *    On the opposite, a serif has
+   *    Serifs are detected by `af_{cjk,latin,...}_hint_edges'.
+   *
+   *    In comparison to a stem, a serif (as handled by the auto-hinter
+   *    module that takes care of the `latin' writing system) has
    *
    *      best segment_1 = segment_2 && best segment_2 != segment_1
    *
@@ -147,8 +154,6 @@ FT_BEGIN_HEADER
    *    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
    *
@@ -169,18 +174,19 @@ FT_BEGIN_HEADER
    *
    *  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
+   *    Experience has shown that points 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)
+   *      same, but the curvature changes sign) [currently, such points
+   *      aren't handled specially in the auto-hinter]
    *
-   *    `af_glyph_hints_align_strong_points' is the function which takes
+   *    `af_glyph_hints_align_strong_points' is the function that takes
    *    care of such situations; it is equivalent to the TrueType `IP'
    *    hinting instruction.
    *
@@ -210,23 +216,12 @@ FT_BEGIN_HEADER
     AF_FLAG_CUBIC   = 1 << 1,
     AF_FLAG_CONTROL = AF_FLAG_CONIC | AF_FLAG_CUBIC,
 
-    /* point extremum flags */
-    AF_FLAG_EXTREMA_X = 1 << 2,
-    AF_FLAG_EXTREMA_Y = 1 << 3,
-
-    /* point roundness flags */
-    AF_FLAG_ROUND_X = 1 << 4,
-    AF_FLAG_ROUND_Y = 1 << 5,
-
     /* point touch flags */
-    AF_FLAG_TOUCH_X = 1 << 6,
-    AF_FLAG_TOUCH_Y = 1 << 7,
+    AF_FLAG_TOUCH_X = 1 << 2,
+    AF_FLAG_TOUCH_Y = 1 << 3,
 
     /* candidates for weak interpolation have this flag set */
-    AF_FLAG_WEAK_INTERPOLATION = 1 << 8,
-
-    /* all inflection points in the outline have this flag set */
-    AF_FLAG_INFLECTION = 1 << 9
+    AF_FLAG_WEAK_INTERPOLATION = 1 << 4
 
   } AF_Flags;
 
@@ -234,10 +229,11 @@ FT_BEGIN_HEADER
   /* edge hint flags */
   typedef enum  AF_Edge_Flags_
   {
-    AF_EDGE_NORMAL = 0,
-    AF_EDGE_ROUND  = 1 << 0,
-    AF_EDGE_SERIF  = 1 << 1,
-    AF_EDGE_DONE   = 1 << 2
+    AF_EDGE_NORMAL  = 0,
+    AF_EDGE_ROUND   = 1 << 0,
+    AF_EDGE_SERIF   = 1 << 1,
+    AF_EDGE_DONE    = 1 << 2,
+    AF_EDGE_NEUTRAL = 1 << 3  /* set if edge aligns to a neutral blue zone */
 
   } AF_Edge_Flags;
 
@@ -254,7 +250,7 @@ FT_BEGIN_HEADER
     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 */
 
@@ -290,19 +286,19 @@ FT_BEGIN_HEADER
 
   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 */
-    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_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;      /* first segment in edge */
     AF_Segment  last;       /* last segment in edge  */
@@ -330,31 +326,31 @@ FT_BEGIN_HEADER
 
   typedef struct  AF_GlyphHintsRec_
   {
-    FT_Memory         memory;
+    FT_Memory        memory;
 
-    FT_Fixed          x_scale;
-    FT_Pos            x_delta;
+    FT_Fixed         x_scale;
+    FT_Pos           x_delta;
 
-    FT_Fixed          y_scale;
-    FT_Pos            y_delta;
+    FT_Fixed         y_scale;
+    FT_Pos           y_delta;
 
-    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;    /* number of allocated points */
+    FT_Int           num_points;    /* number of used points      */
+    AF_Point         points;        /* points array               */
 
-    FT_Int            max_contours;  /* number of allocated contours */
-    FT_Int            num_contours;  /* number of used contours      */
-    AF_Point*         contours;      /* contours array               */
+    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];
 
-    FT_UInt32         scaler_flags;  /* copy of scaler flags     */
-    FT_UInt32         other_flags;   /* free for script-specific */
-                                     /* implementations          */
-    AF_ScriptMetrics  metrics;
+    FT_UInt32        scaler_flags;  /* copy of scaler flags    */
+    FT_UInt32        other_flags;   /* free for style-specific */
+                                    /* implementations         */
+    AF_StyleMetrics  metrics;
 
-    FT_Pos            xmin_delta;    /* used for warping */
-    FT_Pos            xmax_delta;
+    FT_Pos           xmin_delta;    /* used for warping */
+    FT_Pos           xmax_delta;
 
   } AF_GlyphHintsRec;
 
@@ -416,8 +412,8 @@ FT_BEGIN_HEADER
                        FT_Memory      memory );
 
   FT_LOCAL( void )
-  af_glyph_hints_rescale( AF_GlyphHints     hints,
-                          AF_ScriptMetrics  metrics );
+  af_glyph_hints_rescale( AF_GlyphHints    hints,
+                          AF_StyleMetrics  metrics );
 
   FT_LOCAL( FT_Error )
   af_glyph_hints_reload( AF_GlyphHints  hints,
index 9c74838..197881b 100644 (file)
@@ -2,9 +2,9 @@
 /*                                                                         */
 /*  afindic.c                                                              */
 /*                                                                         */
-/*    Auto-fitter hinting routines for Indic scripts (body).               */
+/*    Auto-fitter hinting routines for Indic writing system (body).        */
 /*                                                                         */
-/*  Copyright 2007, 2011 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,       */
@@ -46,7 +46,7 @@
       face->charmap = NULL;
     else
     {
-      af_cjk_metrics_init_widths( metrics, face, 0x7530 );
+      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 );
@@ -56,7 +56,7 @@
 
     FT_Set_Charmap( face, oldmap );
 
-    return AF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   /*************************************************************************/
 
 
-  static const AF_Script_UniRangeRec  af_indic_uniranges[] =
-  {
-#if 0
-    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_DEFINE_WRITING_SYSTEM_CLASS(
+    af_indic_writing_system_class,
 
-  AF_DEFINE_SCRIPT_CLASS( af_indic_script_class,
-    AF_SCRIPT_INDIC,
-    af_indic_uniranges,
+    AF_WRITING_SYSTEM_INDIC,
 
     sizeof ( AF_CJKMetricsRec ),
 
-    (AF_Script_InitMetricsFunc) af_indic_metrics_init,
-    (AF_Script_ScaleMetricsFunc)af_indic_metrics_scale,
-    (AF_Script_DoneMetricsFunc) NULL,
+    (AF_WritingSystem_InitMetricsFunc) af_indic_metrics_init,
+    (AF_WritingSystem_ScaleMetricsFunc)af_indic_metrics_scale,
+    (AF_WritingSystem_DoneMetricsFunc) NULL,
 
-    (AF_Script_InitHintsFunc)   af_indic_hints_init,
-    (AF_Script_ApplyHintsFunc)  af_indic_hints_apply
+    (AF_WritingSystem_InitHintsFunc)   af_indic_hints_init,
+    (AF_WritingSystem_ApplyHintsFunc)  af_indic_hints_apply
   )
 
+
 #else /* !AF_CONFIG_OPTION_INDIC */
 
-  static const AF_Script_UniRangeRec  af_indic_uniranges[] =
-  {
-    { 0, 0 }
-  };
 
+  AF_DEFINE_WRITING_SYSTEM_CLASS(
+    af_indic_writing_system_class,
 
-  AF_DEFINE_SCRIPT_CLASS( af_indic_script_class,
-    AF_SCRIPT_INDIC,
-    af_indic_uniranges,
+    AF_WRITING_SYSTEM_INDIC,
 
     sizeof ( AF_CJKMetricsRec ),
 
-    (AF_Script_InitMetricsFunc) NULL,
-    (AF_Script_ScaleMetricsFunc)NULL,
-    (AF_Script_DoneMetricsFunc) NULL,
+    (AF_WritingSystem_InitMetricsFunc) NULL,
+    (AF_WritingSystem_ScaleMetricsFunc)NULL,
+    (AF_WritingSystem_DoneMetricsFunc) NULL,
 
-    (AF_Script_InitHintsFunc)   NULL,
-    (AF_Script_ApplyHintsFunc)  NULL
+    (AF_WritingSystem_InitHintsFunc)   NULL,
+    (AF_WritingSystem_ApplyHintsFunc)  NULL
   )
 
+
 #endif /* !AF_CONFIG_OPTION_INDIC */
 
 
index 662a982..9e13cf7 100644 (file)
@@ -2,9 +2,10 @@
 /*                                                                         */
 /*  afindic.h                                                              */
 /*                                                                         */
-/*    Auto-fitter hinting routines for Indic scripts (specification).      */
+/*    Auto-fitter hinting routines for Indic writing system                */
+/*    (specification).                                                     */
 /*                                                                         */
-/*  Copyright 2007 by                                                      */
+/*  Copyright 2007, 2012, 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,       */
@@ -25,9 +26,9 @@
 FT_BEGIN_HEADER
 
 
-  /* the Indic-specific script class */
+  /* the `indic' writing system */
 
-  AF_DECLARE_SCRIPT_CLASS(af_indic_script_class)
+  AF_DECLARE_WRITING_SYSTEM_CLASS( af_indic_writing_system_class )
 
 
 /* */
index 30145a2..36a3689 100644 (file)
@@ -2,9 +2,9 @@
 /*                                                                         */
 /*  aflatin.c                                                              */
 /*                                                                         */
-/*    Auto-fitter hinting routines for latin script (body).                */
+/*    Auto-fitter hinting routines for latin writing system (body).        */
 /*                                                                         */
-/*  Copyright 2003-2011 by                                                 */
+/*  Copyright 2003-2014 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -20,6 +20,8 @@
 #include FT_ADVANCES_H
 #include FT_INTERNAL_DEBUG_H
 
+#include "afglobal.h"
+#include "afpic.h"
 #include "aflatin.h"
 #include "aferrors.h"
 
 
   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];
 
 
+    FT_TRACE5(( "\n"
+                "latin standard widths computation (style `%s')\n"
+                "=====================================================\n"
+                "\n",
+                af_style_names[metrics->root.style_class->style] ));
+
     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_ULong            glyph_index;
+      FT_Long             y_offset;
+      int                 dim;
+      AF_LatinMetricsRec  dummy[1];
+      AF_Scaler           scaler = &dummy->root.scaler;
+
+#ifdef FT_CONFIG_OPTION_PIC
+      AF_FaceGlobals  globals = metrics->root.globals;
+#endif
 
+      AF_StyleClass   style_class  = metrics->root.style_class;
+      AF_ScriptClass  script_class = AF_SCRIPT_CLASSES_GET
+                                       [style_class->script];
 
-      glyph_index = FT_Get_Char_Index( face, charcode );
-      if ( glyph_index == 0 )
-        goto Exit;
+      FT_UInt32  standard_char;
+
+
+      /*
+       * We check more than a single standard character to catch features
+       * like `c2sc' (small caps from caps) that don't contain lowercase
+       * letters by definition, or other features that mainly operate on
+       * numerals.
+       */
+
+      standard_char = script_class->standard_char1;
+      af_get_char_index( &metrics->root,
+                         standard_char,
+                         &glyph_index,
+                         &y_offset );
+      if ( !glyph_index )
+      {
+        if ( script_class->standard_char2 )
+        {
+          standard_char = script_class->standard_char2;
+          af_get_char_index( &metrics->root,
+                             standard_char,
+                             &glyph_index,
+                             &y_offset );
+          if ( !glyph_index )
+          {
+            if ( script_class->standard_char3 )
+            {
+              standard_char = script_class->standard_char3;
+              af_get_char_index( &metrics->root,
+                                 standard_char,
+                                 &glyph_index,
+                                 &y_offset );
+              if ( !glyph_index )
+                goto Exit;
+            }
+            else
+              goto Exit;
+          }
+        }
+        else
+          goto Exit;
+      }
+
+      FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n",
+                  standard_char, glyph_index ));
 
       error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
       if ( error || face->glyph->outline.n_points <= 0 )
       scaler->render_mode = FT_RENDER_MODE_NORMAL;
       scaler->flags       = 0;
 
-      af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy );
+      af_glyph_hints_rescale( hints, (AF_StyleMetrics)dummy );
 
       error = af_glyph_hints_reload( hints, &face->glyph->outline );
       if ( error )
         if ( error )
           goto Exit;
 
+        /*
+         *  We assume that the glyphs selected for the stem width
+         *  computation are `featureless' enough so that the linking
+         *  algorithm works fine without adjustments of its scoring
+         *  function.
+         */
         af_latin_hints_link_segments( hints,
+                                      0,
+                                      NULL,
                                       (AF_Dimension)dim );
 
         seg   = axhints->segments;
           }
         }
 
-        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;
       }
 
-  Exit:
+    Exit:
       for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
       {
         AF_LatinAxis  axis = &metrics->axis[dim];
         FT_Pos        stdw;
 
 
-        stdw = ( axis->width_count > 0 )
-                 ? axis->widths[0].org
-                 : AF_LATIN_CONSTANT( metrics, 50 );
+        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 );
-  }
+#ifdef FT_DEBUG_LEVEL_TRACE
+        {
+          FT_UInt  i;
 
 
+          FT_TRACE5(( "%s widths:\n",
+                      dim == AF_DIMENSION_VERT ? "horizontal"
+                                               : "vertical" ));
 
-#define AF_LATIN_MAX_TEST_CHARACTERS  12
+          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
+      }
+    }
 
-  static const char af_latin_blue_chars[AF_LATIN_MAX_BLUES]
-                                       [AF_LATIN_MAX_TEST_CHARACTERS + 1] =
-  {
-    "THEZOCQS",
-    "HEZLOCUS",
-    "fijkdbh",
-    "xzroesc",
-    "xzroesc",
-    "pqgjy"
-  };
+    FT_TRACE5(( "\n" ));
+
+    af_glyph_hints_done( hints );
+  }
 
 
   /* Find all blue zones.  Flat segments give the reference points, */
   af_latin_metrics_init_blues( AF_LatinMetrics  metrics,
                                FT_Face          face )
   {
-    FT_Pos        flats [AF_LATIN_MAX_TEST_CHARACTERS];
-    FT_Pos        rounds[AF_LATIN_MAX_TEST_CHARACTERS];
+    FT_Pos        flats [AF_BLUE_STRING_MAX_LEN];
+    FT_Pos        rounds[AF_BLUE_STRING_MAX_LEN];
+
     FT_Int        num_flats;
     FT_Int        num_rounds;
-    FT_Int        bb;
+
     AF_LatinBlue  blue;
     FT_Error      error;
-    AF_LatinAxis  axis  = &metrics->axis[AF_DIMENSION_VERT];
-    FT_GlyphSlot  glyph = face->glyph;
+    AF_LatinAxis  axis = &metrics->axis[AF_DIMENSION_VERT];
+    FT_Outline    outline;
+
+    AF_StyleClass  sc = metrics->root.style_class;
+
+    AF_Blue_Stringset         bss = sc->blue_stringset;
+    const AF_Blue_StringRec*  bs  = &af_blue_stringsets[bss];
 
 
-    /* we compute the blues simply by loading each character from the    */
-    /* `af_latin_blue_chars[blues]' string, then finding its top-most or */
-    /* bottom-most points (depending on `AF_IS_TOP_BLUE')                */
+    /* we walk over the blue character strings as specified in the */
+    /* style's entry in the `af_blue_stringset' array              */
 
-    FT_TRACE5(( "blue zones computation\n" ));
-    FT_TRACE5(( "------------------------------------------------\n" ));
+    FT_TRACE5(( "latin blue zones computation\n"
+                "============================\n"
+                "\n" ));
 
-    for ( bb = 0; bb < AF_LATIN_BLUE_MAX; bb++ )
+    for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ )
     {
-      const char*  p     = af_latin_blue_chars[bb];
-      const char*  limit = p + AF_LATIN_MAX_TEST_CHARACTERS;
+      const char*  p = &af_blue_strings[bs->string];
       FT_Pos*      blue_ref;
       FT_Pos*      blue_shoot;
 
 
-      FT_TRACE5(( "blue %3d: ", bb ));
+#ifdef FT_DEBUG_LEVEL_TRACE
+      {
+        FT_Bool  have_flag = 0;
+
+
+        FT_TRACE5(( "blue zone %d", axis->blue_count ));
+
+        if ( bs->properties )
+        {
+          FT_TRACE5(( " (" ));
+
+          if ( AF_LATIN_IS_TOP_BLUE( bs ) )
+          {
+            FT_TRACE5(( "top" ));
+            have_flag = 1;
+          }
+
+          if ( AF_LATIN_IS_NEUTRAL_BLUE( bs ) )
+          {
+            if ( have_flag )
+              FT_TRACE5(( ", " ));
+            FT_TRACE5(( "neutral" ));
+            have_flag = 1;
+          }
+
+          if ( AF_LATIN_IS_X_HEIGHT_BLUE( bs ) )
+          {
+            if ( have_flag )
+              FT_TRACE5(( ", " ));
+            FT_TRACE5(( "small top" ));
+            have_flag = 1;
+          }
+
+          if ( AF_LATIN_IS_LONG_BLUE( bs ) )
+          {
+            if ( have_flag )
+              FT_TRACE5(( ", " ));
+            FT_TRACE5(( "long" ));
+          }
+
+          FT_TRACE5(( ")" ));
+        }
+
+        FT_TRACE5(( ":\n" ));
+      }
+#endif /* FT_DEBUG_LEVEL_TRACE */
 
       num_flats  = 0;
       num_rounds = 0;
 
-      for ( ; p < limit && *p; p++ )
+      while ( *p )
       {
-        FT_UInt     glyph_index;
+        FT_ULong    ch;
+        FT_ULong    glyph_index;
+        FT_Long     y_offset;
         FT_Pos      best_y;                            /* same as points.y */
-        FT_Int      best_point, best_first, best_last;
+        FT_Int      best_point, best_contour_first, best_contour_last;
         FT_Vector*  points;
         FT_Bool     round = 0;
 
 
-        FT_TRACE5(( "'%c'", *p ));
+        GET_UTF8_CHAR( ch, p );
 
         /* load the character in the face -- skip unknown or empty ones */
-        glyph_index = FT_Get_Char_Index( face, (FT_UInt)*p );
+        af_get_char_index( &metrics->root, ch, &glyph_index, &y_offset );
         if ( glyph_index == 0 )
+        {
+          FT_TRACE5(( "  U+%04lX unavailable\n", ch ));
           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 )
+        {
+          FT_TRACE5(( "  U+%04lX contains no outlines\n", ch ));
           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  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;
 
 
-            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.           */
+            /* that are way outside of the glyph's real outline.            */
             if ( last <= first )
               continue;
 
-            if ( AF_LATIN_IS_TOP_BLUE( bb ) )
+            if ( AF_LATIN_IS_TOP_BLUE( bs ) )
             {
               for ( pp = first; pp <= last; pp++ )
                 if ( best_point < 0 || points[pp].y > best_y )
 
             if ( best_point != old_best_point )
             {
-              best_first = first;
-              best_last  = last;
+              best_contour_first = first;
+              best_contour_last  = last;
             }
           }
-          FT_TRACE5(( "%5d", best_y ));
         }
 
         /* now check whether the point belongs to a straight or round   */
         /* 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  best_segment_first, best_segment_last;
+          FT_Int  best_on_point_first, best_on_point_last;
           FT_Pos  dist;
 
 
-          /* now look for the previous and next points that are not on the */
-          /* same Y coordinate.  Threshold the `closeness'...              */
+          best_segment_first = best_point;
+          best_segment_last  = best_point;
+
+          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 on the contour  */
+          /* that are not on the same Y coordinate, then threshold */
+          /* the `closeness'...                                    */
           prev = best_point;
           next = prev;
 
           do
           {
-            if ( prev > best_first )
+            if ( prev > best_contour_first )
               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;
+
+            best_segment_first = prev;
+
+            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
           {
-            if ( next < best_last )
+            if ( next < best_contour_last )
               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;
+
+            best_segment_last = next;
+
+            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 );
 
-          /* 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 );
+          if ( AF_LATIN_IS_LONG_BLUE( bs ) )
+          {
+            /* If this flag is set, we have an additional constraint to  */
+            /* get the blue zone distance: Find a segment of the topmost */
+            /* (or bottommost) contour that is longer than a heuristic   */
+            /* threshold.  This ensures that small bumps in the outline  */
+            /* are ignored (for example, the `vertical serifs' found in  */
+            /* many Hebrew glyph designs).                               */
+
+            /* If this segment is long enough, we are done.  Otherwise,  */
+            /* search the segment next to the extremum that is long      */
+            /* enough, has the same direction, and a not too large       */
+            /* vertical distance from the extremum.  Note that the       */
+            /* algorithm doesn't check whether the found segment is      */
+            /* actually the one (vertically) nearest to the extremum.    */
+
+            /* heuristic threshold value */
+            FT_Pos  length_threshold = metrics->units_per_em / 25;
+
+
+            dist = FT_ABS( points[best_segment_last].x -
+                             points[best_segment_first].x );
+
+            if ( dist < length_threshold                       &&
+                 best_segment_last - best_segment_first + 2 <=
+                   best_contour_last - best_contour_first      )
+            {
+              /* heuristic threshold value */
+              FT_Pos  height_threshold = metrics->units_per_em / 4;
+
+              FT_Int   first;
+              FT_Int   last;
+              FT_Bool  hit;
+
+              /* we intentionally declare these two variables        */
+              /* outside of the loop since various compilers emit    */
+              /* incorrect warning messages otherwise, talking about */
+              /* `possibly uninitialized variables'                  */
+              FT_Int  p_first = 0;            /* make compiler happy */
+              FT_Int  p_last  = 0;
+
+              FT_Bool  left2right;
+
+
+              /* compute direction */
+              prev = best_point;
+
+              do
+              {
+                if ( prev > best_contour_first )
+                  prev--;
+                else
+                  prev = best_contour_last;
+
+                if ( points[prev].x != best_x )
+                  break;
+
+              } while ( prev != best_point );
+
+              /* skip glyph for the degenerate case */
+              if ( prev == best_point )
+                continue;
+
+              left2right = FT_BOOL( points[prev].x < points[best_point].x );
+
+              first = best_segment_last;
+              last  = first;
+              hit   = 0;
+
+              do
+              {
+                FT_Bool  l2r;
+                FT_Pos   d;
+
+
+                if ( !hit )
+                {
+                  /* no hit; adjust first point */
+                  first = last;
+
+                  /* also adjust first and last on point */
+                  if ( FT_CURVE_TAG( outline.tags[first] ) ==
+                         FT_CURVE_TAG_ON )
+                  {
+                    p_first = first;
+                    p_last  = first;
+                  }
+                  else
+                  {
+                    p_first = -1;
+                    p_last  = -1;
+                  }
+
+                  hit = 1;
+                }
+
+                if ( last < best_contour_last )
+                  last++;
+                else
+                  last = best_contour_first;
+
+                if ( FT_ABS( best_y - points[first].y ) > height_threshold )
+                {
+                  /* vertical distance too large */
+                  hit = 0;
+                  continue;
+                }
+
+                /* same test as above */
+                dist = FT_ABS( points[last].y - points[first].y );
+                if ( dist > 5 )
+                  if ( FT_ABS( points[last].x - points[first].x ) <=
+                         20 * dist )
+                  {
+                    hit = 0;
+                    continue;
+                  }
+
+                if ( FT_CURVE_TAG( outline.tags[last] ) == FT_CURVE_TAG_ON )
+                {
+                  p_last = last;
+                  if ( p_first < 0 )
+                    p_first = last;
+                }
+
+                l2r = FT_BOOL( points[first].x < points[last].x );
+                d   = FT_ABS( points[last].x - points[first].x );
+
+                if ( l2r == left2right     &&
+                     d >= length_threshold )
+                {
+                  /* all constraints are met; update segment after finding */
+                  /* its end                                               */
+                  do
+                  {
+                    if ( last < best_contour_last )
+                      last++;
+                    else
+                      last = best_contour_first;
+
+                    d = FT_ABS( points[last].y - points[first].y );
+                    if ( d > 5 )
+                      if ( FT_ABS( points[next].x - points[first].x ) <=
+                             20 * dist )
+                      {
+                        if ( last > best_contour_first )
+                          last--;
+                        else
+                          last = best_contour_last;
+                        break;
+                      }
+
+                    p_last = last;
+
+                    if ( FT_CURVE_TAG( outline.tags[last] ) ==
+                           FT_CURVE_TAG_ON )
+                    {
+                      p_last = last;
+                      if ( p_first < 0 )
+                        p_first = last;
+                    }
+
+                  } while ( last != best_segment_first );
+
+                  best_y = points[first].y;
+
+                  best_segment_first = first;
+                  best_segment_last  = last;
+
+                  best_on_point_first = p_first;
+                  best_on_point_last  = p_last;
+
+                  break;
+                }
+
+              } while ( last != best_segment_first );
+            }
+          }
+
+          /* for computing blue zones, we add the y offset as returned */
+          /* by the currently used OpenType feature -- for example,    */
+          /* superscript glyphs might be identical to subscript glyphs */
+          /* with a vertical shift                                     */
+          best_y += y_offset;
+
+          FT_TRACE5(( "  U+%04lX: best_y = %5ld", ch, best_y ));
+
+          /* now set the `round' flag depending on the segment's kind: */
+          /*                                                           */
+          /* - if the horizontal distance between the first and last   */
+          /*   `on' point is larger than upem/8 (value 8 is heuristic) */
+          /*   we have a flat segment                                  */
+          /* - if either the first or the last point of the segment is */
+          /*   an `off' point, the segment is round, otherwise it is   */
+          /*   flat                                                    */
+          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[best_segment_first] ) !=
+                        FT_CURVE_TAG_ON                                   ||
+                      FT_CURVE_TAG( outline.tags[best_segment_last]  ) !=
+                        FT_CURVE_TAG_ON                                   );
 
-          FT_TRACE5(( "%c ", round ? 'r' : 'f' ));
+          if ( round && AF_LATIN_IS_NEUTRAL_BLUE( bs ) )
+          {
+            /* only use flat segments for a neutral blue zone */
+            FT_TRACE5(( " (round, skipped)\n" ));
+            continue;
+          }
+
+          FT_TRACE5(( " (%s)\n", round ? "round" : "flat" ));
         }
 
         if ( round )
           flats[num_flats++]   = best_y;
       }
 
-      FT_TRACE5(( "\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
          */
-        FT_TRACE5(( "empty\n" ));
+        FT_TRACE5(( "  empty\n" ));
         continue;
       }
 
       }
       else
       {
-        *blue_ref   = flats[num_flats / 2];
+        *blue_ref   = flats [num_flats  / 2];
         *blue_shoot = rounds[num_rounds / 2];
       }
 
         FT_Bool  over_ref = FT_BOOL( shoot > ref );
 
 
-        if ( AF_LATIN_IS_TOP_BLUE( bb ) ^ over_ref )
+        if ( AF_LATIN_IS_TOP_BLUE( bs ) ^ over_ref )
+        {
           *blue_ref   =
           *blue_shoot = ( shoot + ref ) / 2;
+
+          FT_TRACE5(( "  [overshoot smaller than reference,"
+                      " taking mean value]\n" ));
+        }
       }
 
       blue->flags = 0;
-      if ( AF_LATIN_IS_TOP_BLUE( bb ) )
+      if ( AF_LATIN_IS_TOP_BLUE( bs ) )
         blue->flags |= AF_LATIN_BLUE_TOP;
+      if ( AF_LATIN_IS_NEUTRAL_BLUE( bs ) )
+        blue->flags |= AF_LATIN_BLUE_NEUTRAL;
 
       /*
        * The following flag is used later to adjust the y and x scales
        * in order to optimize the pixel grid alignment of the top of small
        * letters.
        */
-      if ( bb == AF_LATIN_BLUE_SMALL_TOP )
+      if ( AF_LATIN_IS_X_HEIGHT_BLUE( bs ) )
         blue->flags |= AF_LATIN_BLUE_ADJUSTMENT;
 
-      FT_TRACE5(( "-- ref = %ld, shoot = %ld\n", *blue_ref, *blue_shoot ));
+      FT_TRACE5(( "    -> reference = %ld\n"
+                  "       overshoot = %ld\n",
+                  *blue_ref, *blue_shoot ));
     }
 
     FT_TRACE5(( "\n" ));
     /* digit `0' is 0x30 in all supported charmaps */
     for ( i = 0x30; i <= 0x39; i++ )
     {
-      FT_UInt  glyph_index;
+      FT_ULong  glyph_index;
+      FT_Long   y_offset;
 
 
-      glyph_index = FT_Get_Char_Index( face, i );
+      af_get_char_index( &metrics->root, i, &glyph_index, &y_offset );
       if ( glyph_index == 0 )
         continue;
 
   af_latin_metrics_init( AF_LatinMetrics  metrics,
                          FT_Face          face )
   {
-    FT_Error    error = AF_Err_Ok;
     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;
 
-    /* do we have a latin charmap in there? */
-    for ( ee = 0; latin_encodings[ee] != FT_ENCODING_NONE; ee++ )
-    {
-      error = FT_Select_Charmap( face, latin_encodings[ee] );
-      if ( !error )
-        break;
-    }
-
-    if ( !error )
+    if ( !FT_Select_Charmap( face, FT_ENCODING_UNICODE ) )
     {
-      /* 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 );
-    return AF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
 
       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 )
         {
           else
 #endif
           if ( dim == AF_DIMENSION_VERT )
+          {
             scale = FT_MulDiv( scale, fitted, scaled );
+
+            FT_TRACE5((
+              "af_latin_metrics_scale_dim:"
+              " x height alignment (style `%s'):\n"
+              "                           "
+              " vertical scaling changed from %.4f to %.4f (by %d%%)\n"
+              "\n",
+              af_style_names[metrics->root.style_class->style],
+              axis->org_scale / 65536.0,
+              scale / 65536.0,
+              ( fitted - scaled ) * 100 / scaled ));
+          }
         }
       }
     }
       metrics->root.scaler.y_delta = delta;
     }
 
+    FT_TRACE5(( "%s widths (style `%s')\n",
+                dim == AF_DIMENSION_HORZ ? "horizontal" : "vertical",
+                af_style_names[metrics->root.style_class->style] ));
+
     /* scale the widths */
     for ( nn = 0; nn < axis->width_count; nn++ )
     {
 
       width->cur = FT_MulFix( width->org, scale );
       width->fit = width->cur;
+
+      FT_TRACE5(( "  %d scaled to %.2f\n",
+                  width->org,
+                  width->cur / 64.0 ));
     }
 
+    FT_TRACE5(( "\n" ));
+
     /* an extra-light axis corresponds to a standard width that is */
     /* smaller than 5/8 pixels                                     */
     axis->extra_light =
       (FT_Bool)( FT_MulFix( axis->standard_width, scale ) < 32 + 8 );
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+    if ( axis->extra_light )
+      FT_TRACE5(( "`%s' style is extra light (at current resolution)\n"
+                  "\n",
+                  af_style_names[metrics->root.style_class->style] ));
+#endif
+
     if ( dim == AF_DIMENSION_VERT )
     {
+      FT_TRACE5(( "blue zones (style `%s')\n",
+                  af_style_names[metrics->root.style_class->style] ));
+
       /* scale the blue zones */
       for ( nn = 0; nn < axis->blue_count; nn++ )
       {
 
           if ( delta2 < 32 )
             delta2 = 0;
-          else if ( delta < 48 )
+          else if ( delta2 < 48 )
             delta2 = 32;
           else
             delta2 = 64;
 #endif
 
           blue->flags |= AF_LATIN_BLUE_ACTIVE;
+
+          FT_TRACE5(( "  reference %d: %d scaled to %.2f%s\n"
+                      "  overshoot %d: %d scaled to %.2f%s\n",
+                      nn,
+                      blue->ref.org,
+                      blue->ref.fit / 64.0,
+                      blue->flags & AF_LATIN_BLUE_ACTIVE ? ""
+                                                         : " (inactive)",
+                      nn,
+                      blue->shoot.org,
+                      blue->shoot.fit / 64.0,
+                      blue->flags & AF_LATIN_BLUE_ACTIVE ? ""
+                                                         : " (inactive)" ));
         }
       }
     }
   {
     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_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;
 
             on_edge = 0;
             segment = NULL;
-            /* fallthrough */
+            /* fall through */
           }
         }
 
           /* this is the start of a new segment! */
           segment_dir = (AF_Direction)point->out_dir;
 
-          /* clear all segment fields */
           error = af_axis_hints_new_segment( axis, memory, &segment );
           if ( error )
             goto Exit;
 
-          segment[0]        = seg0;
+          /* clear all segment fields */
+          segment[0] = seg0;
+
           segment->dir      = (FT_Char)segment_dir;
           min_pos = max_pos = point->u;
           segment->first    = point;
           segment->last     = point;
-          on_edge           = 1;
+
+          on_edge = 1;
         }
 
         point = point->next;
     } /* 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;
         FT_Pos    last_v  = last->v;
 
 
-        if ( first == last )
-          continue;
-
         if ( first_v < last_v )
         {
           AF_Point  p;
   }
 
 
-  /* Link segments to form stems and serifs. */
+  /* Link segments to form stems and serifs.  If `width_count' and      */
+  /* `widths' are non-zero, use them to fine-tune the scoring function. */
 
   FT_LOCAL_DEF( void )
   af_latin_hints_link_segments( AF_GlyphHints  hints,
+                                FT_UInt        width_count,
+                                AF_WidthRec*   widths,
                                 AF_Dimension   dim )
   {
     AF_AxisHints  axis          = &hints->axis[dim];
     AF_Segment    segments      = axis->segments;
     AF_Segment    segment_limit = segments + axis->num_segments;
-    FT_Pos        len_threshold, len_score;
+    FT_Pos        len_threshold, len_score, dist_score, max_width;
     AF_Segment    seg1, seg2;
 
 
+    if ( width_count )
+      max_width = widths[width_count - 1].org;
+    else
+      max_width = 0;
+
+    /* a heuristic value to set up a minimum value for overlapping */
     len_threshold = AF_LATIN_CONSTANT( hints->metrics, 8 );
     if ( len_threshold == 0 )
       len_threshold = 1;
 
+    /* a heuristic value to weight lengths */
     len_score = AF_LATIN_CONSTANT( hints->metrics, 6000 );
 
+    /* a heuristic value to weight distances (no call to    */
+    /* AF_LATIN_CONSTANT needed, since we work on multiples */
+    /* of the stem width)                                   */
+    dist_score = 3000;
+
     /* now compare each segment to the others */
     for ( seg1 = segments; seg1 < segment_limit; seg1++ )
     {
-      /* the fake segments are introduced to hint the metrics -- */
-      /* we must never link them to anything                     */
-      if ( seg1->dir != axis->major_dir || seg1->first == seg1->last )
+      if ( seg1->dir != axis->major_dir )
         continue;
 
       /* search for stems having opposite directions, */
         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;
 
 
           if ( min < seg2->min_coord )
             max = seg2->max_coord;
 
           /* compute maximum coordinate difference of the two segments */
+          /* (this is, how much they overlap)                          */
           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;
+            /*
+             *  The score is the sum of two demerits indicating the
+             *  `badness' of a fit, measured along the segments' main axis
+             *  and orthogonal to it, respectively.
+             *
+             *  o The less overlapping along the main axis, the worse it
+             *    is, causing a larger demerit.
+             *
+             *  o The nearer the orthogonal distance to a stem width, the
+             *    better it is, causing a smaller demerit.  For simplicity,
+             *    however, we only increase the demerit for values that
+             *    exceed the largest stem width.
+             */
+
+            FT_Pos  dist = pos2 - pos1;
+
+            FT_Pos  dist_demerit, score;
+
+
+            if ( max_width )
+            {
+              /* distance demerits are based on multiples of `max_width'; */
+              /* we scale by 1024 for getting more precision              */
+              FT_Pos  delta = ( dist << 10 ) / max_width - ( 1 << 10 );
+
+
+              if ( delta > 10000 )
+                dist_demerit = 32000;
+              else if ( delta > 0 )
+                dist_demerit = delta * delta / dist_score;
+              else
+                dist_demerit = 0;
+            }
+            else
+              dist_demerit = dist; /* default if no widths available */
+
+            score = dist_demerit + len_score / len;
 
             /* and we search for the smallest score */
-            /* of the sum of the two values         */
             if ( score < seg1->score )
             {
               seg1->score = score;
                                 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];
 
     }
 
 
-    /*********************************************************************/
-    /*                                                                   */
-    /* Good, we will 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                                                  */
-    /*                                                                   */
-    /*********************************************************************/
+    /******************************************************************/
+    /*                                                                */
+    /* 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                       */
 
   FT_LOCAL_DEF( FT_Error )
   af_latin_hints_detect_features( AF_GlyphHints  hints,
+                                  FT_UInt        width_count,
+                                  AF_WidthRec*   widths,
                                   AF_Dimension   dim )
   {
     FT_Error  error;
     error = af_latin_hints_compute_segments( hints, dim );
     if ( !error )
     {
-      af_latin_hints_link_segments( hints, dim );
+      af_latin_hints_link_segments( hints, width_count, widths, dim );
 
       error = af_latin_hints_compute_edges( hints, dim );
     }
     /* for each horizontal edge search the blue zone which is closest */
     for ( ; edge < edge_limit; edge++ )
     {
-      FT_Int    bb;
-      AF_Width  best_blue = NULL;
-      FT_Pos    best_dist;  /* initial threshold */
+      FT_UInt   bb;
+      AF_Width  best_blue            = NULL;
+      FT_Bool   best_blue_is_neutral = 0;
+      FT_Pos    best_dist;                 /* initial threshold */
 
 
       /* compute the initial threshold as a fraction of the EM size */
       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;
+        FT_Bool       is_top_blue, is_neutral_blue, is_major_dir;
 
 
         /* skip inactive blue zones (i.e., those that are too large) */
         if ( !( blue->flags & AF_LATIN_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_blue  = (FT_Byte)( ( blue->flags & AF_LATIN_BLUE_TOP ) != 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_blue ^ is_major_dir )
+        /* if it is a top zone, check for right edges (against the major */
+        /* direction); if it is a bottom zone, check for left edges (in  */
+        /* the major direction) -- this assumes the TrueType convention  */
+        /* for the orientation of contours                               */
+        is_top_blue =
+          (FT_Byte)( ( blue->flags & AF_LATIN_BLUE_TOP ) != 0 );
+        is_neutral_blue =
+          (FT_Byte)( ( blue->flags & AF_LATIN_BLUE_NEUTRAL ) != 0);
+        is_major_dir =
+          FT_BOOL( edge->dir == axis->major_dir );
+
+        /* neutral blue zones are handled for both directions */
+        if ( is_top_blue ^ is_major_dir || is_neutral_blue )
         {
           FT_Pos  dist;
 
           dist = FT_MulFix( dist, scale );
           if ( dist < best_dist )
           {
-            best_dist = dist;
-            best_blue = &blue->ref;
+            best_dist            = dist;
+            best_blue            = &blue->ref;
+            best_blue_is_neutral = is_neutral_blue;
           }
 
           /* 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 )
+          /* position of a bottom zone (provided we don't have a        */
+          /* neutral blue zone)                                         */
+          if ( edge->flags & AF_EDGE_ROUND &&
+               dist != 0                   &&
+               !is_neutral_blue            )
           {
             FT_Bool  is_under_ref = FT_BOOL( edge->fpos < blue->ref.org );
 
               dist = FT_MulFix( dist, scale );
               if ( dist < best_dist )
               {
-                best_dist = dist;
-                best_blue = &blue->shoot;
+                best_dist            = dist;
+                best_blue            = &blue->shoot;
+                best_blue_is_neutral = is_neutral_blue;
               }
             }
           }
       }
 
       if ( best_blue )
+      {
         edge->blue_edge = best_blue;
+        if ( best_blue_is_neutral )
+          edge->flags |= AF_EDGE_NEUTRAL;
+      }
     }
   }
 
     FT_Face         face = metrics->root.scaler.face;
 
 
-    af_glyph_hints_rescale( hints, (AF_ScriptMetrics)metrics );
+    af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
 
     /*
      *  correct x_scale and y_scale if needed, since they may have
 
 #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;
-    }
 #endif
 
     scaler_flags = hints->scaler_flags;
     hints->scaler_flags = scaler_flags;
     hints->other_flags  = other_flags;
 
-    return AF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
                                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_Pos           dist     = width;
     FT_Int           sign     = 0;
     FT_Int           vertical = ( dim == AF_DIMENSION_VERT );
             if ( delta < 0 )
               delta = -delta;
 
-            if (delta >= 16)
+            if ( delta >= 16 )
             {
               dist = org_dist;
               if ( dist < 48 )
 
     stem_edge->pos = base_edge->pos + fitted_width;
 
-    FT_TRACE5(( "  LINK: edge %d (opos=%.2f) linked to (%.2f),"
+    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 - hints->axis[dim].edges, stem_edge->opos / 64.0,
                 stem_edge->pos / 64.0, dist / 64.0, fitted_width / 64.0 ));
   }
 
     AF_Edge       anchor     = NULL;
     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"));
+    FT_TRACE5(( "latin %s edge hinting (style `%s')\n",
+                dim == AF_DIMENSION_VERT ? "horizontal" : "vertical",
+                af_style_names[hints->metrics->style_class->style] ));
 
     /* we begin by aligning all stems relative to the blue zone */
     /* if needed -- that's only for horizontal edges            */
         if ( edge->flags & AF_EDGE_DONE )
           continue;
 
-        blue  = edge->blue_edge;
         edge1 = NULL;
         edge2 = edge->link;
 
+        /*
+         *  If a stem contains both a neutral and a non-neutral blue zone,
+         *  skip the neutral one.  Otherwise, outlines with different
+         *  directions might be incorrectly aligned at the same vertical
+         *  position.
+         *
+         *  If we have two neutral blue zones, skip one of them.
+         *
+         */
+        if ( edge->blue_edge && edge2 && edge2->blue_edge )
+        {
+          FT_Byte  neutral  = edge->flags  & AF_EDGE_NEUTRAL;
+          FT_Byte  neutral2 = edge2->flags & AF_EDGE_NEUTRAL;
+
+
+          if ( ( neutral && neutral2 ) || neutral2 )
+          {
+            edge2->blue_edge = NULL;
+            edge2->flags    &= ~AF_EDGE_NEUTRAL;
+          }
+          else if ( neutral )
+          {
+            edge->blue_edge = NULL;
+            edge->flags    &= ~AF_EDGE_NEUTRAL;
+          }
+        }
+
+        blue = edge->blue_edge;
         if ( blue )
           edge1 = edge;
 
-        /* flip edges if the other stem is aligned to a blue zone */
+        /* flip edges if the other edge is aligned to a blue zone */
         else if ( edge2 && edge2->blue_edge )
         {
           blue  = edge2->blue_edge;
         if ( !edge1 )
           continue;
 
-        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 ));
+#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;
         {
           af_latin_align_linked_edge( hints, dim, edge1, edge2 );
           edge2->flags |= AF_EDGE_DONE;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+          num_actions++;
+#endif
         }
 
         if ( !anchor )
       /* 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 ));
+        FT_TRACE5(( "  ASSERTION FAILED for edge %d\n", edge2 - edges ));
 
         af_latin_align_linked_edge( hints, dim, edge2, edge );
         edge->flags |= AF_EDGE_DONE;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+        num_actions++;
+#endif
         continue;
       }
 
         else
           edge->pos = FT_PIX_ROUND( edge->opos );
 
+        anchor       = edge;
+        edge->flags |= AF_EDGE_DONE;
+
         FT_TRACE5(( "  ANCHOR: edge %d (opos=%.2f) and %d (opos=%.2f)"
-                    " snapped to (%.2f) (%.2f)\n",
+                    " 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 ));
-        anchor = edge;
-
-        edge->flags |= AF_EDGE_DONE;
 
         af_latin_align_linked_edge( hints, dim, edge, edge2 );
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+        num_actions += 2;
+#endif
       }
       else
       {
 
           cur_pos1 = FT_PIX_ROUND( org_center );
 
-          if (cur_len <= 64 )
+          if ( cur_len <= 64 )
           {
             u_off = 32;
             d_off = 32;
           edge->pos  = cur_pos1 - cur_len / 2;
           edge2->pos = cur_pos1 + cur_len / 2;
 
-          FT_TRACE5(( "  STEM: %d (opos=%.2f) to %d (opos=%.2f)"
-                      " snapped to (%.2f) and (%.2f)\n",
+          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 );
           edge->pos  = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2;
           edge2->pos = edge->pos + cur_len;
 
-          FT_TRACE5(( "  STEM: %d (opos=%.2f) to %d (opos=%.2f)"
-                      " snapped to (%.2f) and (%.2f)\n",
+          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 )
         {
-          FT_TRACE5(( "  BOUND: %d (pos=%.2f) to (%.2f)\n",
+#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;
         }
       }
         {
           af_latin_align_serif_edge( hints, edge->serif, edge );
           FT_TRACE5(( "  SERIF: edge %d (opos=%.2f) serif to %d (opos=%.2f)"
-                      " aligned to (%.2f)\n",
+                      " aligned to %.2f\n",
                       edge - edges, edge->opos / 64.0,
                       edge->serif - edges, edge->serif->opos / 64.0,
                       edge->pos / 64.0 ));
           edge->pos = FT_PIX_ROUND( edge->opos );
           anchor    = edge;
           FT_TRACE5(( "  SERIF_ANCHOR: edge %d (opos=%.2f)"
-                      " snapped to (%.2f)\n",
+                      " snapped to %.2f\n",
                       edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));
         }
         else
                                      after->pos - before->pos,
                                      after->opos - before->opos );
 
-            FT_TRACE5(( "  SERIF_LINK1: edge %d (opos=%.2f) snapped to (%.2f)"
+            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,
           {
             edge->pos = anchor->pos +
                         ( ( edge->opos - anchor->opos + 16 ) & ~31 );
-
             FT_TRACE5(( "  SERIF_LINK2: edge %d (opos=%.2f)"
-                        " snapped to (%.2f)\n",
+                        " 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 )
+        {
+#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;
+        }
 
         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;
+        }
       }
     }
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+    if ( !num_actions )
+      FT_TRACE5(( "  (none)\n" ));
     FT_TRACE5(( "\n" ));
+#endif
   }
 
 
     FT_Error  error;
     int       dim;
 
+    AF_LatinAxis  axis;
+
 
     error = af_glyph_hints_reload( hints, outline );
     if ( error )
     if ( AF_HINTS_DO_HORIZONTAL( hints ) )
 #endif
     {
-      error = af_latin_hints_detect_features( hints, AF_DIMENSION_HORZ );
+      axis  = &metrics->axis[AF_DIMENSION_HORZ];
+      error = af_latin_hints_detect_features( hints,
+                                              axis->width_count,
+                                              axis->widths,
+                                              AF_DIMENSION_HORZ );
       if ( error )
         goto Exit;
     }
 
     if ( AF_HINTS_DO_VERTICAL( hints ) )
     {
-      error = af_latin_hints_detect_features( hints, AF_DIMENSION_VERT );
+      axis  = &metrics->axis[AF_DIMENSION_VERT];
+      error = af_latin_hints_detect_features( hints,
+                                              axis->width_count,
+                                              axis->widths,
+                                              AF_DIMENSION_VERT );
       if ( error )
         goto Exit;
 
         af_glyph_hints_align_weak_points( hints, (AF_Dimension)dim );
       }
     }
+
     af_glyph_hints_save( hints, outline );
 
   Exit:
   /*************************************************************************/
 
 
-  /* XXX: this should probably fine tuned to differentiate better between */
-  /*      scripts...                                                      */
+  AF_DEFINE_WRITING_SYSTEM_CLASS(
+    af_latin_writing_system_class,
 
-  static const AF_Script_UniRangeRec  af_latin_uniranges[] =
-  {
-    AF_UNIRANGE_REC(  0x0020UL,  0x007FUL ),  /* Basic Latin (no control chars) */
-    AF_UNIRANGE_REC(  0x00A0UL,  0x00FFUL ),  /* Latin-1 Supplement (no control chars) */
-    AF_UNIRANGE_REC(  0x0100UL,  0x017FUL ),  /* Latin Extended-A */
-    AF_UNIRANGE_REC(  0x0180UL,  0x024FUL ),  /* Latin Extended-B */
-    AF_UNIRANGE_REC(  0x0250UL,  0x02AFUL ),  /* IPA Extensions */
-    AF_UNIRANGE_REC(  0x02B0UL,  0x02FFUL ),  /* Spacing Modifier Letters */
-    AF_UNIRANGE_REC(  0x0300UL,  0x036FUL ),  /* Combining Diacritical Marks */
-    AF_UNIRANGE_REC(  0x0370UL,  0x03FFUL ),  /* Greek and Coptic */
-    AF_UNIRANGE_REC(  0x0400UL,  0x04FFUL ),  /* Cyrillic */
-    AF_UNIRANGE_REC(  0x0500UL,  0x052FUL ),  /* Cyrillic Supplement */
-    AF_UNIRANGE_REC(  0x1D00UL,  0x1D7FUL ),  /* Phonetic Extensions */
-    AF_UNIRANGE_REC(  0x1D80UL,  0x1DBFUL ),  /* Phonetic Extensions Supplement */
-    AF_UNIRANGE_REC(  0x1DC0UL,  0x1DFFUL ),  /* Combining Diacritical Marks Supplement */
-    AF_UNIRANGE_REC(  0x1E00UL,  0x1EFFUL ),  /* Latin Extended Additional */
-    AF_UNIRANGE_REC(  0x1F00UL,  0x1FFFUL ),  /* Greek Extended */
-    AF_UNIRANGE_REC(  0x2000UL,  0x206FUL ),  /* General Punctuation */
-    AF_UNIRANGE_REC(  0x2070UL,  0x209FUL ),  /* Superscripts and Subscripts */
-    AF_UNIRANGE_REC(  0x20A0UL,  0x20CFUL ),  /* Currency Symbols */
-    AF_UNIRANGE_REC(  0x2150UL,  0x218FUL ),  /* Number Forms */
-    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(  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(       0UL,       0UL )
-  };
-
-
-  AF_DEFINE_SCRIPT_CLASS( af_latin_script_class,
-    AF_SCRIPT_LATIN,
-    af_latin_uniranges,
+    AF_WRITING_SYSTEM_LATIN,
 
     sizeof ( AF_LatinMetricsRec ),
 
-    (AF_Script_InitMetricsFunc) af_latin_metrics_init,
-    (AF_Script_ScaleMetricsFunc)af_latin_metrics_scale,
-    (AF_Script_DoneMetricsFunc) NULL,
+    (AF_WritingSystem_InitMetricsFunc) af_latin_metrics_init,
+    (AF_WritingSystem_ScaleMetricsFunc)af_latin_metrics_scale,
+    (AF_WritingSystem_DoneMetricsFunc) NULL,
 
-    (AF_Script_InitHintsFunc)   af_latin_hints_init,
-    (AF_Script_ApplyHintsFunc)  af_latin_hints_apply
+    (AF_WritingSystem_InitHintsFunc)   af_latin_hints_init,
+    (AF_WritingSystem_ApplyHintsFunc)  af_latin_hints_apply
   )
 
 
index c5c2d13..2c0bfca 100644 (file)
@@ -2,9 +2,10 @@
 /*                                                                         */
 /*  aflatin.h                                                              */
 /*                                                                         */
-/*    Auto-fitter hinting routines for latin script (specification).       */
+/*    Auto-fitter hinting routines for latin writing system                */
+/*    (specification).                                                     */
 /*                                                                         */
-/*  Copyright 2003-2007, 2009, 2011 by                                     */
+/*  Copyright 2003-2007, 2009, 2011-2014 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 FT_BEGIN_HEADER
 
+  /* the `latin' writing system */
 
-  /* the latin-specific script class */
-
-  AF_DECLARE_SCRIPT_CLASS(af_latin_script_class)
+  AF_DECLARE_WRITING_SYSTEM_CLASS( af_latin_writing_system_class )
 
 
   /* constants are given with units_per_em == 2048 in mind */
@@ -46,40 +46,30 @@ FT_BEGIN_HEADER
 
   /*
    *  The following declarations could be embedded in the file `aflatin.c';
-   *  they have been made semi-public to allow alternate script hinters to
-   *  re-use some of them.
+   *  they have been made semi-public to allow alternate writing system
+   *  hinters to re-use some of them.
    */
 
 
-  /* Latin (global) metrics management */
-
-  enum
-  {
-    AF_LATIN_BLUE_CAPITAL_TOP,
-    AF_LATIN_BLUE_CAPITAL_BOTTOM,
-    AF_LATIN_BLUE_SMALL_F_TOP,
-    AF_LATIN_BLUE_SMALL_TOP,
-    AF_LATIN_BLUE_SMALL_BOTTOM,
-    AF_LATIN_BLUE_SMALL_MINOR,
-
-    AF_LATIN_BLUE_MAX
-  };
-
-
-#define AF_LATIN_IS_TOP_BLUE( b )  ( (b) == AF_LATIN_BLUE_CAPITAL_TOP || \
-                                     (b) == AF_LATIN_BLUE_SMALL_F_TOP || \
-                                     (b) == AF_LATIN_BLUE_SMALL_TOP   )
+#define AF_LATIN_IS_TOP_BLUE( b ) \
+          ( (b)->properties & AF_BLUE_PROPERTY_LATIN_TOP )
+#define AF_LATIN_IS_NEUTRAL_BLUE( b ) \
+          ( (b)->properties & AF_BLUE_PROPERTY_LATIN_NEUTRAL )
+#define AF_LATIN_IS_X_HEIGHT_BLUE( b ) \
+          ( (b)->properties & AF_BLUE_PROPERTY_LATIN_X_HEIGHT )
+#define AF_LATIN_IS_LONG_BLUE( b ) \
+          ( (b)->properties & AF_BLUE_PROPERTY_LATIN_LONG )
 
 #define AF_LATIN_MAX_WIDTHS  16
-#define AF_LATIN_MAX_BLUES   AF_LATIN_BLUE_MAX
 
 
   enum
   {
-    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_ACTIVE     = 1 << 0, /* set if zone height is <= 3/4px   */
+    AF_LATIN_BLUE_TOP        = 1 << 1, /* set if we have a top blue zone   */
+    AF_LATIN_BLUE_NEUTRAL    = 1 << 2, /* set if we have neutral blue zone */
+    AF_LATIN_BLUE_ADJUSTMENT = 1 << 3, /* used for scale adjustment        */
+                                       /* optimization                     */
     AF_LATIN_BLUE_FLAG_MAX
   };
 
@@ -106,7 +96,7 @@ FT_BEGIN_HEADER
 
     /* ignored for horizontal metrics */
     FT_UInt          blue_count;
-    AF_LatinBlueRec  blues[AF_LATIN_BLUE_MAX];
+    AF_LatinBlueRec  blues[AF_BLUE_STRINGSET_MAX];
 
     FT_Fixed         org_scale;
     FT_Pos           org_delta;
@@ -116,9 +106,9 @@ FT_BEGIN_HEADER
 
   typedef struct  AF_LatinMetricsRec_
   {
-    AF_ScriptMetricsRec  root;
-    FT_UInt              units_per_em;
-    AF_LatinAxisRec      axis[AF_DIMENSION_MAX];
+    AF_StyleMetricsRec  root;
+    FT_UInt             units_per_em;
+    AF_LatinAxisRec     axis[AF_DIMENSION_MAX];
 
   } AF_LatinMetricsRec, *AF_LatinMetrics;
 
@@ -133,8 +123,7 @@ FT_BEGIN_HEADER
 
   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,
@@ -174,31 +163,27 @@ 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
+   *  writing systems might like to use these functions as-is.
    */
   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,
+                                FT_UInt        width_count,
+                                AF_WidthRec*   widths,
                                 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_detect_features( AF_GlyphHints  hints,
+                                  FT_UInt        width_count,
+                                  AF_WidthRec*   widths,
                                   AF_Dimension   dim );
 
 /* */
index ea6af8d..07590b3 100644 (file)
@@ -2,9 +2,9 @@
 /*                                                                         */
 /*  aflatin2.c                                                             */
 /*                                                                         */
-/*    Auto-fitter hinting routines for latin script (body).                */
+/*    Auto-fitter hinting routines for latin writing system (body).        */
 /*                                                                         */
-/*  Copyright 2003-2011 by                                                 */
+/*  Copyright 2003-2014 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -18,6 +18,7 @@
 
 #include FT_ADVANCES_H
 
+#include "afglobal.h"
 #include "aflatin.h"
 #include "aflatin2.h"
 #include "aferrors.h"
@@ -56,8 +57,7 @@
 
   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];
@@ -76,7 +76,9 @@
       AF_Scaler            scaler = &dummy->root.scaler;
 
 
-      glyph_index = FT_Get_Char_Index( face, charcode );
+      glyph_index = FT_Get_Char_Index(
+                      face,
+                      metrics->root.style_class->standard_char );
       if ( glyph_index == 0 )
         goto Exit;
 
@@ -93,7 +95,7 @@
       scaler->render_mode = FT_RENDER_MODE_NORMAL;
       scaler->flags       = 0;
 
-      af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy );
+      af_glyph_hints_rescale( hints, (AF_StyleMetrics)dummy );
 
       error = af_glyph_hints_reload( hints, &face->glyph->outline );
       if ( error )
     /* 'af_latin2_blue_chars[blues]' string, then compute its top-most or */
     /* bottom-most points (depending on `AF_IS_TOP_BLUE')                 */
 
-    FT_TRACE5(( "blue zones computation\n" ));
-    FT_TRACE5(( "------------------------------------------------\n" ));
+    FT_TRACE5(( "blue zones computation\n"
+                "======================\n\n" ));
 
     for ( bb = 0; bb < AF_LATIN_BLUE_MAX; bb++ )
     {
       FT_Pos*      blue_shoot;
 
 
-      FT_TRACE5(( "blue %3d: ", bb ));
+      FT_TRACE5(( "blue zone %d:\n", bb ));
 
       num_flats  = 0;
       num_rounds = 0;
         FT_Bool     round;
 
 
-        FT_TRACE5(( "'%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 )
               best_last  = last;
             }
           }
-          FT_TRACE5(( "%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              */
         {
+          FT_Pos  best_x = points[best_point].x;
           FT_Int  start, end, prev, next;
           FT_Pos  dist;
 
 
           do
           {
-            prev = start-1;
+            prev = start - 1;
             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;
 
 
           do
           {
-            next = end+1;
+            next = end + 1;
             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;
 
             FT_CURVE_TAG( glyph->outline.tags[start] ) != FT_CURVE_TAG_ON ||
             FT_CURVE_TAG( glyph->outline.tags[ end ] ) != FT_CURVE_TAG_ON );
 
-          FT_TRACE5(( "%c ", round ? 'r' : 'f' ));
+          FT_TRACE5(( " (%s)\n", round ? "round" : "flat" ));
         }
 
         if ( round )
           flats[num_flats++]   = best_y;
       }
 
-      FT_TRACE5(( "\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
          */
-        FT_TRACE5(( "empty\n" ));
+        FT_TRACE5(( "  empty\n" ));
         continue;
       }
 
 
 
         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 |= AF_LATIN_BLUE_TOP;
 
       /*
-       * The following flags is used later to adjust the y and x scales
+       * The following flag is used later to adjust the y and x scales
        * in order to optimize the pixel grid alignment of the top of small
        * letters.
        */
-      if ( bb == AF_LATIN_BLUE_SMALL_TOP )
+      if ( AF_LATIN_IS_X_HEIGHT_BLUE( bb ) )
         blue->flags |= AF_LATIN_BLUE_ADJUSTMENT;
 
-      FT_TRACE5(( "-- ref = %ld, shoot = %ld\n", *blue_ref, *blue_shoot ));
+      FT_TRACE5(( "    -> reference = %ld\n"
+                  "       overshoot = %ld\n",
+                  *blue_ref, *blue_shoot ));
     }
 
     return;
   af_latin2_metrics_init( AF_LatinMetrics  metrics,
                           FT_Face          face )
   {
-    FT_Error    error = AF_Err_Ok;
+    FT_Error    error  = FT_Err_Ok;
     FT_CharMap  oldmap = face->charmap;
     FT_UInt     ee;
 
 
     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 );
-    return AF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
 
       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 )
   {
     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_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;
         segment->dir       = first->out_dir;
         segment->first     = first;
         segment->last      = point;
-        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->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;
-          AF_Flags  f0   = (AF_Flags)(pt->flags & AF_FLAG_CONTROL);
+          AF_Flags  f0   = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );
           AF_Flags  f1;
 
 
           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;
           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;
 
         FT_Pos    last_v  = last->v;
 
 
-        if ( first == last )
-          continue;
-
         if ( first_v < last_v )
         {
           p = first->prev;
       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 )
         {
-          for (jj = ii+1; jj < count; jj++)
+          for ( jj = ii + 1; jj < count; jj++ )
           {
             if ( segments[jj].dir < 0 )
             {
               AF_SegmentRec  tmp;
 
+
               tmp          = segments[ii];
               segments[ii] = segments[jj];
               segments[jj] = tmp;
 #ifdef AF_SORT_SEGMENTS
     for ( seg1 = segments; seg1 < segment_mid; seg1++ )
     {
-      if ( seg1->dir != axis->major_dir || seg1->first == seg1->last )
+      if ( seg1->dir != axis->major_dir )
         continue;
 
       for ( seg2 = segment_mid; seg2 < segment_limit; seg2++ )
     /* now compare each segment to the others */
     for ( seg1 = segments; seg1 < segment_limit; seg1++ )
     {
-      /* the fake segments are introduced to hint the metrics -- */
-      /* we must never link them to anything                     */
-      if ( seg1->dir != axis->major_dir || seg1->first == seg1->last )
+      if ( seg1->dir != axis->major_dir )
         continue;
 
       for ( seg2 = segments; seg2 < segment_limit; seg2++ )
                                  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];
 
     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 );
     }
       {
         FT_Pos  dist = seg->serif->pos - seg->pos;
 
-        if (dist < 0)
+
+        if ( dist < 0 )
           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;
 
         edge->first    = seg;
         edge->last     = seg;
-        edge->fpos     = seg->pos;
         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
             compare = &blue->ref;
 
           dist = edge->fpos - compare->org;
-          if (dist < 0)
+          if ( dist < 0 )
             dist = -dist;
 
           dist = FT_MulFix( dist, scale );
     FT_Face         face = metrics->root.scaler.face;
 
 
-    af_glyph_hints_rescale( hints, (AF_ScriptMetrics)metrics );
+    af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
 
     /*
      *  correct x_scale and y_scale if needed, since they may have
      *  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;
     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 ( delta < 0 )
               delta = -delta;
 
-            if (delta >= 16)
+            if ( delta >= 16 )
             {
               dist = org_dist;
               if ( dist < 48 )
   {
     FT_UNUSED( hints );
 
-    serif->pos = base->pos + (serif->opos - base->opos);
+    serif->pos = base->pos + ( serif->opos - base->opos );
   }
 
 
         {
           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;
         }
       }
     }
 
         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;
 
         FT_TRACE5(( "DRIFT: %.2f\n", anchor_drift/64.0 ));
       }
                    (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 );
 
         FT_TRACE5(( "ALIGN: left=%.2f right=%.2f ",
                     org_left / 64.0, org_right / 64.0 ));
           }
 
           /* 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 ) )
           {
             FT_TRACE5(( "single pixel stem\n" ));
             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
             * 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;
-              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;
-              FT_TRACE5(( "dispA=%.2f (%d) ", (fit - org) / 64.0, delta ));
+              FT_TRACE5(( "dispA=%.2f (%d) ", ( fit - org ) / 64.0, delta ));
 
               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;
-              FT_TRACE5(( "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;
-          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;
-          FT_TRACE5(( "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;
-          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;
-          FT_TRACE5(( "dispD=%.2f (%d) ", (fit - org) / 64.0, delta ));
+          FT_TRACE5(( "dispD=%.2f (%d) ", ( fit - org ) / 64.0, delta ));
 
           /* now find the best displacement */
           {
             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];
         }
 
       AlignStem:
-        edge->pos  = cur_center - (cur_len >> 1);
+        edge->pos  = cur_center - ( cur_len >> 1 );
         edge2->pos = edge->pos + cur_len;
 
         FT_TRACE5(( "STEM1: %d (opos=%.2f) to %d (opos=%.2f)"
   /*************************************************************************/
 
 
-  static const AF_Script_UniRangeRec  af_latin2_uniranges[] =
-  {
-    AF_UNIRANGE_REC( 32UL,  127UL ),    /* TODO: Add new Unicode ranges here! */
-    AF_UNIRANGE_REC( 160UL, 255UL ),
-    AF_UNIRANGE_REC( 0UL,   0UL )
-  };
-
+  AF_DEFINE_WRITING_SYSTEM_CLASS(
+    af_latin2_writing_system_class,
 
-  AF_DEFINE_SCRIPT_CLASS( af_latin2_script_class,
-    AF_SCRIPT_LATIN2,
-    af_latin2_uniranges,
+    AF_WRITING_SYSTEM_LATIN2,
 
     sizeof ( AF_LatinMetricsRec ),
 
-    (AF_Script_InitMetricsFunc) af_latin2_metrics_init,
-    (AF_Script_ScaleMetricsFunc)af_latin2_metrics_scale,
-    (AF_Script_DoneMetricsFunc) NULL,
+    (AF_WritingSystem_InitMetricsFunc) af_latin2_metrics_init,
+    (AF_WritingSystem_ScaleMetricsFunc)af_latin2_metrics_scale,
+    (AF_WritingSystem_DoneMetricsFunc) NULL,
 
-    (AF_Script_InitHintsFunc)   af_latin2_hints_init,
-    (AF_Script_ApplyHintsFunc)  af_latin2_hints_apply
+    (AF_WritingSystem_InitHintsFunc)   af_latin2_hints_init,
+    (AF_WritingSystem_ApplyHintsFunc)  af_latin2_hints_apply
   )
 
 
index 925c621..b5d252a 100644 (file)
@@ -2,9 +2,10 @@
 /*                                                                         */
 /*  aflatin2.h                                                             */
 /*                                                                         */
-/*    Auto-fitter hinting routines for latin script (specification).       */
+/*    Auto-fitter hinting routines for latin writing system                */
+/*    (specification).                                                     */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007 by                              */
+/*  Copyright 2003-2007, 2012, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 FT_BEGIN_HEADER
 
 
-  /* the latin-specific script class */
+  /* the `latin' writing system */
+
+  AF_DECLARE_WRITING_SYSTEM_CLASS( af_latin2_writing_system_class )
 
-  AF_DECLARE_SCRIPT_CLASS(af_latin2_script_class)
 
 /* */
 
index 34ef9d8..fb15c87 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter glyph loading routines (body).                           */
 /*                                                                         */
-/*  Copyright 2003-2009, 2011-2012 by                                      */
+/*  Copyright 2003-2009, 2011-2014 by                                      */
 /*  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 "afglobal.h"
 #include "aferrors.h"
+#include "afmodule.h"
+#include "afpic.h"
 
 
   /* Initialize glyph loader. */
 
   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 );
   /* Reset glyph loader and compute globals if necessary. */
 
   FT_LOCAL_DEF( FT_Error )
-  af_loader_reset( AF_Loader  loader,
+  af_loader_reset( AF_Module  module,
                    FT_Face    face )
   {
-    FT_Error  error = AF_Err_Ok;
+    FT_Error   error  = FT_Err_Ok;
+    AF_Loader  loader = module->loader;
 
 
     loader->face    = face;
@@ -54,7 +60,7 @@
 
     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 =
   /* Finalize glyph loader. */
 
   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;
     FT_Error          error;
     FT_Face           face     = loader->face;
     FT_GlyphLoader    gloader  = loader->gloader;
-    AF_ScriptMetrics  metrics  = loader->metrics;
+    AF_StyleMetrics   metrics  = loader->metrics;
     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;
 
       loader->trans_delta  = internal->glyph_delta;
 
       inverse = loader->trans_matrix;
-      FT_Matrix_Invert( &inverse );
-      FT_Vector_Transform( &loader->trans_delta, &inverse );
+      if ( !FT_Matrix_Invert( &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:
                               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 );
 
       /* now load the slot image into the auto-outline and run the */
       /* automatic hinting process                                 */
-      if ( metrics->clazz->script_hints_apply )
-        metrics->clazz->script_hints_apply( hints,
-                                            &gloader->current.outline,
-                                            metrics );
+      {
+#ifdef FT_CONFIG_OPTION_PIC
+        AF_FaceGlobals         globals = loader->globals;
+#endif
+        AF_StyleClass          style_class = metrics->style_class;
+        AF_WritingSystemClass  writing_system_class =
+          AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];
+
+
+        if ( writing_system_class->style_hints_apply )
+          writing_system_class->style_hints_apply( hints,
+                                                   &gloader->current.outline,
+                                                   metrics );
+      }
 
       /* we now need to adjust the metrics according to the change in */
       /* width/positioning that occurred during the hinting process   */
           /* recompute subglyph pointer */
           subglyph = gloader->base.subglyphs + num_base_subgs + nn;
 
-          if ( subglyph->flags & FT_SUBGLYPH_FLAG_USE_MY_METRICS )
-          {
-            pp1 = loader->pp1;
-            pp2 = loader->pp2;
-          }
-          else
+          if ( !( subglyph->flags & FT_SUBGLYPH_FLAG_USE_MY_METRICS ) )
           {
             loader->pp1 = pp1;
             loader->pp2 = pp2;
             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;
 
-            /* 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;
 
 
     default:
       /* we don't support other formats (yet?) */
-      error = AF_Err_Unimplemented_Feature;
+      error = FT_THROW( Unimplemented_Feature );
     }
 
   Hint_Metrics:
   /* Load a glyph. */
 
   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_Int32   load_flags )
   {
     FT_Error      error;
-    FT_Size       size = face->size;
+    FT_Size       size   = face->size;
+    AF_Loader     loader = module->loader;
     AF_ScalerRec  scaler;
 
 
     if ( !size )
-      return AF_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Size_Handle );
 
     FT_ZERO( &scaler );
 
     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;
-      FT_UInt           options = 0;
+      AF_StyleMetrics  metrics;
+      FT_UInt          options = AF_STYLE_NONE_DFLT;
 
 
 #ifdef FT_OPTION_AUTOFIT2
-      /* XXX: undocumented hook to activate the latin2 hinter */
+      /* XXX: undocumented hook to activate the latin2 writing system */
       if ( load_flags & ( 1UL << 20 ) )
-        options = 2;
+        options = AF_STYLE_LTN2_DFLT;
 #endif
 
       error = af_face_globals_get_metrics( loader->globals, gindex,
                                            options, &metrics );
       if ( !error )
       {
+#ifdef FT_CONFIG_OPTION_PIC
+        AF_FaceGlobals         globals = loader->globals;
+#endif
+        AF_StyleClass          style_class = metrics->style_class;
+        AF_WritingSystemClass  writing_system_class =
+          AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];
+
+
         loader->metrics = metrics;
 
-        if ( metrics->clazz->script_metrics_scale )
-          metrics->clazz->script_metrics_scale( metrics, &scaler );
+        if ( writing_system_class->style_metrics_scale )
+          writing_system_class->style_metrics_scale( metrics, &scaler );
         else
           metrics->scaler = scaler;
 
         load_flags |=  FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;
         load_flags &= ~FT_LOAD_RENDER;
 
-        if ( metrics->clazz->script_hints_init )
+        if ( writing_system_class->style_hints_init )
         {
-          error = metrics->clazz->script_hints_init( &loader->hints,
-                                                     metrics );
+          error = writing_system_class->style_hints_init( &loader->hints,
+                                                          metrics );
           if ( error )
             goto Exit;
         }
index eec0e92..9601e24 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter glyph loading routines (specification).                  */
 /*                                                                         */
-/*  Copyright 2003-2005, 2011-2012 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,       */
 
 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;
+    AF_StyleMetrics   metrics;
     FT_Bool           transformed;
     FT_Matrix         trans_matrix;
     FT_Vector         trans_delta;
@@ -43,21 +56,20 @@ FT_BEGIN_HEADER
 
 
   FT_LOCAL( FT_Error )
-  af_loader_init( AF_Loader  loader,
-                  FT_Memory  memory );
+  af_loader_init( AF_Module  module );
 
 
   FT_LOCAL( FT_Error )
-  af_loader_reset( AF_Loader  loader,
+  af_loader_reset( AF_Module  module,
                    FT_Face    face );
 
 
   FT_LOCAL( void )
-  af_loader_done( AF_Loader  loader );
+  af_loader_done( AF_Module  module );
 
 
   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_Int32   load_flags );
index 20b6218..641e03e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter module implementation (body).                            */
 /*                                                                         */
-/*  Copyright 2003-2006, 2009, 2011 by                                     */
+/*  Copyright 2003-2006, 2009, 2011-2014 by                                */
 /*  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 "aferrors.h"
 #include "afpic.h"
 
 #ifdef FT_DEBUG_AUTOFIT
 #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
+
+
+  static 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_Face_Handle );
+
+    globals = (AF_FaceGlobals)face->autohint.data;
+    if ( !globals )
+    {
+      /* trigger computation of the global style 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;
+  }
+
+
+  static 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;
+
+      FT_UInt  ss;
+
+
+      /* We translate the fallback script to a fallback style that uses */
+      /* `fallback-script' as its script and `AF_COVERAGE_NONE' as its  */
+      /* coverage value.                                                */
+      for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )
+      {
+        AF_StyleClass  style_class = AF_STYLE_CLASSES_GET[ss];
+
+
+        if ( (FT_UInt)style_class->script == *fallback_script &&
+             style_class->coverage == AF_COVERAGE_DEFAULT     )
+        {
+          module->fallback_style = ss;
+          break;
+        }
+      }
+
+      if ( !AF_STYLE_CLASSES_GET[ss] )
+      {
+        FT_TRACE0(( "af_property_set: Invalid value %d for property `%s'\n",
+                    fallback_script, property_name ));
+        return FT_THROW( Invalid_Argument );
+      }
+
+      return error;
+    }
+    else if ( !ft_strcmp( property_name, "default-script" ) )
+    {
+      FT_UInt*  default_script = (FT_UInt*)value;
+
+
+      module->default_script = *default_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 );
+  }
+
+
+  static FT_Error
+  af_property_get( FT_Module    ft_module,
+                   const char*  property_name,
+                   void*        value )
+  {
+    FT_Error   error          = FT_Err_Ok;
+    AF_Module  module         = (AF_Module)ft_module;
+    FT_UInt    fallback_style = module->fallback_style;
+    FT_UInt    default_script = module->default_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_styles;
+
+      return error;
+    }
+    else if ( !ft_strcmp( property_name, "fallback-script" ) )
+    {
+      FT_UInt*  val = (FT_UInt*)value;
+
+      AF_StyleClass  style_class = AF_STYLE_CLASSES_GET[fallback_style];
+
+
+      *val = style_class->script;
+
+      return error;
+    }
+    else if ( !ft_strcmp( property_name, "default-script" ) )
+    {
+      FT_UInt*  val = (FT_UInt*)value;
+
+
+      *val = default_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 )
   {
-    FT_ModuleRec  root;
-    AF_LoaderRec  loader[1];
+    /* AF_SERVICES_GET dereferences `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
 
-  } FT_AutofitterRec, *FT_Autofitter;
+    return ft_service_list_lookup( AF_SERVICES_GET, module_interface );
+  }
 
 
   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_style = AF_STYLE_FALLBACK;
+    module->default_script = AF_SCRIPT_DEFAULT;
+
+    return af_loader_init( module );
   }
 
 
   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 )
-  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 );
 
-    return af_loader_load_glyph( module->loader, slot->face,
+    return af_loader_load_glyph( module, slot->face,
                                  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_MODULE_HINTER,
-    sizeof ( FT_AutofitterRec ),
+    sizeof ( AF_ModuleRec ),
 
     "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_Requester)  NULL )
+    (FT_Module_Requester)  af_get_interface )
 
 
 /* END */
index d979239..20b7b9f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter module implementation (specification).                   */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005 by                                          */
+/*  Copyright 2003-2005, 2009, 2012, 2013 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include FT_INTERNAL_OBJECTS_H
 #include FT_MODULE_H
 
+#include "afloader.h"
+
 
 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_style;
+    FT_UInt       default_script;
+
+    AF_LoaderRec  loader[1];
+
+  } AF_ModuleRec;
+
+
 FT_DECLARE_MODULE(autofit_module_class)
 
 
index 87074af..cb29fd7 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for autofit module.  */
 /*                                                                         */
-/*  Copyright 2009, 2010, 2011 by                                          */
+/*  Copyright 2009-2014 by                                                 */
 /*  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 "afglobal.h"
 #include "aferrors.h"
 
+
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from afmodule.c */
-  void FT_Init_Class_af_autofitter_service(
-    FT_Library                 library,
-    FT_AutoHinter_ServiceRec*  clazz );
-
-  /* forward declaration of PIC init functions from script classes */
-#include "aflatin.h"
-#ifdef FT_OPTION_AUTOFIT2
-#include "aflatin2.h"
-#endif
-#include "afcjk.h"
-#include "afdummy.h"
-#include "afindic.h"
+  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 writing system classes */
+#undef  WRITING_SYSTEM
+#define WRITING_SYSTEM( ws, WS )  /* empty */
+
+#include "afwrtsys.h"
+
 
   void
   autofit_module_class_pic_free( FT_Library  library )
 
     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;
     }
   }
@@ -58,8 +78,8 @@
   {
     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;
 
 
 
     /* initialize pointer table -                       */
     /* this is how the module usually expects this data */
-    for ( ss = 0 ; ss < AF_SCRIPT_CLASSES_REC_COUNT ; ss++ )
-    {
+    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_WRITING_SYSTEM_MAX; ss++ )
+      container->af_writing_system_classes[ss] =
+        &container->af_writing_system_classes_rec[ss];
+    container->af_writing_system_classes[AF_WRITING_SYSTEM_MAX] = NULL;
+
+    for ( ss = 0; ss < AF_SCRIPT_MAX; 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_MAX] = NULL;
+
+    for ( ss = 0; ss < AF_STYLE_MAX; ss++ )
+      container->af_style_classes[ss] =
+        &container->af_style_classes_rec[ss];
+    container->af_style_classes[AF_STYLE_MAX] = NULL;
+
+#undef  WRITING_SYSTEM
+#define WRITING_SYSTEM( ws, WS )                             \
+        FT_Init_Class_af_ ## ws ## _writing_system_class(    \
+          &container->af_writing_system_classes_rec[ss++] );
 
-    /* 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++] );
-#ifdef FT_OPTION_AUTOFIT2
-    FT_Init_Class_af_latin2_script_class(
-      &container->af_script_classes_rec[ss++] );
-#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: */
+#include "afwrtsys.h"
+
+#undef  SCRIPT
+#define SCRIPT( s, S, d, h, sc1, sc2, sc3 )          \
+        FT_Init_Class_af_ ## s ## _script_class(     \
+          &container->af_script_classes_rec[ss++] );
 
+    ss = 0;
+#include "afscript.h"
+
+#undef  STYLE
+#define STYLE( s, S, d, ws, sc, bss, c )            \
+        FT_Init_Class_af_ ## s ## _style_class(     \
+          &container->af_style_classes_rec[ss++] );
+
+    ss = 0;
+#include "afstyles.h"
+
+    FT_Init_Class_af_autofitter_interface(
+      library, &container->af_autofitter_interface );
+
+  Exit:
     if ( error )
       autofit_module_class_pic_free( library );
     return error;
   }
 
-
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
index 21b0ff9..9a68b4a 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for autofit module.  */
 /*                                                                         */
-/*  Copyright 2009, 2011 by                                                */
+/*  Copyright 2009, 2011-2013 by                                           */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -24,38 +24,67 @@ FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
+
 #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_WRITING_SYSTEM_CLASSES_GET  af_writing_system_classes
+#define AF_SCRIPT_CLASSES_GET          af_script_classes
+#define AF_STYLE_CLASSES_GET           af_style_classes
+#define AF_INTERFACE_GET               af_autofitter_interface
 
 #else /* FT_CONFIG_OPTION_PIC */
 
+  /* some include files required for members of AFModulePIC */
+#include FT_SERVICE_PROPERTIES_H
+
 #include "aftypes.h"
 
-  /* increase these when you add new scripts, */
-  /* and update autofit_module_class_pic_init */
-#ifdef FT_OPTION_AUTOFIT2
-#define AF_SCRIPT_CLASSES_COUNT     6
-#else
-#define AF_SCRIPT_CLASSES_COUNT     5
-#endif
-#define AF_SCRIPT_CLASSES_REC_COUNT  ( AF_SCRIPT_CLASSES_COUNT - 1 )
 
-  typedef struct AFModulePIC_
+  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_WritingSystemClass       af_writing_system_classes
+                                  [AF_WRITING_SYSTEM_MAX + 1];
+    AF_WritingSystemClassRec    af_writing_system_classes_rec
+                                  [AF_WRITING_SYSTEM_MAX];
+
+    AF_ScriptClass              af_script_classes
+                                  [AF_SCRIPT_MAX + 1];
+    AF_ScriptClassRec           af_script_classes_rec
+                                  [AF_SCRIPT_MAX];
+
+    AF_StyleClass               af_style_classes
+                                  [AF_STYLE_MAX + 1];
+    AF_StyleClassRec            af_style_classes_rec
+                                  [AF_STYLE_MAX];
+
+    FT_AutoHinter_InterfaceRec  af_autofitter_interface;
 
   } AFModulePIC;
 
-#define GET_PIC( lib )                                                     \
+
+#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 AF_SERVICES_GET  \
+          ( GET_PIC( library )->af_services )
+#define AF_SERVICE_PROPERTIES_GET  \
+          ( GET_PIC( library )->af_service_properties )
+
+#define AF_WRITING_SYSTEM_CLASSES_GET  \
+          ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_writing_system_classes )
+#define AF_SCRIPT_CLASSES_GET  \
+          ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_script_classes )
+#define AF_STYLE_CLASSES_GET  \
+          ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_style_classes )
+#define AF_INTERFACE_GET  \
+          ( GET_PIC( library )->af_autofitter_interface )
+
 
   /* see afpic.c for the implementation */
   void
diff --git a/src/autofit/afranges.c b/src/autofit/afranges.c
new file mode 100644 (file)
index 0000000..b2c504d
--- /dev/null
@@ -0,0 +1,220 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afranges.c                                                             */
+/*                                                                         */
+/*    Auto-fitter Unicode script ranges (body).                            */
+/*                                                                         */
+/*  Copyright 2013, 2014 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 "afranges.h"
+
+
+  const AF_Script_UniRangeRec  af_cyrl_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0400UL,  0x04FFUL ),  /* Cyrillic            */
+    AF_UNIRANGE_REC(  0x0500UL,  0x052FUL ),  /* Cyrillic Supplement */
+    AF_UNIRANGE_REC(  0x2DE0UL,  0x2DFFUL ),  /* Cyrillic Extended-A */
+    AF_UNIRANGE_REC(  0xA640UL,  0xA69FUL ),  /* Cyrillic Extended-B */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  /* there are some characters in the Devanagari Unicode block that are    */
+  /* generic to Indic scripts; we omit them so that their presence doesn't */
+  /* trigger Devanagari                                                    */
+
+  const AF_Script_UniRangeRec  af_deva_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0900UL,  0x093BUL ),  /* Devanagari       */
+    /* omitting U+093C nukta */
+    AF_UNIRANGE_REC(  0x093DUL,  0x0950UL ),
+    /* omitting U+0951 udatta, U+0952 anudatta */
+    AF_UNIRANGE_REC(  0x0953UL,  0x0963UL ),
+    /* omitting U+0964 danda, U+0965 double danda */
+    AF_UNIRANGE_REC(  0x0966UL,  0x097FUL ),
+    AF_UNIRANGE_REC(  0x20B9UL,  0x20B9UL ),  /* (new) Rupee sign */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_grek_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0370UL,  0x03FFUL ),  /* Greek and Coptic */
+    AF_UNIRANGE_REC(  0x1F00UL,  0x1FFFUL ),  /* Greek Extended   */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_hebr_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0590UL,  0x05FFUL ),  /* Hebrew                          */
+    AF_UNIRANGE_REC(  0xFB1DUL,  0xFB4FUL ),  /* Alphab. Present. Forms (Hebrew) */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_latn_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0020UL,  0x007FUL ),  /* Basic Latin (no control chars)         */
+    AF_UNIRANGE_REC(  0x00A0UL,  0x00FFUL ),  /* Latin-1 Supplement (no control chars)  */
+    AF_UNIRANGE_REC(  0x0100UL,  0x017FUL ),  /* Latin Extended-A                       */
+    AF_UNIRANGE_REC(  0x0180UL,  0x024FUL ),  /* Latin Extended-B                       */
+    AF_UNIRANGE_REC(  0x0250UL,  0x02AFUL ),  /* IPA Extensions                         */
+    AF_UNIRANGE_REC(  0x02B0UL,  0x02FFUL ),  /* Spacing Modifier Letters               */
+    AF_UNIRANGE_REC(  0x0300UL,  0x036FUL ),  /* Combining Diacritical Marks            */
+    AF_UNIRANGE_REC(  0x1D00UL,  0x1D7FUL ),  /* Phonetic Extensions                    */
+    AF_UNIRANGE_REC(  0x1D80UL,  0x1DBFUL ),  /* Phonetic Extensions Supplement         */
+    AF_UNIRANGE_REC(  0x1DC0UL,  0x1DFFUL ),  /* Combining Diacritical Marks Supplement */
+    AF_UNIRANGE_REC(  0x1E00UL,  0x1EFFUL ),  /* Latin Extended Additional              */
+    AF_UNIRANGE_REC(  0x2000UL,  0x206FUL ),  /* General Punctuation                    */
+    AF_UNIRANGE_REC(  0x2070UL,  0x209FUL ),  /* Superscripts and Subscripts            */
+    AF_UNIRANGE_REC(  0x20A0UL,  0x20B8UL ),  /* Currency Symbols ...                   */
+    AF_UNIRANGE_REC(  0x20BAUL,  0x20CFUL ),  /* ... except new Rupee sign              */
+    AF_UNIRANGE_REC(  0x2150UL,  0x218FUL ),  /* Number Forms                           */
+    AF_UNIRANGE_REC(  0x2460UL,  0x24FFUL ),  /* Enclosed Alphanumerics                 */
+    AF_UNIRANGE_REC(  0x2C60UL,  0x2C7FUL ),  /* Latin Extended-C                       */
+    AF_UNIRANGE_REC(  0x2E00UL,  0x2E7FUL ),  /* Supplemental Punctuation               */
+    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 )
+  };
+
+  const AF_Script_UniRangeRec  af_none_uniranges[] =
+  {
+    AF_UNIRANGE_REC( 0UL, 0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_telu_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0C00UL,  0x0C7FUL ),  /* Telugu */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+#ifdef AF_CONFIG_OPTION_INDIC
+
+  const AF_Script_UniRangeRec  af_beng_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0980UL,  0x09FFUL ),  /* Bengali */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_gujr_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0A80UL,  0x0AFFUL ),  /* Gujarati */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_guru_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0A00UL,  0x0A7FUL ),  /* Gurmukhi */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_knda_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0C80UL,  0x0CFFUL ),  /* Kannada */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_limb_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x1900UL,  0x194FUL ),  /* Limbu */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_mlym_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0D00UL,  0x0D7FUL ),  /* Malayalam */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_orya_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0B00UL,  0x0B7FUL ),  /* Oriya */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_sinh_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0D80UL,  0x0DFFUL ),  /* Sinhala */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_sund_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x1B80UL,  0x1BBFUL ),  /* Sundanese */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_sylo_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0xA800UL,  0xA82FUL ),  /* Syloti Nagri */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_taml_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0B80UL,  0x0BFFUL ),  /* Tamil */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+  const AF_Script_UniRangeRec  af_tibt_uniranges[] =
+  {
+    AF_UNIRANGE_REC(  0x0F00UL,  0x0FFFUL ),  /* Tibetan */
+    AF_UNIRANGE_REC(       0UL,       0UL )
+  };
+
+#endif /* !AF_CONFIG_OPTION_INDIC */
+
+#ifdef AF_CONFIG_OPTION_CJK
+
+  /* this corresponds to Unicode 6.0 */
+
+  const AF_Script_UniRangeRec  af_hani_uniranges[] =
+  {
+    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(  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(  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(  0x3200UL,  0x32FFUL ),  /* Enclosed CJK Letters and Months         */
+    AF_UNIRANGE_REC(  0x3300UL,  0x33FFUL ),  /* CJK Compatibility                       */
+    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(  0xFE10UL,  0xFE1FUL ),  /* Vertical 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( 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 )
+  };
+
+#endif /* !AF_CONFIG_OPTION_CJK */
+
+/* END */
diff --git a/src/autofit/afranges.h b/src/autofit/afranges.h
new file mode 100644 (file)
index 0000000..fe5b2aa
--- /dev/null
@@ -0,0 +1,41 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afranges.h                                                             */
+/*                                                                         */
+/*    Auto-fitter Unicode script ranges (specification).                   */
+/*                                                                         */
+/*  Copyright 2013, 2014 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 __AFRANGES_H__
+#define __AFRANGES_H__
+
+
+#include "aftypes.h"
+
+
+FT_BEGIN_HEADER
+
+#undef  SCRIPT
+#define SCRIPT( s, S, d, h, sc1, sc2, sc3 )                             \
+          extern const AF_Script_UniRangeRec  af_ ## s ## _uniranges[];
+
+#include "afscript.h"
+
+ /* */
+
+FT_END_HEADER
+
+#endif /* __AFRANGES_H__ */
+
+
+/* END */
diff --git a/src/autofit/afscript.h b/src/autofit/afscript.h
new file mode 100644 (file)
index 0000000..efe8754
--- /dev/null
@@ -0,0 +1,139 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afscript.h                                                             */
+/*                                                                         */
+/*    Auto-fitter scripts (specification only).                            */
+/*                                                                         */
+/*  Copyright 2013, 2014 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 following part can be included multiple times. */
+  /* Define `SCRIPT' as needed.                         */
+
+
+  /* Add new scripts here.  The first and second arguments are the    */
+  /* script name in lowercase and uppercase, respectively, followed   */
+  /* by a description string.  Then comes the corresponding HarfBuzz  */
+  /* script name tag, followed by a string of standard characters (to */
+  /* derive the standard width and height of stems).                  */
+
+  SCRIPT( cyrl, CYRL,
+          "Cyrillic",
+          HB_SCRIPT_CYRILLIC,
+          0x43E, 0x41E, 0x0 ) /* оО */
+
+  SCRIPT( deva, DEVA,
+          "Devanagari",
+          HB_SCRIPT_DEVANAGARI,
+          0x920, 0x935, 0x91F ) /* ठ व ट */
+
+  SCRIPT( grek, GREK,
+          "Greek",
+          HB_SCRIPT_GREEK,
+          0x3BF, 0x39F, 0x0 ) /* οΟ */
+
+  SCRIPT( hebr, HEBR,
+          "Hebrew",
+          HB_SCRIPT_HEBREW,
+          0x5DD, 0x0, 0x0 ) /* ם */
+
+  SCRIPT( latn, LATN,
+          "Latin",
+          HB_SCRIPT_LATIN,
+          'o', 'O', '0' )
+
+  SCRIPT( none, NONE,
+          "no script",
+          HB_SCRIPT_INVALID,
+          0x0, 0x0, 0x0 )
+
+  /* there are no simple forms for letters; we thus use two digit shapes */
+  SCRIPT( telu, TELU,
+          "Telugu",
+          HB_SCRIPT_TELUGU,
+          0xC66, 0xC67, 0x0 ) /* ౦ ౧ */
+
+#ifdef AF_CONFIG_OPTION_INDIC
+
+  SCRIPT( beng, BENG,
+          "Bengali",
+          HB_SCRIPT_BENGALI,
+          'o', 0x0, 0x0 ) /* XXX */
+
+  SCRIPT( gujr, GUJR,
+          "Gujarati",
+          HB_SCRIPT_GUJARATI,
+          'o', 0x0, 0x0 ) /* XXX */
+
+  SCRIPT( guru, GURU,
+          "Gurmukhi",
+          HB_SCRIPT_GURMUKHI,
+          'o', 0x0, 0x0 ) /* XXX */
+
+  SCRIPT( knda, KNDA,
+          "Kannada",
+          HB_SCRIPT_KANNADA,
+          'o', 0x0, 0x0 ) /* XXX */
+
+  SCRIPT( limb, LIMB,
+          "Limbu",
+          HB_SCRIPT_LIMBU,
+          'o', 0x0, 0x0 ) /* XXX */
+
+  SCRIPT( mlym, MLYM,
+          "Malayalam",
+          HB_SCRIPT_MALAYALAM,
+          'o', 0x0, 0x0 ) /* XXX */
+
+  SCRIPT( orya, ORYA,
+          "Oriya",
+          HB_SCRIPT_ORIYA,
+          'o', 0x0, 0x0 ) /* XXX */
+
+  SCRIPT( sinh, SINH,
+          "Sinhala",
+          HB_SCRIPT_SINHALA,
+          'o', 0x0, 0x0 ) /* XXX */
+
+  SCRIPT( sund, SUND,
+          "Sundanese",
+          HB_SCRIPT_SUNDANESE,
+          'o', 0x0, 0x0 ) /* XXX */
+
+  SCRIPT( sylo, SYLO,
+          "Syloti Nagri",
+          HB_SCRIPT_SYLOTI_NAGRI,
+          'o', 0x0, 0x0 ) /* XXX */
+
+  SCRIPT( taml, TAML,
+          "Tamil",
+          HB_SCRIPT_TAMIL,
+          'o', 0x0, 0x0 ) /* XXX */
+
+  SCRIPT( tibt, TIBT,
+          "Tibetan",
+          HB_SCRIPT_TIBETAN,
+          'o', 0x0, 0x0 ) /* XXX */
+
+#endif /* AF_CONFIG_OPTION_INDIC */
+
+#ifdef AF_CONFIG_OPTION_CJK
+
+  SCRIPT( hani, HANI,
+          "CJKV ideographs",
+          HB_SCRIPT_HAN,
+          0x7530, 0x56D7, 0x0 ) /* 田囗 */
+
+#endif /* AF_CONFIG_OPTION_CJK */
+
+
+/* END */
diff --git a/src/autofit/afstyles.h b/src/autofit/afstyles.h
new file mode 100644 (file)
index 0000000..f14d354
--- /dev/null
@@ -0,0 +1,164 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afstyles.h                                                             */
+/*                                                                         */
+/*    Auto-fitter styles (specification only).                             */
+/*                                                                         */
+/*  Copyright 2013, 2014 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 following part can be included multiple times. */
+  /* Define `STYLE' as needed.                          */
+
+
+  /* Add new styles here.  The first and second arguments are the  */
+  /* style name in lowercase and uppercase, respectively, followed */
+  /* by a description string.  The next arguments are the          */
+  /* corresponding writing system, script, blue stringset, and     */
+  /* coverage.                                                     */
+  /*                                                               */
+  /* Note that styles using `AF_COVERAGE_DEFAULT' should always    */
+  /* come after styles with other coverages.                       */
+  /*                                                               */
+  /* Example:                                                      */
+  /*                                                               */
+  /*   STYLE( cyrl_dflt, CYRL_DFLT,                                */
+  /*          "Cyrillic default style",                            */
+  /*          AF_WRITING_SYSTEM_LATIN,                             */
+  /*          AF_SCRIPT_CYRL,                                      */
+  /*          AF_BLUE_STRINGSET_CYRL,                              */
+  /*          AF_COVERAGE_DEFAULT )                                */
+
+#undef  STYLE_LATIN
+#define STYLE_LATIN( s, S, f, F, ds, df, C ) \
+          STYLE( s ## _ ## f, S ## _ ## F,   \
+                 ds " " df " style",         \
+                 AF_WRITING_SYSTEM_LATIN,    \
+                 AF_SCRIPT_ ## S,            \
+                 AF_BLUE_STRINGSET_ ## S,    \
+                 AF_COVERAGE_ ## C )
+
+#undef  META_STYLE_LATIN
+#define META_STYLE_LATIN( s, S, ds )                     \
+          STYLE_LATIN( s, S, c2cp, C2CP, ds,             \
+                       "petite capticals from capitals", \
+                       PETITE_CAPITALS_FROM_CAPITALS )   \
+          STYLE_LATIN( s, S, c2sc, C2SC, ds,             \
+                       "small capticals from capitals",  \
+                       SMALL_CAPITALS_FROM_CAPITALS )    \
+          STYLE_LATIN( s, S, ordn, ORDN, ds,             \
+                       "ordinals",                       \
+                       ORDINALS )                        \
+          STYLE_LATIN( s, S, pcap, PCAP, ds,             \
+                       "petite capitals",                \
+                       PETITE_CAPITALS )                 \
+          STYLE_LATIN( s, S, sinf, SINF, ds,             \
+                       "scientific inferiors",           \
+                       SCIENTIFIC_INFERIORS )            \
+          STYLE_LATIN( s, S, smcp, SMCP, ds,             \
+                       "small capitals",                 \
+                       SMALL_CAPITALS )                  \
+          STYLE_LATIN( s, S, subs, SUBS, ds,             \
+                       "subscript",                      \
+                       SUBSCRIPT )                       \
+          STYLE_LATIN( s, S, sups, SUPS, ds,             \
+                       "superscript",                    \
+                       SUPERSCRIPT )                     \
+          STYLE_LATIN( s, S, titl, TITL, ds,             \
+                       "titling",                        \
+                       TITLING )                         \
+          STYLE_LATIN( s, S, dflt, DFLT, ds,             \
+                       "default",                        \
+                       DEFAULT )
+
+  META_STYLE_LATIN( cyrl, CYRL, "Cyrillic" )
+
+  META_STYLE_LATIN( grek, GREK, "Greek" )
+
+  STYLE( hebr_dflt, HEBR_DFLT,
+         "Hebrew default style",
+         AF_WRITING_SYSTEM_LATIN,
+         AF_SCRIPT_HEBR,
+         AF_BLUE_STRINGSET_HEBR,
+         AF_COVERAGE_DEFAULT )
+  META_STYLE_LATIN( latn, LATN, "Latin" )
+
+  STYLE( deva_dflt, DEVA_DFLT,
+         "Devanagari default style",
+         AF_WRITING_SYSTEM_LATIN,
+         AF_SCRIPT_DEVA,
+         AF_BLUE_STRINGSET_DEVA,
+         AF_COVERAGE_DEFAULT )
+
+#ifdef FT_OPTION_AUTOFIT2
+  STYLE( ltn2_dflt, LTN2_DFLT,
+         "Latin 2 default style",
+         AF_WRITING_SYSTEM_LATIN2,
+         AF_SCRIPT_LATN,
+         AF_BLUE_STRINGSET_LATN,
+         AF_COVERAGE_DEFAULT )
+#endif
+
+  STYLE( none_dflt, NONE_DFLT,
+         "no style",
+         AF_WRITING_SYSTEM_DUMMY,
+         AF_SCRIPT_NONE,
+         (AF_Blue_Stringset)0,
+         AF_COVERAGE_DEFAULT )
+
+  STYLE( telu_dflt, TELU_DFLT,
+         "Telugu default style",
+         AF_WRITING_SYSTEM_LATIN,
+         AF_SCRIPT_TELU,
+         AF_BLUE_STRINGSET_TELU,
+         AF_COVERAGE_DEFAULT )
+
+#ifdef AF_CONFIG_OPTION_INDIC
+
+  /* no blue stringset support for the Indic writing system yet */
+#undef  STYLE_DEFAULT_INDIC
+#define STYLE_DEFAULT_INDIC( s, S, d )    \
+          STYLE( s ## _dflt, S ## _DFLT,  \
+                 d " default style",      \
+                 AF_WRITING_SYSTEM_INDIC, \
+                 AF_SCRIPT_ ## S,         \
+                 (AF_Blue_Stringset)0,    \
+                 AF_COVERAGE_DEFAULT )
+
+  STYLE_DEFAULT_INDIC( beng, BENG, "Bengali" )
+  STYLE_DEFAULT_INDIC( gujr, GUJR, "Gujarati" )
+  STYLE_DEFAULT_INDIC( guru, GURU, "Gurmukhi" )
+  STYLE_DEFAULT_INDIC( knda, KNDA, "Kannada" )
+  STYLE_DEFAULT_INDIC( limb, LIMB, "Limbu" )
+  STYLE_DEFAULT_INDIC( mlym, MLYM, "Malayalam" )
+  STYLE_DEFAULT_INDIC( orya, ORYA, "Oriya" )
+  STYLE_DEFAULT_INDIC( sinh, SINH, "Sinhala" )
+  STYLE_DEFAULT_INDIC( sund, SUND, "Sundanese" )
+  STYLE_DEFAULT_INDIC( sylo, SYLO, "Syloti Nagri" )
+  STYLE_DEFAULT_INDIC( taml, TAML, "Tamil" )
+  STYLE_DEFAULT_INDIC( tibt, TIBT, "Tibetan" )
+
+#endif /* AF_CONFIG_OPTION_INDIC */
+
+#ifdef AF_CONFIG_OPTION_CJK
+
+  STYLE( hani_dflt, HANI_DFLT,
+         "CJKV ideographs default style",
+         AF_WRITING_SYSTEM_CJK,
+         AF_SCRIPT_HANI,
+         AF_BLUE_STRINGSET_HANI,
+         AF_COVERAGE_DEFAULT )
+
+#endif /* AF_CONFIG_OPTION_CJK */
+
+
+/* END */
index 21e442c..61badd1 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter types (specification only).                              */
 /*                                                                         */
-/*  Copyright 2003-2009, 2011 by                                           */
+/*  Copyright 2003-2009, 2011-2014 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
    *
    *  The auto-fitter is a complete rewrite of the old auto-hinter.
    *  Its main feature is the ability to differentiate between different
-   *  scripts in order to apply language-specific rules.
+   *  writing systems and scripts in order to apply specific rules.
    *
    *  The code has also been compartmentized into several entities that
    *  should make algorithmic experimentation easier than with the old
    *  code.
    *
-   *  Finally, we get rid of the Catharon license, since this code is
-   *  released under the FreeType one.
-   *
    *************************************************************************/
 
 
@@ -42,6 +39,8 @@
 #include FT_INTERNAL_OBJECTS_H
 #include FT_INTERNAL_DEBUG_H
 
+#include "afblue.h"
+
 
 FT_BEGIN_HEADER
 
@@ -87,8 +86,9 @@ extern void*  _af_debug_hints;
                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 );
 
 
   /*************************************************************************/
@@ -197,87 +197,124 @@ extern void*  _af_debug_hints;
             (a)->y_delta == (b)->y_delta )
 
 
+  typedef struct AF_StyleMetricsRec_*  AF_StyleMetrics;
+
+  /*  This function parses an FT_Face to compute global metrics for
+   *  a specific style.
+   */
+  typedef FT_Error
+  (*AF_WritingSystem_InitMetricsFunc)( AF_StyleMetrics  metrics,
+                                       FT_Face          face );
+
+  typedef void
+  (*AF_WritingSystem_ScaleMetricsFunc)( AF_StyleMetrics  metrics,
+                                        AF_Scaler        scaler );
+
+  typedef void
+  (*AF_WritingSystem_DoneMetricsFunc)( AF_StyleMetrics  metrics );
+
+
+  typedef FT_Error
+  (*AF_WritingSystem_InitHintsFunc)( AF_GlyphHints    hints,
+                                     AF_StyleMetrics  metrics );
+
+  typedef void
+  (*AF_WritingSystem_ApplyHintsFunc)( AF_GlyphHints    hints,
+                                      FT_Outline*      outline,
+                                      AF_StyleMetrics  metrics );
+
+
   /*************************************************************************/
   /*************************************************************************/
   /*****                                                               *****/
-  /*****                       S C R I P T S                           *****/
+  /*****                W R I T I N G   S Y S T E M S                  *****/
   /*****                                                               *****/
   /*************************************************************************/
   /*************************************************************************/
 
   /*
-   *  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
-   *     script.
+   *  For the auto-hinter, a writing system consists of multiple scripts that
+   *  can be handled similarly *in a typographical way*; the relationship is
+   *  not based on history.  For example, both the Greek and the unrelated
+   *  Armenian scripts share the same features like ascender, descender,
+   *  x-height, etc.  Essentially, a writing system is covered by a
+   *  submodule of the auto-fitter; it contains
    *
-   *   - A specific global analyzer that will compute global metrics
-   *     specific to the script.
+   *  - a specific global analyzer that computes global metrics specific to
+   *    the script (based on script-specific characters to identify ascender
+   *    height, x-height, etc.),
    *
-   *   - A specific glyph analyzer that will compute segments and
-   *     edges for each glyph covered by the script.
+   *  - a specific glyph analyzer that computes segments and edges for each
+   *    glyph covered by the script,
    *
-   *   - A specific grid-fitting algorithm that will distort the
-   *     scaled glyph outline according to the results of the glyph
-   *     analyzer.
-   *
-   *  Note that a given analyzer and/or grid-fitting algorithm can be
-   *  used by more than one script.
+   *  - a specific grid-fitting algorithm that distorts the scaled glyph
+   *    outline according to the results of the glyph analyzer.
    */
 
-  typedef enum  AF_Script_
+#define __AFWRTSYS_H__  /* don't load header files */
+#undef  WRITING_SYSTEM
+#define WRITING_SYSTEM( ws, WS )    \
+          AF_WRITING_SYSTEM_ ## WS,
+
+  /* The list of known writing systems. */
+  typedef enum  AF_WritingSystem_
   {
-    AF_SCRIPT_NONE  = 0,
-    AF_SCRIPT_LATIN = 1,
-    AF_SCRIPT_CJK   = 2,
-    AF_SCRIPT_INDIC = 3,
-#ifdef FT_OPTION_AUTOFIT2
-    AF_SCRIPT_LATIN2,
-#endif
 
-    /* add new scripts here.  Don't forget to update the list in */
-    /* `afglobal.c'.                                             */
+#include "afwrtsys.h"
 
-    AF_SCRIPT_MAX   /* do not remove */
+    AF_WRITING_SYSTEM_MAX   /* do not remove */
 
-  } AF_Script;
+  } AF_WritingSystem;
 
+#undef  __AFWRTSYS_H__
 
-  typedef struct AF_ScriptClassRec_ const*  AF_ScriptClass;
 
-  typedef struct  AF_ScriptMetricsRec_
+  typedef struct  AF_WritingSystemClassRec_
   {
-    AF_ScriptClass  clazz;
-    AF_ScalerRec    scaler;
-    FT_Bool         digits_have_same_width;
+    AF_WritingSystem  writing_system;
 
-  } AF_ScriptMetricsRec, *AF_ScriptMetrics;
+    FT_Offset                          style_metrics_size;
+    AF_WritingSystem_InitMetricsFunc   style_metrics_init;
+    AF_WritingSystem_ScaleMetricsFunc  style_metrics_scale;
+    AF_WritingSystem_DoneMetricsFunc   style_metrics_done;
 
+    AF_WritingSystem_InitHintsFunc     style_hints_init;
+    AF_WritingSystem_ApplyHintsFunc    style_hints_apply;
 
-  /*  This function parses an FT_Face to compute global metrics for
-   *  a specific script.
+  } AF_WritingSystemClassRec;
+
+  typedef const AF_WritingSystemClassRec*  AF_WritingSystemClass;
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****                        S C R I P T S                          *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+  /*
+   *  Each script is associated with a set of Unicode ranges that gets used
+   *  to test whether the font face supports the script.
+   *
+   *  We use four-letter script tags from the OpenType specification,
+   *  extended by `NONE', which indicates `no script'.
    */
-  typedef FT_Error
-  (*AF_Script_InitMetricsFunc)( AF_ScriptMetrics  metrics,
-                                FT_Face           face );
 
-  typedef void
-  (*AF_Script_ScaleMetricsFunc)( AF_ScriptMetrics  metrics,
-                                 AF_Scaler         scaler );
+#undef  SCRIPT
+#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \
+          AF_SCRIPT_ ## S,
 
-  typedef void
-  (*AF_Script_DoneMetricsFunc)( AF_ScriptMetrics  metrics );
+  /* The list of known scripts. */
+  typedef enum  AF_Script_
+  {
 
+#include "afscript.h"
 
-  typedef FT_Error
-  (*AF_Script_InitHintsFunc)( AF_GlyphHints     hints,
-                              AF_ScriptMetrics  metrics );
+    AF_SCRIPT_MAX   /* do not remove */
 
-  typedef void
-  (*AF_Script_ApplyHintsFunc)( AF_GlyphHints     hints,
-                               FT_Outline*       outline,
-                               AF_ScriptMetrics  metrics );
+  } AF_Script;
 
 
   typedef struct  AF_Script_UniRangeRec_
@@ -289,72 +326,300 @@ extern void*  _af_debug_hints;
 
 #define AF_UNIRANGE_REC( a, b ) { (FT_UInt32)(a), (FT_UInt32)(b) }
 
-  typedef const AF_Script_UniRangeRec  *AF_Script_UniRange;
+  typedef const AF_Script_UniRangeRec*  AF_Script_UniRange;
 
 
   typedef struct  AF_ScriptClassRec_
   {
-    AF_Script                   script;
-    AF_Script_UniRange          script_uni_ranges; /* last must be { 0, 0 } */
+    AF_Script  script;
 
-    FT_Offset                   script_metrics_size;
-    AF_Script_InitMetricsFunc   script_metrics_init;
-    AF_Script_ScaleMetricsFunc  script_metrics_scale;
-    AF_Script_DoneMetricsFunc   script_metrics_done;
+    AF_Script_UniRange  script_uni_ranges; /* last must be { 0, 0 }        */
 
-    AF_Script_InitHintsFunc     script_hints_init;
-    AF_Script_ApplyHintsFunc    script_hints_apply;
+    FT_UInt32  standard_char1;             /* for default width and height */
+    FT_UInt32  standard_char2;             /* ditto                        */
+    FT_UInt32  standard_char3;             /* ditto                        */
 
   } AF_ScriptClassRec;
 
+  typedef const AF_ScriptClassRec*  AF_ScriptClass;
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****                      C O V E R A G E S                        *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+  /*
+   *  Usually, a font contains more glyphs than can be addressed by its
+   *  character map.
+   *
+   *  In the PostScript font world, encoding vectors specific to a given
+   *  task are used to select such glyphs, and these glyphs can be often
+   *  recognized by having a suffix in its glyph names.  For example, a
+   *  superscript glyph `A' might be called `A.sup'.  Unfortunately, this
+   *  naming scheme is not standardized and thus unusable for us.
+   *
+   *  In the OpenType world, a better solution was invented, namely
+   *  `features', which cleanly separate a character's input encoding from
+   *  the corresponding glyph's appearance, and which don't use glyph names
+   *  at all.  For our purposes, and slightly generalized, an OpenType
+   *  feature is a name of a mapping that maps character codes to
+   *  non-standard glyph indices (features get used for other things also).
+   *  For example, the `sups' feature provides superscript glyphs, thus
+   *  mapping character codes like `A' or `B' to superscript glyph
+   *  representation forms.  How this mapping happens is completely
+   *  uninteresting to us.
+   *
+   *  For the auto-hinter, a `coverage' represents all glyphs of an OpenType
+   *  feature collected in a set (as listed below) that can be hinted
+   *  together.  To continue the above example, superscript glyphs must not
+   *  be hinted together with normal glyphs because the blue zones
+   *  completely differ.
+   *
+   *  Note that FreeType itself doesn't compute coverages; it only provides
+   *  the glyphs addressable by the default Unicode character map.  Instead,
+   *  we use the HarfBuzz library (if available), which has many functions
+   *  exactly for this purpose.
+   *
+   *  AF_COVERAGE_DEFAULT is special: It should cover everything that isn't
+   *  listed separately (including the glyphs addressable by the character
+   *  map).  In case HarfBuzz isn't available, it exactly covers the glyphs
+   *  addressable by the character map.
+   *
+   */
+
+#undef  COVERAGE
+#define COVERAGE( name, NAME, description, \
+                  tag1, tag2, tag3, tag4 ) \
+          AF_COVERAGE_ ## NAME,
+
+
+  typedef enum  AF_Coverage_
+  {
+#include "afcover.h"
+
+    AF_COVERAGE_DEFAULT
+
+  } AF_Coverage;
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****                         S T Y L E S                           *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+  /*
+   *  The topmost structure for modelling the auto-hinter glyph input data
+   *  is a `style class', grouping everything together.
+   */
+
+#undef  STYLE
+#define STYLE( s, S, d, ws, sc, ss, c ) \
+          AF_STYLE_ ## S,
+
+  /* The list of known styles. */
+  typedef enum  AF_Style_
+  {
+
+#include "afstyles.h"
+
+    AF_STYLE_MAX   /* do not remove */
+
+  } AF_Style;
+
+
+  typedef struct  AF_StyleClassRec_
+  {
+    AF_Style  style;
+
+    AF_WritingSystem   writing_system;
+    AF_Script          script;
+    AF_Blue_Stringset  blue_stringset;
+    AF_Coverage        coverage;
+
+  } AF_StyleClassRec;
+
+  typedef const AF_StyleClassRec*  AF_StyleClass;
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****                   S T Y L E   M E T R I C S                   *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+  typedef struct AF_FaceGlobalsRec_*  AF_FaceGlobals;
+
+  /* This is the main structure that combines everything.  Autofit modules */
+  /* specific to writing systems derive their structures from it, for      */
+  /* example `AF_LatinMetrics'.                                            */
+
+  typedef struct  AF_StyleMetricsRec_
+  {
+    AF_StyleClass   style_class;
+    AF_ScalerRec    scaler;
+    FT_Bool         digits_have_same_width;
+
+    AF_FaceGlobals  globals;    /* to access properties */
+
+  } AF_StyleMetricsRec;
+
 
   /* Declare and define vtables for classes */
 #ifndef FT_CONFIG_OPTION_PIC
 
+#define AF_DECLARE_WRITING_SYSTEM_CLASS( writing_system_class ) \
+  FT_CALLBACK_TABLE const AF_WritingSystemClassRec              \
+  writing_system_class;
+
+#define AF_DEFINE_WRITING_SYSTEM_CLASS(                  \
+          writing_system_class,                          \
+          system,                                        \
+          m_size,                                        \
+          m_init,                                        \
+          m_scale,                                       \
+          m_done,                                        \
+          h_init,                                        \
+          h_apply )                                      \
+  FT_CALLBACK_TABLE_DEF                                  \
+  const AF_WritingSystemClassRec  writing_system_class = \
+  {                                                      \
+    system,                                              \
+                                                         \
+    m_size,                                              \
+                                                         \
+    m_init,                                              \
+    m_scale,                                             \
+    m_done,                                              \
+                                                         \
+    h_init,                                              \
+    h_apply                                              \
+  };
+
+
 #define AF_DECLARE_SCRIPT_CLASS( script_class ) \
   FT_CALLBACK_TABLE const AF_ScriptClassRec     \
   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,                         \
+          std_char1,                      \
+          std_char2,                      \
+          std_char3 )                     \
+  FT_CALLBACK_TABLE_DEF                   \
+  const AF_ScriptClassRec  script_class = \
+  {                                       \
+    script,                               \
+    ranges,                               \
+    std_char1,                            \
+    std_char2,                            \
+    std_char3                             \
+  };
+
+
+#define AF_DECLARE_STYLE_CLASS( style_class ) \
+  FT_CALLBACK_TABLE const AF_StyleClassRec    \
+  style_class;
+
+#define AF_DEFINE_STYLE_CLASS(          \
+          style_class,                  \
+          style,                        \
+          writing_system,               \
+          script,                       \
+          blue_stringset,               \
+          coverage )                    \
+  FT_CALLBACK_TABLE_DEF                 \
+  const AF_StyleClassRec  style_class = \
+  {                                     \
+    style,                              \
+    writing_system,                     \
+    script,                             \
+    blue_stringset,                     \
+    coverage                            \
   };
 
 #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, 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;                                    \
+#define AF_DECLARE_WRITING_SYSTEM_CLASS( writing_system_class )            \
+  FT_LOCAL( void )                                                         \
+  FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec*  ac );
+
+#define AF_DEFINE_WRITING_SYSTEM_CLASS(                                   \
+          writing_system_class,                                           \
+          system,                                                         \
+          m_size,                                                         \
+          m_init,                                                         \
+          m_scale,                                                        \
+          m_done,                                                         \
+          h_init,                                                         \
+          h_apply )                                                       \
+  FT_LOCAL_DEF( void )                                                    \
+  FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec*  ac ) \
+  {                                                                       \
+    ac->writing_system      = system;                                     \
+                                                                          \
+    ac->style_metrics_size  = m_size;                                     \
+                                                                          \
+    ac->style_metrics_init  = m_init;                                     \
+    ac->style_metrics_scale = m_scale;                                    \
+    ac->style_metrics_done  = m_done;                                     \
+                                                                          \
+    ac->style_hints_init    = h_init;                                     \
+    ac->style_hints_apply   = h_apply;                                    \
+  }
+
+
+#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,                                          \
+          std_char1,                                       \
+          std_char2,                                       \
+          std_char3 )                                      \
+  FT_LOCAL_DEF( void )                                     \
+  FT_Init_Class_ ## script_class( AF_ScriptClassRec*  ac ) \
+  {                                                        \
+    ac->script            = script_;                       \
+    ac->script_uni_ranges = ranges;                        \
+    ac->standard_char1    = std_char1;                     \
+    ac->standard_char2    = std_char2;                     \
+    ac->standard_char3    = std_char3;                     \
+  }
+
+
+#define AF_DECLARE_STYLE_CLASS( style_class )             \
+  FT_LOCAL( void )                                        \
+  FT_Init_Class_ ## style_class( AF_StyleClassRec*  ac );
+
+#define AF_DEFINE_STYLE_CLASS(                           \
+          style_class,                                   \
+          style_,                                        \
+          writing_system_,                               \
+          script_,                                       \
+          blue_stringset_,                               \
+          coverage_ )                                    \
+  FT_LOCAL_DEF( void )                                   \
+  FT_Init_Class_ ## style_class( AF_StyleClassRec*  ac ) \
+  {                                                      \
+    ac->style          = style_;                         \
+    ac->writing_system = writing_system_;                \
+    ac->script         = script_;                        \
+    ac->blue_stringset = blue_stringset_;                \
+    ac->coverage       = coverage_;                      \
   }
 
 #endif /* FT_CONFIG_OPTION_PIC */
diff --git a/src/autofit/afwrtsys.h b/src/autofit/afwrtsys.h
new file mode 100644 (file)
index 0000000..8aa2ed9
--- /dev/null
@@ -0,0 +1,52 @@
+/***************************************************************************/
+/*                                                                         */
+/*  afwrtsys.h                                                             */
+/*                                                                         */
+/*    Auto-fitter writing systems (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 __AFWRTSYS_H__
+#define __AFWRTSYS_H__
+
+  /* Since preprocessor directives can't create other preprocessor */
+  /* directives, we have to include the header files manually.     */
+
+#include "afdummy.h"
+#include "aflatin.h"
+#include "afcjk.h"
+#include "afindic.h"
+#ifdef FT_OPTION_AUTOFIT2
+#include "aflatin2.h"
+#endif
+
+#endif /* __AFWRTSYS_H__ */
+
+
+  /* The following part can be included multiple times. */
+  /* Define `WRITING_SYSTEM' as needed.                 */
+
+
+  /* Add new writing systems here.  The arguments are the writing system */
+  /* name in lowercase and uppercase, respectively.                      */
+
+  WRITING_SYSTEM( dummy,  DUMMY  )
+  WRITING_SYSTEM( latin,  LATIN  )
+  WRITING_SYSTEM( cjk,    CJK    )
+  WRITING_SYSTEM( indic,  INDIC  )
+#ifdef FT_OPTION_AUTOFIT2
+  WRITING_SYSTEM( latin2, LATIN2 )
+#endif
+
+
+/* END */
index 3883a0a..e2b9934 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter module (body).                                           */
 /*                                                                         */
-/*  Copyright 2003-2007, 2011 by                                           */
+/*  Copyright 2003-2007, 2011, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include <ft2build.h>
 #include "afpic.c"
 #include "afangles.c"
+#include "afblue.c"
 #include "afglobal.c"
 #include "afhints.c"
 
+#include "afranges.c"
+
 #include "afdummy.c"
 #include "aflatin.c"
 #ifdef FT_OPTION_AUTOFIT2
@@ -31,6 +34,8 @@
 #include "afcjk.c"
 #include "afindic.c"
 
+#include "hbshim.c"
+
 #include "afloader.c"
 #include "afmodule.c"
 
diff --git a/src/autofit/hbshim.c b/src/autofit/hbshim.c
new file mode 100644 (file)
index 0000000..a705cef
--- /dev/null
@@ -0,0 +1,545 @@
+/***************************************************************************/
+/*                                                                         */
+/*  hbshim.c                                                               */
+/*                                                                         */
+/*    HarfBuzz interface for accessing OpenType features (body).           */
+/*                                                                         */
+/*  Copyright 2013, 2014 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_FREETYPE_H
+#include "afglobal.h"
+#include "aftypes.h"
+#include "hbshim.h"
+
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* 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_afharfbuzz
+
+
+  /*
+   * We use `sets' (in the HarfBuzz sense, which comes quite near to the
+   * usual mathematical meaning) to manage both lookups and glyph indices.
+   *
+   * 1. For each coverage, collect lookup IDs in a set.  Note that an
+   *    auto-hinter `coverage' is represented by one `feature', and a
+   *    feature consists of an arbitrary number of (font specific) `lookup's
+   *    that actually do the mapping job.  Please check the OpenType
+   *    specification for more details on features and lookups.
+   *
+   * 2. Create glyph ID sets from the corresponding lookup sets.
+   *
+   * 3. The glyph set corresponding to AF_COVERAGE_DEFAULT is computed
+   *    with all lookups specific to the OpenType script activated.  It
+   *    relies on the order of AF_DEFINE_STYLE_CLASS entries so that
+   *    special coverages (like `oldstyle figures') don't get overwritten.
+   *
+   */
+
+
+  /* load coverage tags */
+#undef  COVERAGE
+#define COVERAGE( name, NAME, description,             \
+                  tag1, tag2, tag3, tag4 )             \
+          static const hb_tag_t  name ## _coverage[] = \
+          {                                            \
+            HB_TAG( tag1, tag2, tag3, tag4 ),          \
+            HB_TAG_NONE                                \
+          };
+
+
+#include "afcover.h"
+
+
+  /* define mapping between coverage tags and AF_Coverage */
+#undef  COVERAGE
+#define COVERAGE( name, NAME, description, \
+                  tag1, tag2, tag3, tag4 ) \
+          name ## _coverage,
+
+
+  static const hb_tag_t*  coverages[] =
+  {
+#include "afcover.h"
+
+    NULL /* AF_COVERAGE_DEFAULT */
+  };
+
+
+  /* load HarfBuzz script tags */
+#undef  SCRIPT
+#define SCRIPT( s, S, d, h, sc1, sc2, sc3 )  h,
+
+
+  static const hb_script_t  scripts[] =
+  {
+#include "afscript.h"
+  };
+
+
+  FT_Error
+  af_get_coverage( AF_FaceGlobals  globals,
+                   AF_StyleClass   style_class,
+                   FT_Byte*        gstyles )
+  {
+    hb_face_t*  face;
+
+    hb_set_t*  gsub_lookups;  /* GSUB lookups for a given script */
+    hb_set_t*  gsub_glyphs;   /* glyphs covered by GSUB lookups  */
+    hb_set_t*  gpos_lookups;  /* GPOS lookups for a given script */
+    hb_set_t*  gpos_glyphs;   /* glyphs covered by GPOS lookups  */
+
+    hb_script_t      script;
+    const hb_tag_t*  coverage_tags;
+    hb_tag_t         script_tags[] = { HB_TAG_NONE,
+                                       HB_TAG_NONE,
+                                       HB_TAG_NONE,
+                                       HB_TAG_NONE };
+
+    hb_codepoint_t  idx;
+#ifdef FT_DEBUG_LEVEL_TRACE
+    int             count;
+#endif
+
+
+    if ( !globals || !style_class || !gstyles )
+      return FT_THROW( Invalid_Argument );
+
+    face = hb_font_get_face( globals->hb_font );
+
+    gsub_lookups = hb_set_create();
+    gsub_glyphs  = hb_set_create();
+    gpos_lookups = hb_set_create();
+    gpos_glyphs  = hb_set_create();
+
+    coverage_tags = coverages[style_class->coverage];
+    script        = scripts[style_class->script];
+
+    /* Convert a HarfBuzz script tag into the corresponding OpenType */
+    /* tag or tags -- some Indic scripts like Devanagari have an old */
+    /* and a new set of features.                                    */
+    hb_ot_tags_from_script( script,
+                            &script_tags[0],
+                            &script_tags[1] );
+
+    /* `hb_ot_tags_from_script' usually returns HB_OT_TAG_DEFAULT_SCRIPT */
+    /* as the second tag.  We change that to HB_TAG_NONE except for the  */
+    /* default script.                                                   */
+    if ( style_class->script == globals->module->default_script &&
+         style_class->coverage == AF_COVERAGE_DEFAULT           )
+    {
+      if ( script_tags[0] == HB_TAG_NONE )
+        script_tags[0] = HB_OT_TAG_DEFAULT_SCRIPT;
+      else
+      {
+        if ( script_tags[1] == HB_TAG_NONE )
+          script_tags[1] = HB_OT_TAG_DEFAULT_SCRIPT;
+        else if ( script_tags[1] != HB_OT_TAG_DEFAULT_SCRIPT )
+          script_tags[2] = HB_OT_TAG_DEFAULT_SCRIPT;
+      }
+    }
+    else
+    {
+      if ( script_tags[1] == HB_OT_TAG_DEFAULT_SCRIPT )
+        script_tags[1] = HB_TAG_NONE;
+    }
+
+    hb_ot_layout_collect_lookups( face,
+                                  HB_OT_TAG_GSUB,
+                                  script_tags,
+                                  NULL,
+                                  coverage_tags,
+                                  gsub_lookups );
+
+    if ( hb_set_is_empty( gsub_lookups ) )
+      goto Exit; /* nothing to do */
+
+    hb_ot_layout_collect_lookups( face,
+                                  HB_OT_TAG_GPOS,
+                                  script_tags,
+                                  NULL,
+                                  coverage_tags,
+                                  gpos_lookups );
+
+    FT_TRACE4(( "GSUB lookups (style `%s'):\n"
+                " ",
+                af_style_names[style_class->style] ));
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+    count = 0;
+#endif
+
+    for ( idx = -1; hb_set_next( gsub_lookups, &idx ); )
+    {
+#ifdef FT_DEBUG_LEVEL_TRACE
+      FT_TRACE4(( " %d", idx ));
+      count++;
+#endif
+
+      /* get output coverage of GSUB feature */
+      hb_ot_layout_lookup_collect_glyphs( face,
+                                          HB_OT_TAG_GSUB,
+                                          idx,
+                                          NULL,
+                                          NULL,
+                                          NULL,
+                                          gsub_glyphs );
+    }
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+    if ( !count )
+      FT_TRACE4(( " (none)" ));
+    FT_TRACE4(( "\n\n" ));
+#endif
+
+    FT_TRACE4(( "GPOS lookups (style `%s'):\n"
+                " ",
+                af_style_names[style_class->style] ));
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+    count = 0;
+#endif
+
+    for ( idx = -1; hb_set_next( gpos_lookups, &idx ); )
+    {
+#ifdef FT_DEBUG_LEVEL_TRACE
+      FT_TRACE4(( " %d", idx ));
+      count++;
+#endif
+
+      /* get input coverage of GPOS feature */
+      hb_ot_layout_lookup_collect_glyphs( face,
+                                          HB_OT_TAG_GPOS,
+                                          idx,
+                                          NULL,
+                                          gpos_glyphs,
+                                          NULL,
+                                          NULL );
+    }
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+    if ( !count )
+      FT_TRACE4(( " (none)" ));
+    FT_TRACE4(( "\n\n" ));
+#endif
+
+    /*
+     * We now check whether we can construct blue zones, using glyphs
+     * covered by the feature only.  In case there is not a single zone
+     * (this is, not a single character is covered), we skip this coverage.
+     *
+     */
+    if ( style_class->coverage != AF_COVERAGE_DEFAULT )
+    {
+      AF_Blue_Stringset         bss = style_class->blue_stringset;
+      const AF_Blue_StringRec*  bs  = &af_blue_stringsets[bss];
+
+      FT_Bool  found = 0;
+
+
+      for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ )
+      {
+        const char*  p = &af_blue_strings[bs->string];
+
+
+        while ( *p )
+        {
+          hb_codepoint_t  ch;
+
+
+          GET_UTF8_CHAR( ch, p );
+
+          for ( idx = -1; hb_set_next( gsub_lookups, &idx ); )
+          {
+            hb_codepoint_t  gidx = FT_Get_Char_Index( globals->face, ch );
+
+
+            if ( hb_ot_layout_lookup_would_substitute( face, idx,
+                                                       &gidx, 1, 1 ) )
+            {
+              found = 1;
+              break;
+            }
+          }
+        }
+      }
+
+      if ( !found )
+      {
+        FT_TRACE4(( "  no blue characters found; style skipped\n" ));
+        goto Exit;
+      }
+    }
+
+    /*
+     * Various OpenType features might use the same glyphs at different
+     * vertical positions; for example, superscript and subscript glyphs
+     * could be the same.  However, the auto-hinter is completely
+     * agnostic of OpenType features after the feature analysis has been
+     * completed: The engine then simply receives a glyph index and returns a
+     * hinted and usually rendered glyph.
+     *
+     * Consider the superscript feature of font `pala.ttf': Some of the
+     * glyphs are `real', this is, they have a zero vertical offset, but
+     * most of them are small caps glyphs shifted up to the superscript
+     * position (this is, the `sups' feature is present in both the GSUB and
+     * GPOS tables).  The code for blue zones computation actually uses a
+     * feature's y offset so that the `real' glyphs get correct hints.  But
+     * later on it is impossible to decide whether a glyph index belongs to,
+     * say, the small caps or superscript feature.
+     *
+     * For this reason, we don't assign a style to a glyph if the current
+     * feature covers the glyph in both the GSUB and the GPOS tables.  This
+     * is quite a broad condition, assuming that
+     *
+     *   (a) glyphs that get used in multiple features are present in a
+     *       feature without vertical shift,
+     *
+     * and
+     *
+     *   (b) a feature's GPOS data really moves the glyph vertically.
+     *
+     * Not fulfilling condition (a) makes a font larger; it would also
+     * reduce the number of glyphs that could be addressed directly without
+     * using OpenType features, so this assumption is rather strong.
+     *
+     * Condition (b) is much weaker, and there might be glyphs which get
+     * missed.  However, the OpenType features we are going to handle are
+     * primarily located in GSUB, and HarfBuzz doesn't provide an API to
+     * directly get the necessary information from the GPOS table.  A
+     * possible solution might be to directly parse the GPOS table to find
+     * out whether a glyph gets shifted vertically, but this is something I
+     * would like to avoid if not really necessary.
+     *
+     * Note that we don't follow this logic for the default coverage.
+     * Complex scripts like Devanagari have mandatory GPOS features to
+     * position many glyph elements, using mark-to-base or mark-to-ligature
+     * tables; the number of glyphs missed due to condition (b) would be far
+     * too large.
+     *
+     */
+    if ( style_class->coverage != AF_COVERAGE_DEFAULT )
+      hb_set_subtract( gsub_glyphs, gpos_glyphs );
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+    FT_TRACE4(( "  glyphs without GPOS data (`*' means already assigned)" ));
+    count = 0;
+#endif
+
+    for ( idx = -1; hb_set_next( gsub_glyphs, &idx ); )
+    {
+#ifdef FT_DEBUG_LEVEL_TRACE
+      if ( !( count % 10 ) )
+        FT_TRACE4(( "\n"
+                    "   " ));
+
+      FT_TRACE4(( " %d", idx ));
+      count++;
+#endif
+
+      /* glyph indices returned by `hb_ot_layout_lookup_collect_glyphs' */
+      /* can be arbitrary: some fonts use fake indices for processing   */
+      /* internal to GSUB or GPOS, which is fully valid                 */
+      if ( idx >= (hb_codepoint_t)globals->glyph_count )
+        continue;
+
+      if ( gstyles[idx] == AF_STYLE_UNASSIGNED )
+        gstyles[idx] = (FT_Byte)style_class->style;
+#ifdef FT_DEBUG_LEVEL_TRACE
+      else
+        FT_TRACE4(( "*" ));
+#endif
+    }
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+    if ( !count )
+      FT_TRACE4(( "\n"
+                  "    (none)" ));
+    FT_TRACE4(( "\n\n" ));
+#endif
+
+  Exit:
+    hb_set_destroy( gsub_lookups );
+    hb_set_destroy( gsub_glyphs  );
+    hb_set_destroy( gpos_lookups );
+    hb_set_destroy( gpos_glyphs  );
+
+    return FT_Err_Ok;
+  }
+
+
+  /* construct HarfBuzz features */
+#undef  COVERAGE
+#define COVERAGE( name, NAME, description,                \
+                  tag1, tag2, tag3, tag4 )                \
+          static const hb_feature_t  name ## _feature[] = \
+          {                                               \
+            {                                             \
+              HB_TAG( tag1, tag2, tag3, tag4 ),           \
+              1, 0, (unsigned int)-1                      \
+            }                                             \
+          };
+
+
+#include "afcover.h"
+
+
+  /* define mapping between HarfBuzz features and AF_Coverage */
+#undef  COVERAGE
+#define COVERAGE( name, NAME, description, \
+                  tag1, tag2, tag3, tag4 ) \
+          name ## _feature,
+
+
+  static const hb_feature_t*  features[] =
+  {
+#include "afcover.h"
+
+    NULL /* AF_COVERAGE_DEFAULT */
+  };
+
+
+  FT_Error
+  af_get_char_index( AF_StyleMetrics  metrics,
+                     FT_ULong         charcode,
+                     FT_ULong        *codepoint,
+                     FT_Long         *y_offset )
+  {
+    AF_StyleClass  style_class;
+
+    const hb_feature_t*  feature;
+
+    FT_ULong  in_idx, out_idx;
+
+
+    if ( !metrics )
+      return FT_THROW( Invalid_Argument );
+
+    in_idx = FT_Get_Char_Index( metrics->globals->face, charcode );
+
+    style_class = metrics->style_class;
+
+    feature = features[style_class->coverage];
+
+    if ( feature )
+    {
+      FT_UInt  upem = metrics->globals->face->units_per_EM;
+
+      hb_font_t*    font = metrics->globals->hb_font;
+      hb_buffer_t*  buf  = hb_buffer_create();
+
+      uint32_t  c = (uint32_t)charcode;
+
+      hb_glyph_info_t*      ginfo;
+      hb_glyph_position_t*  gpos;
+      unsigned int          gcount;
+
+
+      /* we shape at a size of units per EM; this means font units */
+      hb_font_set_scale( font, upem, upem );
+
+      /* XXX: is this sufficient for a single character of any script? */
+      hb_buffer_set_direction( buf, HB_DIRECTION_LTR );
+      hb_buffer_set_script( buf, scripts[style_class->script] );
+
+      /* we add one character to `buf' ... */
+      hb_buffer_add_utf32( buf, &c, 1, 0, 1 );
+
+      /* ... and apply one feature */
+      hb_shape( font, buf, feature, 1 );
+
+      ginfo = hb_buffer_get_glyph_infos( buf, &gcount );
+      gpos  = hb_buffer_get_glyph_positions( buf, &gcount );
+
+      out_idx = ginfo[0].codepoint;
+
+      /* getting the same index indicates no substitution,         */
+      /* which means that the glyph isn't available in the feature */
+      if ( in_idx == out_idx )
+      {
+        *codepoint = 0;
+        *y_offset  = 0;
+      }
+      else
+      {
+        *codepoint = out_idx;
+        *y_offset  = gpos[0].y_offset;
+      }
+
+      hb_buffer_destroy( buf );
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+      if ( gcount > 1 )
+        FT_TRACE1(( "af_get_char_index:"
+                    " input character mapped to multiple glyphs\n" ));
+#endif
+    }
+    else
+    {
+      *codepoint = in_idx;
+      *y_offset  = 0;
+    }
+
+    return FT_Err_Ok;
+  }
+
+
+#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
+
+
+  FT_Error
+  af_get_coverage( AF_FaceGlobals  globals,
+                   AF_StyleClass   style_class,
+                   FT_Byte*        gstyles )
+  {
+    FT_UNUSED( globals );
+    FT_UNUSED( style_class );
+    FT_UNUSED( gstyles );
+
+    return FT_Err_Ok;
+  }
+
+
+  FT_Error
+  af_get_char_index( AF_StyleMetrics  metrics,
+                     FT_ULong         charcode,
+                     FT_ULong        *codepoint,
+                     FT_Long         *y_offset )
+  {
+    FT_Face  face;
+
+
+    if ( !metrics )
+      return FT_THROW( Invalid_Argument );
+
+    face = metrics->globals->face;
+
+    *codepoint = FT_Get_Char_Index( face, charcode );
+    *y_offset  = 0;
+
+    return FT_Err_Ok;
+  }
+
+
+#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
+
+
+/* END */
diff --git a/src/autofit/hbshim.h b/src/autofit/hbshim.h
new file mode 100644 (file)
index 0000000..02f1513
--- /dev/null
@@ -0,0 +1,56 @@
+/***************************************************************************/
+/*                                                                         */
+/*  hbshim.h                                                               */
+/*                                                                         */
+/*    HarfBuzz interface for accessing OpenType features (specification).  */
+/*                                                                         */
+/*  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 __HBSHIM_H__
+#define __HBSHIM_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+
+#include <hb.h>
+#include <hb-ot.h>
+#include <hb-ft.h>
+
+#endif
+
+
+FT_BEGIN_HEADER
+
+  FT_Error
+  af_get_coverage( AF_FaceGlobals  globals,
+                   AF_StyleClass   style_class,
+                   FT_Byte*        gstyles );
+
+  FT_Error
+  af_get_char_index( AF_StyleMetrics  metrics,
+                     FT_ULong         charcode,
+                     FT_ULong        *codepoint,
+                     FT_Long         *y_offset );
+
+ /* */
+
+FT_END_HEADER
+
+#endif /* __HBSHIM_H__ */
+
+
+/* END */
index b76bb79..658f04e 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 2003, 2004, 2005, 2006, 2007, 2011 by
+# Copyright 2003-2007, 2011, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -26,6 +26,7 @@ AUTOF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(AUTOF_DIR))
 # AUTOF driver sources (i.e., C files)
 #
 AUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \
+                 $(AUTOF_DIR)/afblue.c   \
                  $(AUTOF_DIR)/afcjk.c    \
                  $(AUTOF_DIR)/afdummy.c  \
                  $(AUTOF_DIR)/afglobal.c \
@@ -35,13 +36,19 @@ AUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \
                  $(AUTOF_DIR)/afloader.c \
                  $(AUTOF_DIR)/afmodule.c \
                  $(AUTOF_DIR)/afpic.c    \
-                 $(AUTOF_DIR)/afwarp.c
+                 $(AUTOF_DIR)/afranges.c \
+                 $(AUTOF_DIR)/afwarp.c   \
+                 $(AUTOF_DIR)/hbshim.c
 
 # AUTOF driver headers
 #
 AUTOF_DRV_H := $(AUTOF_DRV_SRC:%c=%h)  \
+               $(AUTOF_DIR)/afcover.h  \
                $(AUTOF_DIR)/aferrors.h \
-               $(AUTOF_DIR)/aftypes.h
+               $(AUTOF_DIR)/afscript.h \
+               $(AUTOF_DIR)/afstyles.h \
+               $(AUTOF_DIR)/aftypes.h  \
+               $(AUTOF_DIR)/afwrtsys.h
 
 
 # AUTOF driver object(s)
index d754eb1..aeb6fd5 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for base.            */
 /*                                                                         */
-/*  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,       */
 #include FT_INTERNAL_OBJECTS_H
 #include "basepic.h"
 
+
 #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*  clazz );
-  void FT_Init_Class_ft_bitmap_glyph_class( FT_Glyph_Class*  clazz );
+  void
+  FT_Init_Class_ft_outline_glyph_class( FT_Glyph_Class*  clazz );
+
+  void
+  FT_Init_Class_ft_bitmap_glyph_class( FT_Glyph_Class*  clazz );
 
-  /* forward declaration of PIC init function from ftrfork.c (not modularized) */
-  void FT_Init_Table_raccess_guess_table( ft_raccess_guess_rec*  record );
+#ifdef FT_CONFIG_OPTION_MAC_FONTS
+  /* forward declaration of PIC init function from ftrfork.c */
+  /* (not modularized)                                       */
+  void
+  FT_Init_Table_ft_raccess_guess_table( ft_raccess_guess_rec*  record );
+#endif
 
   /* forward declaration of PIC init functions from ftinit.c */
   FT_Error
   void
   ft_destroy_default_module_classes( FT_Library  library );
 
+
   void
   ft_base_pic_free( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
-    FT_Memory          memory = library->memory;
+    FT_Memory          memory        = library->memory;
+
+
     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_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_Error           error         = FT_Err_Ok;
+    BasePIC*           container     = NULL;
+    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->base = container;
     if ( error )
       goto Exit;
 
-    /* initialize pointer table - this is how the module usually expects this data */
+    /* 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 );
-    FT_Init_Table_raccess_guess_table(
-      (ft_raccess_guess_rec*)&container->ft_raccess_guess_table);
+#ifdef FT_CONFIG_OPTION_MAC_FONTS
+    FT_Init_Table_ft_raccess_guess_table(
+      (ft_raccess_guess_rec*)&container->ft_raccess_guess_table );
+#endif
 
-Exit:
-    if( error )
+  Exit:
+    if ( error )
       ft_base_pic_free( library );
     return error;
   }
 
-
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
index bf90bef..329d7c8 100644 (file)
@@ -25,11 +25,13 @@ 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
+#define FT_RACCESS_GUESS_TABLE_GET  ft_raccess_guess_table
 #endif
 
 #else /* FT_CONFIG_OPTION_PIC */
@@ -41,25 +43,35 @@ FT_BEGIN_HEADER
 #endif
 
 
-  typedef struct BasePIC_
+  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];
+    ft_raccess_guess_rec  ft_raccess_guess_table[FT_RACCESS_N_RULES];
 #endif
+
   } 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)
+#define FT_RACCESS_GUESS_TABLE_GET                       \
+          ( GET_PIC( library )->ft_raccess_guess_table )
 #endif
 
-  /* see basepic.c for the implementation. */
+
+  /* see basepic.c for the implementation */
   void
   ft_base_pic_free( FT_Library  library );
 
@@ -67,7 +79,8 @@ FT_BEGIN_HEADER
   ft_base_pic_init( FT_Library  library );
 
 #endif /* FT_CONFIG_OPTION_PIC */
- /* */
+
+  /* */
 
 FT_END_HEADER
 
index a8bb43d..18884ef 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Quick computation of advance widths (body).                          */
 /*                                                                         */
-/*  Copyright 2008, 2009, 2011 by                                          */
+/*  Copyright 2008, 2009, 2011, 2013, 2014 by                              */
 /*  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 FT_INTERNAL_DEBUG_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_Invalid_Size_Handle;
+      return FT_THROW( Invalid_Size_Handle );
 
     if ( flags & FT_LOAD_VERTICAL_LAYOUT )
       scale = face->size->metrics.y_scale;
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
+
+    if ( !padvance )
+      return FT_THROW( Invalid_Argument );
 
     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 ) )
@@ -91,7 +96,7 @@
       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;
     }
 
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
+
+    if ( !padvances )
+      return FT_THROW( Invalid_Argument );
 
     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 ( !error )
         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 FT_Err_Unimplemented_Feature;
+      return FT_THROW( Unimplemented_Feature );
 
     flags |= (FT_UInt32)FT_LOAD_ADVANCE_ONLY;
     for ( nn = 0; nn < count; nn++ )
index 4b8e911..f9a1751 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType bbox computation (body).                                    */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004, 2006, 2010 by                         */
+/*  Copyright 1996-2002, 2004, 2006, 2010, 2013, 2014 by                   */
 /*  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 FT_INTERNAL_DEBUG_H
+
 #include FT_BBOX_H
 #include FT_IMAGE_H
 #include FT_OUTLINE_H
   } TBBox_Rec;
 
 
+#define FT_UPDATE_BBOX( p, bbox ) \
+  FT_BEGIN_STMNT                  \
+    if ( p->x < bbox.xMin )       \
+      bbox.xMin = p->x;           \
+    if ( p->x > bbox.xMax )       \
+      bbox.xMax = p->x;           \
+    if ( p->y < bbox.yMin )       \
+      bbox.yMin = p->y;           \
+    if ( p->y > bbox.yMax )       \
+      bbox.yMax = p->y;           \
+  FT_END_STMNT
+
+#define CHECK_X( p, bbox )                         \
+          ( p->x < bbox.xMin || p->x > bbox.xMax )
+
+#define CHECK_Y( p, bbox )                         \
+          ( p->y < bbox.yMin || p->y > bbox.yMax )
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
   /*    BBox_Move_To                                                       */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    This function is used as a `move_to' and `line_to' emitter during  */
+  /*    This function is used as a `move_to' emitter during                */
   /*    FT_Outline_Decompose().  It simply records the destination point   */
-  /*    in `user->last'; no further computations are necessary since we    */
-  /*    use the cbox as the starting bbox which must be refined.           */
+  /*    in `user->last'. We also update bbox in case contour starts with   */
+  /*    an implicit `on' point.                                            */
   /*                                                                       */
   /* <Input>                                                               */
   /*    to   :: A pointer to the destination vector.                       */
   BBox_Move_To( FT_Vector*  to,
                 TBBox_Rec*  user )
   {
+    FT_UPDATE_BBOX( to, user->bbox );
+
     user->last = *to;
 
     return 0;
   }
 
 
-#define CHECK_X( p, bbox )  \
-          ( p->x < bbox.xMin || p->x > bbox.xMax )
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    BBox_Line_To                                                       */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    This function is used as a `line_to' emitter during                */
+  /*    FT_Outline_Decompose().  It simply records the destination point   */
+  /*    in `user->last'; no further computations are necessary because     */
+  /*    bbox already contains both explicit ends of the line segment.      */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    to   :: A pointer to the destination vector.                       */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    user :: A pointer to the current walk context.                     */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    Always 0.  Needed for the interface only.                          */
+  /*                                                                       */
+  static int
+  BBox_Line_To( FT_Vector*  to,
+                TBBox_Rec*  user )
+  {
+    user->last = *to;
 
-#define CHECK_Y( p, bbox )  \
-          ( p->y < bbox.yMin || p->y > bbox.yMax )
+    return 0;
+  }
 
 
   /*************************************************************************/
   /*    BBox_Conic_Check                                                   */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Finds the extrema of a 1-dimensional conic Bezier curve and update */
+  /*    Find the extrema of a 1-dimensional conic Bezier curve and update  */
   /*    a bounding range.  This version uses direct computation, as it     */
   /*    doesn't need square roots.                                         */
   /*                                                                       */
                     FT_Pos*  min,
                     FT_Pos*  max )
   {
-    if ( y1 <= y3 && y2 == y1 )     /* flat arc */
-      goto Suite;
-
-    if ( y1 < y3 )
-    {
-      if ( y2 >= y1 && y2 <= y3 )   /* ascending arc */
-        goto Suite;
-    }
-    else
-    {
-      if ( y2 >= y3 && y2 <= y1 )   /* descending arc */
-      {
-        y2 = y1;
-        y1 = y3;
-        y3 = y2;
-        goto Suite;
-      }
-    }
-
-    y1 = y3 = y1 - FT_MulDiv( y2 - y1, y2 - y1, y1 - 2*y2 + y3 );
-
-  Suite:
-    if ( y1 < *min ) *min = y1;
-    if ( y3 > *max ) *max = y3;
+    /* This function is only called when a control off-point is outside */
+    /* the bbox that contains all on-points.  It finds a local extremum */
+    /* within the segment, equal to (y1*y3 - y2*y2)/(y1 - 2*y2 + y3).   */
+    /* Or, offsetting from y2, we get                                   */
+
+    y1 -= y2;
+    y3 -= y2;
+    y2 += FT_MulDiv( y1, y3, y1 + y3 );
+
+    if ( y2 < *min )
+      *min = y2;
+    if ( y2 > *max )
+      *max = y2;
   }
 
 
                  FT_Vector*  to,
                  TBBox_Rec*  user )
   {
-    /* we don't need to check `to' since it is always an `on' point, thus */
-    /* within the bbox                                                    */
+    /* in case `to' is implicit and not included in bbox yet */
+    FT_UPDATE_BBOX( to, user->bbox );
 
     if ( CHECK_X( control, user->bbox ) )
       BBox_Conic_Check( user->last.x,
   /*    BBox_Cubic_Check                                                   */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Finds the extrema of a 1-dimensional cubic Bezier curve and        */
-  /*    updates a bounding range.  This version uses splitting because we  */
-  /*    don't want to use square roots and extra accuracy.                 */
+  /*    Find the extrema of a 1-dimensional cubic Bezier curve and         */
+  /*    update a bounding range.  This version uses iterative splitting    */
+  /*    because it is faster than the exact solution with square roots.    */
   /*                                                                       */
   /* <Input>                                                               */
   /*    p1  :: The start coordinate.                                       */
   /*                                                                       */
   /*    max :: The address of the current maximum.                         */
   /*                                                                       */
-
-#if 0
-
-  static void
-  BBox_Cubic_Check( FT_Pos   p1,
-                    FT_Pos   p2,
-                    FT_Pos   p3,
-                    FT_Pos   p4,
-                    FT_Pos*  min,
-                    FT_Pos*  max )
+  static FT_Pos
+  cubic_peak( FT_Pos  q1,
+              FT_Pos  q2,
+              FT_Pos  q3,
+              FT_Pos  q4 )
   {
-    FT_Pos  stack[32*3 + 1], *arc;
-
-
-    arc = stack;
-
-    arc[0] = p1;
-    arc[1] = p2;
-    arc[2] = p3;
-    arc[3] = p4;
-
-    do
+    FT_Pos  peak = 0;
+    FT_Int  shift;
+
+    /* This function finds a peak of a cubic segment if it is above 0    */
+    /* using iterative bisection of the segment, or returns 0.           */
+    /* The fixed-point arithmetic of bisection is inherently stable      */
+    /* but may loose accuracy in the two lowest bits.  To compensate,    */
+    /* we upscale the segment if there is room.  Large values may need   */
+    /* to be downscaled to avoid overflows during bisection.             */
+    /* It is called with either q2 or q3 positive, which is necessary    */
+    /* for the peak to exist and avoids undefined FT_MSB.                */
+
+    shift = 27 -
+      FT_MSB( FT_ABS( q1 ) | FT_ABS( q2 ) | FT_ABS( q3 ) | FT_ABS( q4 ) );
+
+    if ( shift > 0 )
     {
-      FT_Pos  y1 = arc[0];
-      FT_Pos  y2 = arc[1];
-      FT_Pos  y3 = arc[2];
-      FT_Pos  y4 = arc[3];
-
+      /* upscaling too much just wastes time */
+      if ( shift > 2 )
+        shift = 2;
+
+      q1 <<=  shift;
+      q2 <<=  shift;
+      q3 <<=  shift;
+      q4 <<=  shift;
+    }
+    else
+    {
+      q1 >>= -shift;
+      q2 >>= -shift;
+      q3 >>= -shift;
+      q4 >>= -shift;
+    }
 
-      if ( y1 == y4 )
+    /* for a peak to exist above 0, the cubic segment must have */
+    /* at least one of its control off-points above 0.          */
+    while ( q2 > 0 || q3 > 0 )
+    {
+      /* 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 whether 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;
-        }
+        peak = q1;
+        break;
       }
+      if ( q3 == q4 && q2 <= q4 )
+      {
+        peak = 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;
-
-   Test:
-      if ( y1 < *min ) *min = y1;
-      if ( y4 > *max ) *max = y4;
-      arc -= 3;
-
-    Suite:
-      ;
-    } while ( arc >= stack );
-  }
-
-#else
-
-  static void
-  test_cubic_extrema( FT_Pos    y1,
-                      FT_Pos    y2,
-                      FT_Pos    y3,
-                      FT_Pos    y4,
-                      FT_Fixed  u,
-                      FT_Pos*   min,
-                      FT_Pos*   max )
-  {
- /* FT_Pos    a = y4 - 3*y3 + 3*y2 - y1; */
-    FT_Pos    b = y3 - 2*y2 + y1;
-    FT_Pos    c = y2 - y1;
-    FT_Pos    d = y1;
-    FT_Pos    y;
-    FT_Fixed  uu;
-
-    FT_UNUSED ( y4 );
-
-
-    /* The polynomial is                      */
-    /*                                        */
-    /*    P(x) = a*x^3 + 3b*x^2 + 3c*x + d  , */
-    /*                                        */
-    /*   dP/dx = 3a*x^2 + 6b*x + 3c         . */
-    /*                                        */
-    /* However, we also have                  */
-    /*                                        */
-    /*   dP/dx(u) = 0                       , */
-    /*                                        */
-    /* which implies by subtraction that      */
-    /*                                        */
-    /*   P(u) = b*u^2 + 2c*u + d            . */
-
-    if ( u > 0 && u < 0x10000L )
-    {
-      uu = FT_MulFix( u, u );
-      y  = d + FT_MulFix( c, 2*u ) + FT_MulFix( b, uu );
+    if ( shift > 0 )
+      peak >>=  shift;
+    else
+      peak <<= -shift;
 
-      if ( y < *min ) *min = y;
-      if ( y > *max ) *max = y;
-    }
+    return peak;
   }
 
 
   static void
-  BBox_Cubic_Check( FT_Pos   y1,
-                    FT_Pos   y2,
-                    FT_Pos   y3,
-                    FT_Pos   y4,
+  BBox_Cubic_Check( FT_Pos   p1,
+                    FT_Pos   p2,
+                    FT_Pos   p3,
+                    FT_Pos   p4,
                     FT_Pos*  min,
                     FT_Pos*  max )
   {
-    /* always compare first and last points */
-    if      ( y1 < *min )  *min = y1;
-    else if ( y1 > *max )  *max = y1;
+    /* This function is only called when a control off-point is outside  */
+    /* the bbox that contains all on-points.  So at least one of the     */
+    /* conditions below holds and cubic_peak is called with at least one */
+    /* non-zero argument.                                                */
 
-    if      ( y4 < *min )  *min = y4;
-    else if ( y4 > *max )  *max = y4;
+    if ( p2 > *max || p3 > *max )
+      *max += cubic_peak( p1 - *max, p2 - *max, p3 - *max, p4 - *max );
 
-    /* now, try to see if there are split points here */
-    if ( y1 <= y4 )
-    {
-      /* flat or ascending arc test */
-      if ( y1 <= y2 && y2 <= y4 && y1 <= y3 && y3 <= y4 )
-        return;
-    }
-    else /* y1 > y4 */
-    {
-      /* descending arc test */
-      if ( y1 >= y2 && y2 >= y4 && y1 >= y3 && y3 >= y4 )
-        return;
-    }
-
-    /* There are some split points.  Find them. */
-    {
-      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;
-
-
-      /* 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.                            */
-      /*                                                                   */
-      /* 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.                      */
-
-      {
-        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;
-
-        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;
-
-          } while ( t1 < 0x400000UL );
-
-          a <<= shift;
-          b <<= shift;
-          c <<= shift;
-        }
-      }
-
-      /* handle a == 0 */
-      if ( a == 0 )
-      {
-        if ( b != 0 )
-        {
-          t = - FT_DivFix( c, b ) / 2;
-          test_cubic_extrema( y1, y2, y3, y4, t, min, max );
-        }
-      }
-      else
-      {
-        /* solve the equation now */
-        d = FT_MulFix( b, b ) - FT_MulFix( a, c );
-        if ( d < 0 )
-          return;
-
-        if ( d == 0 )
-        {
-          /* there is a single split point at -b/a */
-          t = - FT_DivFix( b, a );
-          test_cubic_extrema( y1, y2, y3, y4, t, min, max );
-        }
-        else
-        {
-          /* there are two solutions; we need to filter them */
-          d = FT_SqrtFixed( (FT_Int32)d );
-          t = - FT_DivFix( b - d, a );
-          test_cubic_extrema( y1, y2, y3, y4, t, min, max );
-
-          t = - FT_DivFix( b + d, a );
-          test_cubic_extrema( y1, y2, y3, y4, t, min, max );
-        }
-      }
-    }
+    /* now flip the signs to update the minimum */
+    if ( p2 < *min || p3 < *min )
+      *min -= cubic_peak( *min - p1, *min - p2, *min - p3, *min - p4 );
   }
 
-#endif
-
 
   /*************************************************************************/
   /*                                                                       */
                  FT_Vector*  to,
                  TBBox_Rec*  user )
   {
-    /* we don't need to check `to' since it is always an `on' point, thus */
-    /* within the bbox                                                    */
+    /* We don't need to check `to' since it is always an on-point,    */
+    /* thus within the bbox.  Only segments with an off-point outside */
+    /* the bbox can possibly reach new extreme values.                */
 
     if ( CHECK_X( control1, user->bbox ) ||
          CHECK_X( control2, user->bbox ) )
     return 0;
   }
 
-FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
+
+  FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
     (FT_Outline_MoveTo_Func) BBox_Move_To,
-    (FT_Outline_LineTo_Func) BBox_Move_To,
+    (FT_Outline_LineTo_Func) BBox_Line_To,
     (FT_Outline_ConicTo_Func)BBox_Conic_To,
     (FT_Outline_CubicTo_Func)BBox_Cubic_To,
     0, 0
   )
 
+
   /* documentation is in ftbbox.h */
 
   FT_EXPORT_DEF( FT_Error )
   FT_Outline_Get_BBox( FT_Outline*  outline,
                        FT_BBox     *abbox )
   {
-    FT_BBox     cbox;
-    FT_BBox     bbox;
+    FT_BBox     cbox = {  0x7FFFFFFFL,  0x7FFFFFFFL,
+                         -0x7FFFFFFFL, -0x7FFFFFFFL };
+    FT_BBox     bbox = {  0x7FFFFFFFL,  0x7FFFFFFFL,
+                         -0x7FFFFFFFL, -0x7FFFFFFFL };
     FT_Vector*  vec;
     FT_UShort   n;
 
 
     if ( !abbox )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     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 )
@@ -599,32 +462,13 @@ FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
     /* coincide, we exit immediately.                             */
 
     vec = outline->points;
-    bbox.xMin = bbox.xMax = cbox.xMin = cbox.xMax = vec->x;
-    bbox.yMin = bbox.yMax = cbox.yMin = cbox.yMax = vec->y;
-    vec++;
 
-    for ( n = 1; n < outline->n_points; n++ )
+    for ( n = 0; n < outline->n_points; n++ )
     {
-      FT_Pos  x = vec->x;
-      FT_Pos  y = vec->y;
-
-
-      /* update control box */
-      if ( x < cbox.xMin ) cbox.xMin = x;
-      if ( x > cbox.xMax ) cbox.xMax = x;
-
-      if ( y < cbox.yMin ) cbox.yMin = y;
-      if ( y > cbox.yMax ) cbox.yMax = y;
+      FT_UPDATE_BBOX( vec, cbox);
 
       if ( FT_CURVE_TAG( outline->tags[n] ) == FT_CURVE_TAG_ON )
-      {
-        /* update bbox for `on' points only */
-        if ( x < bbox.xMin ) bbox.xMin = x;
-        if ( x > bbox.xMax ) bbox.xMax = x;
-
-        if ( y < bbox.yMin ) bbox.yMin = y;
-        if ( y > bbox.yMax ) bbox.yMax = y;
-      }
+        FT_UPDATE_BBOX( vec, bbox);
 
       vec++;
     }
index d29adf0..d9dcbad 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for accessing BDF-specific strings (body).              */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004 by                                          */
+/*  Copyright 2002-2004, 2013, 2014 by                                     */
 /*  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 FT_INTERNAL_DEBUG_H
+
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_BDF_H
 
     const char*  encoding = NULL;
     const char*  registry = NULL;
 
+    FT_Service_BDF  service;
 
-    error = FT_Err_Invalid_Argument;
-
-    if ( face )
-    {
-      FT_Service_BDF  service;
 
+    if ( !face )
+      return FT_THROW( Invalid_Face_Handle );
 
-      FT_FACE_FIND_SERVICE( face, service, BDF );
+    FT_FACE_FIND_SERVICE( face, service, BDF );
 
-      if ( service && service->get_charset_id )
-        error = service->get_charset_id( face, &encoding, &registry );
-    }
+    if ( service && service->get_charset_id )
+      error = service->get_charset_id( face, &encoding, &registry );
+    else
+      error = FT_THROW( Invalid_Argument );
 
     if ( acharset_encoding )
       *acharset_encoding = encoding;
   {
     FT_Error  error;
 
+    FT_Service_BDF  service;
 
-    error = FT_Err_Invalid_Argument;
 
-    aproperty->type = BDF_PROPERTY_TYPE_NONE;
+    if ( !face )
+      return FT_THROW( Invalid_Face_Handle );
 
-    if ( face )
-    {
-      FT_Service_BDF  service;
+    if ( !aproperty )
+      return FT_THROW( Invalid_Argument );
 
+    aproperty->type = BDF_PROPERTY_TYPE_NONE;
 
-      FT_FACE_FIND_SERVICE( face, service, BDF );
+    FT_FACE_FIND_SERVICE( face, service, BDF );
 
-      if ( service && service->get_property )
-        error = service->get_property( face, prop_name, aproperty );
-    }
+    if ( service && service->get_property )
+      error = service->get_property( face, prop_name, aproperty );
+    else
+      error = FT_THROW( Invalid_Argument );
 
-    return  error;
+    return error;
   }
 
 
index 84fa322..19a1a80 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility functions for bitmaps (body).                       */
 /*                                                                         */
-/*  Copyright 2004-2009, 2011 by                                           */
+/*  Copyright 2004-2009, 2011, 2013, 2014 by                               */
 /*  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 FT_INTERNAL_DEBUG_H
+
 #include FT_BITMAP_H
 #include FT_IMAGE_H
 #include FT_INTERNAL_OBJECTS_H
@@ -31,7 +33,8 @@
   FT_EXPORT_DEF( void )
   FT_Bitmap_New( FT_Bitmap  *abitmap )
   {
-    *abitmap = null_bitmap;
+    if ( abitmap )
+      *abitmap = null_bitmap;
   }
 
 
                   const FT_Bitmap  *source,
                   FT_Bitmap        *target)
   {
-    FT_Memory  memory = library->memory;
+    FT_Memory  memory;
     FT_Error   error  = FT_Err_Ok;
-    FT_Int     pitch  = source->pitch;
-    FT_ULong   size;
+
+    FT_Int    pitch;
+    FT_ULong  size;
+
+    FT_Int  source_pitch_sign, target_pitch_sign;
 
 
+    if ( !library )
+      return FT_THROW( Invalid_Library_Handle );
+
+    if ( !source || !target )
+      return FT_THROW( Invalid_Argument );
+
     if ( source == target )
       return FT_Err_Ok;
 
+    source_pitch_sign = source->pitch < 0 ? -1 : 1;
+    target_pitch_sign = target->pitch < 0 ? -1 : 1;
+
     if ( source->buffer == NULL )
     {
       *target = *source;
+      if ( source_pitch_sign != target_pitch_sign )
+        target->pitch = -target->pitch;
 
       return FT_Err_Ok;
     }
 
+    memory = library->memory;
+    pitch  = source->pitch;
+
     if ( pitch < 0 )
       pitch = -pitch;
-    size = (FT_ULong)( pitch * source->rows );
+    size = (FT_ULong)pitch * source->rows;
 
     if ( target->buffer )
     {
@@ -68,9 +88,9 @@
       FT_ULong  target_size;
 
 
-      if ( target_pitch < 0  )
+      if ( target_pitch < 0 )
         target_pitch = -target_pitch;
-      target_size = (FT_ULong)( target_pitch * target->rows );
+      target_size = (FT_ULong)target_pitch * target->rows;
 
       if ( target_size != size )
         (void)FT_QREALLOC( target->buffer, target_size, size );
       *target = *source;
       target->buffer = p;
 
-      FT_MEM_COPY( target->buffer, source->buffer, size );
+      if ( source_pitch_sign == target_pitch_sign )
+        FT_MEM_COPY( target->buffer, source->buffer, size );
+      else
+      {
+        /* take care of bitmap flow */
+        FT_UInt   i;
+        FT_Byte*  s = source->buffer;
+        FT_Byte*  t = target->buffer;
+
+
+        t += pitch * ( target->rows - 1 );
+
+        for ( i = target->rows; i > 0; i-- )
+        {
+          FT_ARRAY_COPY( t, s, pitch );
+
+          s += pitch;
+          t -= pitch;
+        }
+      }
     }
 
     return error;
   }
 
 
+  /* Enlarge `bitmap' horizontally and vertically by `xpixels' */
+  /* and `ypixels', respectively.                              */
+
   static FT_Error
   ft_bitmap_assure_buffer( FT_Memory   memory,
                            FT_Bitmap*  bitmap,
     int             pitch;
     int             new_pitch;
     FT_UInt         bpp;
-    FT_Int          i, width, height;
+    FT_UInt         i, width, height;
     unsigned char*  buffer = NULL;
 
 
       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 ( ypixels == 0 && new_pitch <= pitch )
     {
       /* zero the padding */
-      FT_Int  bit_width = pitch * 8;
-      FT_Int  bit_last  = ( width + xpixels ) * bpp;
+      FT_UInt  bit_width = pitch * 8;
+      FT_UInt  bit_last  = ( width + xpixels ) * bpp;
 
 
       if ( bit_last < bit_width )
       {
         FT_Byte*  line  = bitmap->buffer + ( bit_last >> 3 );
         FT_Byte*  end   = bitmap->buffer + pitch;
-        FT_Int    shift = bit_last & 7;
+        FT_UInt   shift = bit_last & 7;
         FT_UInt   mask  = 0xFF00U >> shift;
-        FT_Int    count = height;
+        FT_UInt   count = height;
 
 
         for ( ; count > 0; count--, line += pitch, end += pitch )
             write++;
           }
           if ( write < end )
-            FT_MEM_ZERO( write, end-write );
+            FT_MEM_ZERO( write, end - write );
         }
       }
 
       return FT_Err_Ok;
     }
 
+    /* otherwise allocate new buffer */
     if ( FT_QALLOC_MULT( buffer, new_pitch, bitmap->rows + ypixels ) )
       return error;
 
+    /* new rows get added at the top of the bitmap, */
+    /* thus take care of the flow direction         */
     if ( bitmap->pitch > 0 )
     {
-      FT_Int  len = ( width * bpp + 7 ) >> 3;
+      FT_UInt  len = ( width * bpp + 7 ) >> 3;
 
 
       for ( i = 0; i < bitmap->rows; i++ )
     }
     else
     {
-      FT_Int  len = ( width * bpp + 7 ) >> 3;
+      FT_UInt  len = ( width * bpp + 7 ) >> 3;
 
 
       for ( i = 0; i < bitmap->rows; i++ )
   {
     FT_Error        error;
     unsigned char*  p;
-    FT_Int          i, x, y, pitch;
+    FT_Int          i, x, pitch;
+    FT_UInt         y;
     FT_Int          xstr, ystr;
 
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     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 ) )
-      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 )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     switch ( bitmap->pixel_mode )
     {
     case FT_PIXEL_MODE_GRAY4:
       {
         FT_Bitmap  tmp;
-        FT_Int     align;
-
 
-        if ( bitmap->pixel_mode == FT_PIXEL_MODE_GRAY2 )
-          align = ( bitmap->width + xstr + 3 ) / 4;
-        else
-          align = ( bitmap->width + xstr + 1 ) / 2;
 
+        /* convert to 8bpp */
         FT_Bitmap_New( &tmp );
-
-        error = FT_Bitmap_Convert( library, bitmap, &tmp, align );
+        error = FT_Bitmap_Convert( library, bitmap, &tmp, 1 );
         if ( error )
           return error;
 
     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 );
     if ( error )
       return error;
 
+    /* take care of bitmap flow */
     pitch = bitmap->pitch;
     if ( pitch > 0 )
       p = bitmap->buffer + pitch * ystr;
        */
       for ( x = pitch - 1; x >= 0; x-- )
       {
-        unsigned char tmp;
+        unsigned char  tmp;
 
 
         tmp = p[x];
               p[x] |= p[x - 1] << ( 8 - i );
 
 #if 0
-            if ( p[x] == 0xff )
+            if ( p[x] == 0xFF )
               break;
 #endif
           }
             {
               if ( p[x] + p[x - i] > bitmap->num_grays - 1 )
               {
-                p[x] = (unsigned char)(bitmap->num_grays - 1);
+                p[x] = (unsigned char)( bitmap->num_grays - 1 );
                 break;
               }
               else
               {
-                p[x] = (unsigned char)(p[x] + p[x-i]);
+                p[x] = (unsigned char)( p[x] + p[x - i] );
                 if ( p[x] == bitmap->num_grays - 1 )
                   break;
               }
   }
 
 
+  static FT_Byte
+  ft_gray_for_premultiplied_srgb_bgra( const FT_Byte*  bgra )
+  {
+    FT_UInt  a = bgra[3];
+    FT_UInt  l;
+
+
+    /* Short-circuit transparent color to avoid division by zero. */
+    if ( !a )
+      return 0;
+
+    /*
+     * 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, applying a gamma of 2.0.
+     * We guarantee 32-bit arithmetic to avoid overflow but the resulting
+     * luminosity fits into 16 bits.
+     *
+     */
+
+    l = (  4732UL /* 0.0722 * 65536 */ * bgra[0] * bgra[0] +
+          46871UL /* 0.7152 * 65536 */ * bgra[1] * bgra[1] +
+          13933UL /* 0.2126 * 65536 */ * bgra[2] * bgra[2] ) >> 16;
+
+    /*
+     * Final transparency can be determined as follows.
+     *
+     * - 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) = a - l * a.
+     *
+     * We still need to undo premultiplication by dividing l by a*a.
+     *
+     */
+
+    return (FT_Byte)( a - l / a );
+  }
+
+
   /* documentation is in ftbitmap.h */
 
   FT_EXPORT_DEF( FT_Error )
     FT_Error   error = FT_Err_Ok;
     FT_Memory  memory;
 
+    FT_Byte*  s;
+    FT_Byte*  t;
+
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
+
+    if ( !source || !target )
+      return FT_THROW( Invalid_Argument );
 
     memory = library->memory;
 
     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, old_target_pitch, target_pitch;
+        FT_ULong  old_size;
+
 
+        old_target_pitch = target->pitch;
+        if ( old_target_pitch < 0 )
+          old_target_pitch = -old_target_pitch;
 
-        old_size = target->rows * target->pitch;
-        if ( old_size < 0 )
-          old_size = -old_size;
+        old_size = target->rows * old_target_pitch;
 
         target->pixel_mode = FT_PIXEL_MODE_GRAY;
         target->rows       = source->rows;
             pad = alignment - pad;
         }
 
-        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_Err_Invalid_Argument;
+        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             &&
+        if ( target->rows * target_pitch > old_size               &&
              FT_QREALLOC( target->buffer,
-                          old_size, target->rows * target->pitch ) )
+                          old_size, target->rows * target_pitch ) )
           return error;
+
+        target->pitch = target->pitch < 0 ? -target_pitch : target_pitch;
       }
       break;
 
     default:
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
     }
 
+    s = source->buffer;
+    t = target->buffer;
+
+    /* take care of bitmap flow */
+    if ( source->pitch < 0 )
+      s -= source->pitch * ( source->rows - 1 );
+    if ( target->pitch < 0 )
+      t -= target->pitch * ( target->rows - 1 );
+
     switch ( source->pixel_mode )
     {
     case FT_PIXEL_MODE_MONO:
       {
-        FT_Byte*  s = source->buffer;
-        FT_Byte*  t = target->buffer;
-        FT_Int    i;
+        FT_UInt  i;
 
 
         target->num_grays = 2;
         {
           FT_Byte*  ss = s;
           FT_Byte*  tt = t;
-          FT_Int    j;
+          FT_UInt   j;
 
 
           /* get the full bytes */
     case FT_PIXEL_MODE_LCD:
     case FT_PIXEL_MODE_LCD_V:
       {
-        FT_Int    width   = source->width;
-        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;
+        FT_Int   width = source->width;
+        FT_UInt  i;
 
 
         target->num_grays = 256;
         {
           FT_ARRAY_COPY( t, s, width );
 
-          s += s_pitch;
-          t += t_pitch;
+          s += source->pitch;
+          t += target->pitch;
         }
       }
       break;
 
     case FT_PIXEL_MODE_GRAY2:
       {
-        FT_Byte*  s = source->buffer;
-        FT_Byte*  t = target->buffer;
-        FT_Int    i;
+        FT_UInt  i;
 
 
         target->num_grays = 4;
         {
           FT_Byte*  ss = s;
           FT_Byte*  tt = t;
-          FT_Int    j;
+          FT_UInt   j;
 
 
           /* get the full bytes */
 
     case FT_PIXEL_MODE_GRAY4:
       {
-        FT_Byte*  s = source->buffer;
-        FT_Byte*  t = target->buffer;
-        FT_Int    i;
+        FT_UInt  i;
 
 
         target->num_grays = 16;
         {
           FT_Byte*  ss = s;
           FT_Byte*  tt = t;
-          FT_Int    j;
+          FT_UInt   j;
 
 
           /* get the full bytes */
       break;
 
 
+    case FT_PIXEL_MODE_BGRA:
+      {
+        FT_UInt  i;
+
+
+        target->num_grays = 256;
+
+        for ( i = source->rows; i > 0; i-- )
+        {
+          FT_Byte*  ss = s;
+          FT_Byte*  tt = t;
+          FT_UInt   j;
+
+
+          for ( j = source->width; j > 0; j-- )
+          {
+            tt[0] = ft_gray_for_premultiplied_srgb_bgra( ss );
+
+            ss += 4;
+            tt += 1;
+          }
+
+          s += source->pitch;
+          t += target->pitch;
+        }
+      }
+      break;
+
     default:
       ;
     }
 
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     if ( !bitmap )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     memory = library->memory;
 
index 2aeea04..57f7968 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Arithmetic computations (body).                                      */
 /*                                                                         */
-/*  Copyright 1996-2006, 2008, 2012 by                                     */
+/*  Copyright 1996-2006, 2008, 2012-2014 by                                */
 /*  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_GLYPH_H
+#include FT_TRIGONOMETRY_H
 #include FT_INTERNAL_CALC_H
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_OBJECTS_H
 
-#ifdef FT_MULFIX_INLINED
+
+#ifdef FT_MULFIX_ASSEMBLER
 #undef FT_MulFix
 #endif
 
-/* we need to define a 64-bits data type here */
-
-#ifdef FT_LONG64
-
-  typedef FT_INT64  FT_Int64;
+/* we need to emulate a 64-bit data type if a real one isn't available */
 
-#else
+#ifndef FT_LONG64
 
   typedef struct  FT_Int64_
   {
@@ -57,7 +55,7 @@
 
   } FT_Int64;
 
-#endif /* FT_LONG64 */
+#endif /* !FT_LONG64 */
 
 
   /*************************************************************************/
 #define FT_COMPONENT  trace_calc
 
 
+  /* transfer sign leaving a positive number */
+#define FT_MOVE_SIGN( x, s ) \
+  FT_BEGIN_STMNT             \
+    if ( x < 0 )             \
+    {                        \
+      x = -x;                \
+      s = -s;                \
+    }                        \
+  FT_END_STMNT
+
   /* The following three functions are available regardless of whether */
   /* FT_LONG64 is defined.                                             */
 
@@ -78,8 +86,8 @@
   FT_EXPORT_DEF( FT_Fixed )
   FT_RoundFix( FT_Fixed  a )
   {
-    return ( a >= 0 ) ?   ( a + 0x8000L ) & ~0xFFFFL
-                      : -((-a + 0x8000L ) & ~0xFFFFL );
+    return a >= 0 ?   ( a + 0x8000L ) & ~0xFFFFL
+                  : -((-a + 0x8000L ) & ~0xFFFFL );
   }
 
 
@@ -88,8 +96,8 @@
   FT_EXPORT_DEF( FT_Fixed )
   FT_CeilFix( FT_Fixed  a )
   {
-    return ( a >= 0 ) ?   ( a + 0xFFFFL ) & ~0xFFFFL
-                      : -((-a + 0xFFFFL ) & ~0xFFFFL );
+    return a >= 0 ?   ( a + 0xFFFFL ) & ~0xFFFFL
+                  : -((-a + 0xFFFFL ) & ~0xFFFFL );
   }
 
 
   FT_EXPORT_DEF( FT_Fixed )
   FT_FloorFix( FT_Fixed  a )
   {
-    return ( a >= 0 ) ?   a & ~0xFFFFL
-                      : -((-a) & ~0xFFFFL );
+    return a >= 0 ?   a & ~0xFFFFL
+                  : -((-a) & ~0xFFFFL );
   }
 
+#ifndef FT_MSB
 
-#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 */
 
-  FT_EXPORT_DEF( FT_Int32 )
-  FT_Sqrt32( FT_Int32  x )
-  {
-    FT_UInt32  val, root, newroot, mask;
+    /* determine msb bit index in `shift' */
+    if ( z & 0xFFFF0000UL )
+    {
+      z     >>= 16;
+      shift  += 16;
+    }
+    if ( z & 0x0000FF00UL )
+    {
+      z     >>= 8;
+      shift  += 8;
+    }
+    if ( z & 0x000000F0UL )
+    {
+      z     >>= 4;
+      shift  += 4;
+    }
+    if ( z & 0x0000000CUL )
+    {
+      z     >>= 2;
+      shift  += 2;
+    }
+    if ( z & 0x00000002UL )
+    {
+   /* z     >>= 1; */
+      shift  += 1;
+    }
 
+    return shift;
+  }
 
-    root = 0;
-    mask = (FT_UInt32)0x40000000UL;
-    val  = (FT_UInt32)x;
+#endif /* !FT_MSB */
 
-    do
-    {
-      newroot = root + mask;
-      if ( newroot <= val )
-      {
-        val -= newroot;
-        root = newroot + mask;
-      }
 
-      root >>= 1;
-      mask >>= 2;
+  /* documentation is in ftcalc.h */
 
-    } while ( mask != 0 );
+  FT_BASE_DEF( FT_Fixed )
+  FT_Hypot( FT_Fixed  x,
+            FT_Fixed  y )
+  {
+    FT_Vector  v;
 
-    return root;
-  }
 
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
+    v.x = x;
+    v.y = y;
+
+    return FT_Vector_Length( &v );
+  }
 
 
 #ifdef FT_LONG64
              FT_Long  b,
              FT_Long  c )
   {
-    FT_Int   s;
+    FT_Int   s = 1;
     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; }
+    FT_MOVE_SIGN( a, s );
+    FT_MOVE_SIGN( b, s );
+    FT_MOVE_SIGN( c, s );
 
     d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c
                          : 0x7FFFFFFFL );
 
-    return ( s > 0 ) ? d : -d;
+    return s < 0 ? -d : d;
   }
 
 
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
   /* documentation is in ftcalc.h */
 
   FT_BASE_DEF( FT_Long )
                       FT_Long  b,
                       FT_Long  c )
   {
-    FT_Int   s;
+    FT_Int   s = 1;
     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; }
+    FT_MOVE_SIGN( a, s );
+    FT_MOVE_SIGN( b, s );
+    FT_MOVE_SIGN( c, s );
 
     d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c
                          : 0x7FFFFFFFL );
 
-    return ( s > 0 ) ? d : -d;
+    return s < 0 ? -d : d;
   }
 
-#endif /* TT_USE_BYTECODE_INTERPRETER */
-
 
   /* documentation is in freetype.h */
 
     FT_Long  c;
 
 
-    if ( a < 0 )
-    {
-      a = -a;
-      s = -1;
-    }
-
-    if ( b < 0 )
-    {
-      b = -b;
-      s = -s;
-    }
+    FT_MOVE_SIGN( a, s );
+    FT_MOVE_SIGN( b, s );
 
     c = (FT_Long)( ( (FT_Int64)a * b + 0x8000L ) >> 16 );
 
-    return ( s > 0 ) ? c : -c;
+    return s < 0 ? -c : c;
 
 #endif /* FT_MULFIX_ASSEMBLER */
   }
   FT_DivFix( FT_Long  a,
              FT_Long  b )
   {
-    FT_Int32   s;
-    FT_UInt32  q;
+    FT_Int   s = 1;
+    FT_Long  q;
 
-    s = 1;
-    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 */
-      q = (FT_UInt32)( ( ( (FT_Int64)a << 16 ) + ( b >> 1 ) ) / b );
+    FT_MOVE_SIGN( a, s );
+    FT_MOVE_SIGN( b, s );
 
-    return ( s < 0 ? -(FT_Long)q : (FT_Long)q );
+    q = (FT_Long)( b > 0 ? ( ( (FT_UInt64)a << 16 ) + ( b >> 1 ) ) / b
+                         : 0x7FFFFFFFL );
+
+    return s < 0 ? -q : q;
   }
 
 
     FT_Int     i;
 
 
-    q = 0;
-    r = hi;
-
-    if ( r >= y )
+    if ( hi >= y )
       return (FT_UInt32)0x7FFFFFFFL;
 
-    i = 32;
+    /* We shift as many bits as we can into the high register, perform     */
+    /* 32-bit division with modulo there, then work through the remaining  */
+    /* bits with long division. This optimization is especially noticeable */
+    /* for smaller dividends that barely use the high register.            */
+
+    i = 31 - FT_MSB( hi );
+    r = ( hi << i ) | ( lo >> ( 32 - i ) ); lo <<= i; /* left 64-bit shift */
+    q = r / y;
+    r -= q * y;   /* remainder */
+
+    i = 32 - i;   /* bits remaining in low register */
     do
     {
-      r <<= 1;
       q <<= 1;
-      r  |= lo >> 31;
+      r   = ( r << 1 ) | ( lo >> 31 ); lo <<= 1;
 
       if ( r >= y )
       {
         r -= y;
         q |= 1;
       }
-      lo <<= 1;
     } while ( --i );
 
     return q;
             FT_Int64*  y,
             FT_Int64  *z )
   {
-    register FT_UInt32  lo, hi;
+    FT_UInt32  lo, hi;
 
 
     lo = x->lo + y->lo;
   }
 
 
-  /* documentation is in freetype.h */
-
-  /* The FT_MulDiv function has been optimized thanks to ideas from      */
-  /* Graham Asher.  The trick is to optimize computation when everything */
-  /* fits within 32-bits (a rather common case).                         */
+  /*  The FT_MulDiv function has been optimized thanks to ideas from     */
+  /*  Graham Asher and Alexei Podtelezhnikov.  The trick is to optimize  */
+  /*  a rather common case when everything fits within 32-bits.          */
+  /*                                                                     */
+  /*  We compute 'a*b+c/2', then divide it by 'c' (all positive values). */
+  /*                                                                     */
+  /*  The product of two positive numbers never exceeds the square of    */
+  /*  its mean values.  Therefore, we always avoid the overflow by       */
+  /*  imposing                                                           */
+  /*                                                                     */
+  /*    (a + b) / 2 <= sqrt(X - c/2)    ,                                */
   /*                                                                     */
-  /*  we compute 'a*b+c/2', then divide it by 'c'. (positive values)     */
+  /*  where X = 2^32 - 1, the maximum unsigned 32-bit value, and using   */
+  /*  unsigned arithmetic.  Now we replace `sqrt' with a linear function */
+  /*  that is smaller or equal for all values of c in the interval       */
+  /*  [0;X/2]; it should be equal to sqrt(X) and sqrt(3X/4) at the       */
+  /*  endpoints.  Substituting the linear solution and explicit numbers  */
+  /*  we get                                                             */
   /*                                                                     */
-  /*  46340 is FLOOR(SQRT(2^31-1)).                                      */
+  /*    a + b <= 131071.99 - c / 122291.84    .                          */
   /*                                                                     */
-  /*  if ( a <= 46340 && b <= 46340 ) then ( a*b <= 0x7FFEA810 )         */
+  /*  In practice, we should use a faster and even stronger inequality   */
   /*                                                                     */
-  /*  0x7FFFFFFF - 0x7FFEA810 = 0x157F0                                  */
+  /*    a + b <= 131071 - (c >> 16)                                      */
   /*                                                                     */
-  /*  if ( c < 0x157F0*2 ) then ( a*b+c/2 <= 0x7FFFFFFF )                */
+  /*  or, alternatively,                                                 */
   /*                                                                     */
-  /*  and 2*0x157F0 = 176096                                             */
+  /*    a + b <= 129894 - (c >> 17)    .                                 */
   /*                                                                     */
+  /*  FT_MulFix, on the other hand, is optimized for a small value of    */
+  /*  the first argument, when the second argument can be much larger.   */
+  /*  This can be achieved by scaling the second argument and the limit  */
+  /*  in the above inequalities.  For example,                           */
+  /*                                                                     */
+  /*    a + (b >> 8) <= (131071 >> 4)                                    */
+  /*                                                                     */
+  /*  covers the practical range of use. The actual test below is a bit  */
+  /*  tighter to avoid the border case overflows.                        */
+  /*                                                                     */
+  /*  In the case of FT_DivFix, the exact overflow check                 */
+  /*                                                                     */
+  /*    a << 16 <= X - c/2                                               */
+  /*                                                                     */
+  /*  is scaled down by 2^16 and we use                                  */
+  /*                                                                     */
+  /*    a <= 65535 - (c >> 17)    .                                      */
+
+  /* documentation is in freetype.h */
 
   FT_EXPORT_DEF( FT_Long )
   FT_MulDiv( FT_Long  a,
              FT_Long  b,
              FT_Long  c )
   {
-    long  s;
+    FT_Int  s = 1;
 
 
     /* XXX: this function does not allow 64-bit arguments */
     if ( a == 0 || b == c )
       return a;
 
-    s  = a; a = FT_ABS( a );
-    s ^= b; b = FT_ABS( b );
-    s ^= c; c = FT_ABS( c );
+    FT_MOVE_SIGN( a, s );
+    FT_MOVE_SIGN( b, s );
+    FT_MOVE_SIGN( c, s );
+
+    if ( c == 0 )
+      a = 0x7FFFFFFFL;
 
-    if ( a <= 46340L && b <= 46340L && c <= 176095L && c > 0 )
-      a = ( a * b + ( c >> 1 ) ) / c;
+    else if ( (FT_ULong)a + b <= 129894UL - ( c >> 17 ) )
+      a = ( (FT_ULong)a * b + ( c >> 1 ) ) / c;
 
-    else if ( (FT_Int32)c > 0 )
+    else
     {
       FT_Int64  temp, temp2;
 
 
-      ft_multo64( (FT_Int32)a, (FT_Int32)b, &temp );
+      ft_multo64( a, b, &temp );
 
       temp2.hi = 0;
-      temp2.lo = (FT_UInt32)(c >> 1);
+      temp2.lo = c >> 1;
+
       FT_Add64( &temp, &temp2, &temp );
-      a = ft_div64by32( temp.hi, temp.lo, (FT_Int32)c );
+
+      /* last attempt to ditch long division */
+      a = temp.hi == 0 ? temp.lo / c
+                       : ft_div64by32( temp.hi, temp.lo, c );
     }
-    else
-      a = 0x7FFFFFFFL;
 
-    return ( s < 0 ? -a : a );
+    return s < 0 ? -a : a;
   }
 
 
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
   FT_BASE_DEF( FT_Long )
   FT_MulDiv_No_Round( FT_Long  a,
                       FT_Long  b,
                       FT_Long  c )
   {
-    long  s;
+    FT_Int  s = 1;
 
 
     if ( a == 0 || b == c )
       return a;
 
-    s  = a; a = FT_ABS( a );
-    s ^= b; b = FT_ABS( b );
-    s ^= c; c = FT_ABS( c );
+    FT_MOVE_SIGN( a, s );
+    FT_MOVE_SIGN( b, s );
+    FT_MOVE_SIGN( c, s );
+
+    if ( c == 0 )
+      a = 0x7FFFFFFFL;
 
-    if ( a <= 46340L && b <= 46340L && c > 0 )
-      a = a * b / c;
+    else if ( (FT_ULong)a + b <= 131071UL )
+      a = (FT_ULong)a * b / c;
 
-    else if ( (FT_Int32)c > 0 )
+    else
     {
       FT_Int64  temp;
 
 
-      ft_multo64( (FT_Int32)a, (FT_Int32)b, &temp );
-      a = ft_div64by32( temp.hi, temp.lo, (FT_Int32)c );
+      ft_multo64( a, b, &temp );
+
+      /* last attempt to ditch long division */
+      a = temp.hi == 0 ? temp.lo / c
+                       : ft_div64by32( temp.hi, temp.lo, c );
     }
-    else
-      a = 0x7FFFFFFFL;
 
-    return ( s < 0 ? -a : a );
+    return s < 0 ? -a : a;
   }
 
-#endif /* TT_USE_BYTECODE_INTERPRETER */
-
 
   /* documentation is in freetype.h */
 
     ua = (FT_ULong)a;
     ub = (FT_ULong)b;
 
-    if ( ua <= 2048 && ub <= 1048576L )
+    if ( ua + ( ub >> 8 ) <= 8190UL )
       ua = ( ua * ub + 0x8000U ) >> 16;
     else
     {
 
 #else /* 0 */
 
-    FT_Long   s;
+    FT_Int    s = 1;
     FT_ULong  ua, ub;
 
 
     if ( a == 0 || b == 0x10000L )
       return a;
 
-    s  = a; a = FT_ABS( a );
-    s ^= b; b = FT_ABS( b );
+    FT_MOVE_SIGN( a, s );
+    FT_MOVE_SIGN( b, s );
 
     ua = (FT_ULong)a;
     ub = (FT_ULong)b;
 
-    if ( ua <= 2048 && ub <= 1048576L )
+    if ( ua + ( ub >> 8 ) <= 8190UL )
       ua = ( ua * ub + 0x8000UL ) >> 16;
     else
     {
            ( ( al * ( ub & 0xFFFFUL ) + 0x8000UL ) >> 16 );
     }
 
-    return ( s < 0 ? -(FT_Long)ua : (FT_Long)ua );
+    return s < 0 ? -(FT_Long)ua : (FT_Long)ua;
 
 #endif /* 0 */
 
   FT_DivFix( FT_Long  a,
              FT_Long  b )
   {
-    FT_Int32   s;
-    FT_UInt32  q;
+    FT_Int   s = 1;
+    FT_Long  q;
 
 
     /* XXX: this function does not allow 64-bit arguments */
-    s  = (FT_Int32)a; a = FT_ABS( a );
-    s ^= (FT_Int32)b; b = FT_ABS( b );
 
-    if ( (FT_UInt32)b == 0 )
+    FT_MOVE_SIGN( a, s );
+    FT_MOVE_SIGN( b, s );
+
+    if ( b == 0 )
     {
       /* check for division by 0 */
-      q = (FT_UInt32)0x7FFFFFFFL;
+      q = 0x7FFFFFFFL;
     }
-    else if ( ( a >> 16 ) == 0 )
+    else if ( a <= 65535L - ( b >> 17 ) )
     {
       /* compute result directly */
-      q = (FT_UInt32)( ( a << 16 ) + ( b >> 1 ) ) / (FT_UInt32)b;
+      q = (FT_Long)( ( ( (FT_ULong)a << 16 ) + ( b >> 1 ) ) / b );
     }
     else
     {
       FT_Int64  temp, temp2;
 
 
-      temp.hi  = (FT_Int32) ( a >> 16 );
-      temp.lo  = (FT_UInt32)( a << 16 );
+      temp.hi  = a >> 16;
+      temp.lo  = a << 16;
       temp2.hi = 0;
-      temp2.lo = (FT_UInt32)( b >> 1 );
-      FT_Add64( &temp, &temp2, &temp );
-      q = ft_div64by32( temp.hi, temp.lo, (FT_Int32)b );
-    }
-
-    return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q );
-  }
-
-
-#if 0
-
-  /* documentation is in ftcalc.h */
-
-  FT_EXPORT_DEF( void )
-  FT_MulTo64( FT_Int32   x,
-              FT_Int32   y,
-              FT_Int64  *z )
-  {
-    FT_Int32  s;
-
-
-    s  = x; x = FT_ABS( x );
-    s ^= y; y = FT_ABS( y );
-
-    ft_multo64( x, y, z );
-
-    if ( s < 0 )
-    {
-      z->lo = (FT_UInt32)-(FT_Int32)z->lo;
-      z->hi = ~z->hi + !( z->lo );
-    }
-  }
-
+      temp2.lo = b >> 1;
 
-  /* apparently, the second version of this code is not compiled correctly */
-  /* on Mac machines with the MPW C compiler..  tsk, tsk, tsk...           */
-
-#if 1
-
-  FT_EXPORT_DEF( FT_Int32 )
-  FT_Div64by32( FT_Int64*  x,
-                FT_Int32   y )
-  {
-    FT_Int32   s;
-    FT_UInt32  q, r, i, lo;
-
-
-    s  = x->hi;
-    if ( s < 0 )
-    {
-      x->lo = (FT_UInt32)-(FT_Int32)x->lo;
-      x->hi = ~x->hi + !x->lo;
-    }
-    s ^= y;  y = FT_ABS( y );
-
-    /* Shortcut */
-    if ( x->hi == 0 )
-    {
-      if ( y > 0 )
-        q = x->lo / y;
-      else
-        q = 0x7FFFFFFFL;
-
-      return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q );
-    }
-
-    r  = x->hi;
-    lo = x->lo;
-
-    if ( r >= (FT_UInt32)y ) /* we know y is to be treated as unsigned here */
-      return ( s < 0 ? 0x80000001UL : 0x7FFFFFFFUL );
-                             /* Return Max/Min Int32 if division overflow. */
-                             /* This includes division by zero!            */
-    q = 0;
-    for ( i = 0; i < 32; i++ )
-    {
-      r <<= 1;
-      q <<= 1;
-      r  |= lo >> 31;
-
-      if ( r >= (FT_UInt32)y )
-      {
-        r -= y;
-        q |= 1;
-      }
-      lo <<= 1;
-    }
-
-    return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q );
-  }
-
-#else /* 0 */
-
-  FT_EXPORT_DEF( FT_Int32 )
-  FT_Div64by32( FT_Int64*  x,
-                FT_Int32   y )
-  {
-    FT_Int32   s;
-    FT_UInt32  q;
-
-
-    s  = x->hi;
-    if ( s < 0 )
-    {
-      x->lo = (FT_UInt32)-(FT_Int32)x->lo;
-      x->hi = ~x->hi + !x->lo;
-    }
-    s ^= y;  y = FT_ABS( y );
-
-    /* Shortcut */
-    if ( x->hi == 0 )
-    {
-      if ( y > 0 )
-        q = ( x->lo + ( y >> 1 ) ) / y;
-      else
-        q = 0x7FFFFFFFL;
-
-      return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q );
+      FT_Add64( &temp, &temp2, &temp );
+      q = (FT_Long)ft_div64by32( temp.hi, temp.lo, b );
     }
 
-    q = ft_div64by32( x->hi, x->lo, y );
-
-    return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q );
+    return s < 0 ? -q : q;
   }
 
-#endif /* 0 */
-
-#endif /* 0 */
-
 
 #endif /* FT_LONG64 */
 
 
 
     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 )
-      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 );
   }
 
 
+#if 0
+
   /* documentation is in ftcalc.h */
 
   FT_BASE_DEF( FT_Int32 )
     return (FT_Int32)root;
   }
 
+#endif /* 0 */
+
 
   /* documentation is in ftcalc.h */
 
                      FT_Pos  out_x,
                      FT_Pos  out_y )
   {
-    FT_Pos  ax = in_x;
-    FT_Pos  ay = in_y;
-
-    FT_Pos  d_in, d_out, d_corner;
-
-
-    if ( ax < 0 )
-      ax = -ax;
-    if ( ay < 0 )
-      ay = -ay;
-    d_in = ax + ay;
-
-    ax = out_x;
-    if ( ax < 0 )
-      ax = -ax;
-    ay = out_y;
-    if ( ay < 0 )
-      ay = -ay;
-    d_out = ax + ay;
-
-    ax = out_x + in_x;
-    if ( ax < 0 )
-      ax = -ax;
-    ay = out_y + in_y;
-    if ( ay < 0 )
-      ay = -ay;
-    d_corner = ax + ay;
-
-    return ( d_in + d_out - d_corner ) < ( d_corner >> 4 );
+    FT_Pos  ax = in_x + out_x;
+    FT_Pos  ay = in_y + out_y;
+
+    FT_Pos  d_in, d_out, d_hypot;
+
+
+    /* The idea of this function is to compare the length of the */
+    /* hypotenuse with the `in' and `out' length.  The `corner'  */
+    /* represented by `in' and `out' is flat if the hypotenuse's */
+    /* length isn't too large.                                   */
+    /*                                                           */
+    /* This approach has the advantage that the angle between    */
+    /* `in' and `out' is not checked.  In case one of the two    */
+    /* vectors is `dominant', this is, much larger than the      */
+    /* other vector, we thus always have a flat corner.          */
+    /*                                                           */
+    /*                hypotenuse                                 */
+    /*       x---------------------------x                       */
+    /*        \                      /                           */
+    /*         \                /                                */
+    /*      in  \          /  out                                */
+    /*           \    /                                          */
+    /*            o                                              */
+    /*              Point                                        */
+
+    d_in    = FT_HYPOT(  in_x,  in_y );
+    d_out   = FT_HYPOT( out_x, out_y );
+    d_hypot = FT_HYPOT(    ax,    ay );
+
+    /* now do a simple length comparison: */
+    /*                                    */
+    /*   d_in + d_out < 17/16 d_hypot     */
+
+    return ( d_in + d_out - d_hypot ) < ( d_hypot >> 4 );
   }
 
 
index 733aae1..741879d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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      */
@@ -35,7 +35,7 @@
     FT_Int       s = 0;
 
 
-    error = FT_Err_Invalid_Argument;
+    error = FT_ERR( Invalid_Argument );
 
     if ( face )
     {
@@ -65,7 +65,7 @@
   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;
 
 
@@ -92,7 +92,7 @@
                                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;
 
 
index 12fed04..6fb86fe 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
   ft_mem_table_destroy( FT_MemTable  table )
   {
     FT_ULong  i;
+    FT_Long   leak_count = 0;
+    FT_ULong  leaks      = 0;
 
 
     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..39ac6ad 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -51,7 +51,8 @@
   /* documentation is in ftdebug.h */
 
   FT_BASE_DEF( void )
-  FT_Message( const char*  fmt, ... )
+  FT_Message( const char*  fmt,
+              ... )
   {
     va_list  ap;
 
@@ -65,7 +66,8 @@
   /* documentation is in ftdebug.h */
 
   FT_BASE_DEF( void )
-  FT_Panic( const char*  fmt, ... )
+  FT_Panic( const char*  fmt,
+            ... )
   {
     va_list  ap;
 
     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 */
 
 
   /* the memory and stream components which are set to 7 and 5,            */
   /* respectively.                                                         */
   /*                                                                       */
-  /* See the file <include/freetype/internal/fttrace.h> for details of the */
+  /* See the file <include/internal/fttrace.h> for details of the          */
   /* available toggle names.                                               */
   /*                                                                       */
   /* The level must be between 0 and 7; 0 means quiet (except for serious  */
         while ( *p && *p != ':' )
           p++;
 
+        if ( !*p )
+          break;
+
         if ( *p == ':' && p > q )
         {
           FT_Int  n, i, len = (FT_Int)( p - q );
           p++;
           if ( *p )
           {
-            level = *p++ - '0';
+            level = *p - '0';
             if ( level < 0 || level > 7 )
               level = -1;
           }
index d0ef7b7..6b49ef8 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility file to access FSType data (body).                  */
 /*                                                                         */
-/*  Copyright 2008, 2009 by                                                */
+/*  Copyright 2008, 2009, 2014 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -51,7 +51,7 @@
 
     /* look at FSType before fsType for Type42 */
 
-    if ( ( os2 = (TT_OS2*)FT_Get_Sfnt_Table( face, ft_sfnt_os2 ) ) != NULL &&
+    if ( ( os2 = (TT_OS2*)FT_Get_Sfnt_Table( face, FT_SFNT_OS2 ) ) != NULL &&
          os2->version != 0xFFFFU                                           )
       return os2->fsType;
 
index 8483450..3cc5c7a 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -17,6 +17,7 @@
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_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 )
-        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 ) )
       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;
       FT_GlyphLoader_Adjust_Points( loader );
 
   Exit:
+    if ( error )
+      FT_GlyphLoader_Reset( loader );
+
     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 )
   {
index 591b57a..ac178c4 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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-2014 by                    */
 /*  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 FT_INTERNAL_DEBUG_H
+
 #include FT_GLYPH_H
 #include FT_OUTLINE_H
 #include FT_BITMAP_H
@@ -65,7 +67,7 @@
 
     if ( slot->format != FT_GLYPH_FORMAT_BITMAP )
     {
-      error = FT_Err_Invalid_Glyph_Format;
+      error = FT_THROW( Invalid_Glyph_Format );
       goto Exit;
     }
 
     /* 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;
     }
 
 
 
     /* check arguments */
-    if ( !target )
+    if ( !target || !source || !source->clazz )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
-    *target = 0;
+    *target = NULL;
 
     if ( !source || !source->clazz )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     FT_Error    error;
     FT_Glyph    glyph;
 
-    const FT_Glyph_Class*  clazz = 0;
+    const FT_Glyph_Class*  clazz = NULL;
 
 
     if ( !slot )
-      return FT_Err_Invalid_Slot_Handle;
+      return FT_THROW( Invalid_Slot_Handle );
 
     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 ( !clazz )
     {
-      error = FT_Err_Invalid_Glyph_Format;
+      error = FT_THROW( Invalid_Glyph_Format );
       goto Exit;
     }
 
                       FT_Matrix*  matrix,
                       FT_Vector*  delta )
   {
-    const FT_Glyph_Class*  clazz;
-    FT_Error               error = FT_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     if ( !glyph || !glyph->clazz )
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
     else
     {
-      clazz = glyph->clazz;
+      const FT_Glyph_Class*  clazz = glyph->clazz;
+
+
       if ( clazz->glyph_transform )
       {
         /* transform glyph image */
           FT_Vector_Transform( &glyph->advance, matrix );
       }
       else
-        error = FT_Err_Invalid_Glyph_Format;
+        error = FT_THROW( Invalid_Glyph_Format );
     }
     return error;
   }
 
     if ( !glyph || !glyph->clazz )
       return;
-    else
+
+    clazz = glyph->clazz;
+    if ( !clazz->glyph_bbox )
+      return;
+
+    /* retrieve bbox in 26.6 coordinates */
+    clazz->glyph_bbox( glyph, acbox );
+
+    /* perform grid fitting if needed */
+    if ( bbox_mode == FT_GLYPH_BBOX_GRIDFIT ||
+         bbox_mode == FT_GLYPH_BBOX_PIXELS  )
     {
-      clazz = glyph->clazz;
-      if ( !clazz->glyph_bbox )
-        return;
-      else
-      {
-        /* retrieve bbox in 26.6 coordinates */
-        clazz->glyph_bbox( glyph, acbox );
-
-        /* perform grid fitting if needed */
-        if ( bbox_mode == FT_GLYPH_BBOX_GRIDFIT ||
-             bbox_mode == FT_GLYPH_BBOX_PIXELS  )
-        {
-          acbox->xMin = FT_PIX_FLOOR( acbox->xMin );
-          acbox->yMin = FT_PIX_FLOOR( acbox->yMin );
-          acbox->xMax = FT_PIX_CEIL( acbox->xMax );
-          acbox->yMax = FT_PIX_CEIL( acbox->yMax );
-        }
-
-        /* convert to integer pixels if needed */
-        if ( bbox_mode == FT_GLYPH_BBOX_TRUNCATE ||
-             bbox_mode == FT_GLYPH_BBOX_PIXELS   )
-        {
-          acbox->xMin >>= 6;
-          acbox->yMin >>= 6;
-          acbox->xMax >>= 6;
-          acbox->yMax >>= 6;
-        }
-      }
+      acbox->xMin = FT_PIX_FLOOR( acbox->xMin );
+      acbox->yMin = FT_PIX_FLOOR( acbox->yMin );
+      acbox->xMax = FT_PIX_CEIL( acbox->xMax );
+      acbox->yMax = FT_PIX_CEIL( acbox->yMax );
+    }
+
+    /* convert to integer pixels if needed */
+    if ( bbox_mode == FT_GLYPH_BBOX_TRUNCATE ||
+         bbox_mode == FT_GLYPH_BBOX_PIXELS   )
+    {
+      acbox->xMin >>= 6;
+      acbox->yMin >>= 6;
+      acbox->xMax >>= 6;
+      acbox->yMax >>= 6;
     }
-    return;
   }
 
 
     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;
     const FT_Glyph_Class*     clazz;
 
-    /* FT_BITMAP_GLYPH_CLASS_GET derefers `library' in PIC mode */
+    /* FT_BITMAP_GLYPH_CLASS_GET dereferences `library' in PIC mode */
     FT_Library                library;
 
 
     dummy.format   = clazz->glyph_format;
 
     /* create result bitmap glyph */
-    error = ft_new_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;
+    bitmap = (FT_BitmapGlyph)b;
 
 #if 1
     /* if `origin' is set, translate the glyph image */
     return error;
 
   Bad:
-    error = FT_Err_Invalid_Argument;
+    error = FT_THROW( Invalid_Argument );
     goto Exit;
   }
 
index aeeb8ce..a65f4c8 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for validating TrueTyepGX/AAT tables (body).            */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2010 by                                    */
+/*  Copyright 2004-2006, 2010, 2013, 2014 by                               */
 /*  Masatake YAMATO, Redhat K.K,                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
@@ -26,6 +26,8 @@
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_GX_VALIDATE_H
 
 
     if ( !face )
     {
-      error = FT_Err_Invalid_Face_Handle;
+      error = FT_THROW( Invalid_Face_Handle );
       goto Exit;
     }
 
-    if ( tables == NULL )
+    if ( !tables )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
@@ -62,7 +64,7 @@
                                  tables,
                                  table_length );
     else
-      error = FT_Err_Unimplemented_Feature;
+      error = FT_THROW( Unimplemented_Feature );
 
   Exit:
     return error;
 
     if ( !face )
     {
-      error = FT_Err_Invalid_Face_Handle;
+      error = FT_THROW( Invalid_Face_Handle );
       goto Exit;
     }
 
-    if ( ckern_table == NULL )
+    if ( !ckern_table )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
                                  validation_flags,
                                  ckern_table );
     else
-      error = FT_Err_Unimplemented_Feature;
+      error = FT_THROW( Unimplemented_Feature );
 
   Exit:
     return error;
index 91f8e2a..c4c8820 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType initialization layer (body).                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2005, 2007, 2009, 2012 by                   */
+/*  Copyright 1996-2002, 2005, 2007, 2009, 2012-2014 by                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -23,8 +23,8 @@
   /*  FT_Add_Default_Modules():                                            */
   /*     This function is used to add the set of default modules to a      */
   /*     fresh new library object.  The set is taken from the header file  */
-  /*     `freetype/config/ftmodule.h'.  See the document `FreeType 2.0     */
-  /*     Build System' for more information.                               */
+  /*     `config/ftmodule.h'.  See the document `FreeType 2.0 Build        */
+  /*     System' for more information.                                     */
   /*                                                                       */
   /*  FT_Init_FreeType():                                                  */
   /*     This function creates a system object for the current platform,   */
   {
     FT_Error           error;
     FT_Memory          memory;
-    FT_Module_Class*  *classes;
+    FT_Module_Class*  *classes = NULL;
     FT_Module_Class*   clazz;
     FT_UInt            i;
     BasePIC*           pic_container = (BasePIC*)library->pic_container.base;
 
     pic_container->default_module_classes = 0;
 
-    if ( FT_ALLOC( classes, sizeof ( FT_Module_Class* ) * 
+    if ( FT_ALLOC( classes, sizeof ( FT_Module_Class* ) *
                               ( FT_NUM_MODULE_CLASSES + 1 ) ) )
       return error;
 
     FT_Memory  memory;
 
 
+    /* check of `alibrary' delayed to `FT_New_Library' */
+
     /* First of all, allocate a new system object -- this function is part */
     /* of the system-specific component, i.e. `ftsystem.c'.                */
 
     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 */
   FT_EXPORT_DEF( FT_Error )
   FT_Done_FreeType( FT_Library  library )
   {
-    if ( library )
-    {
-      FT_Memory  memory = library->memory;
+    FT_Memory  memory;
+
 
+    if ( !library )
+      return FT_THROW( Invalid_Library_Handle );
 
-      /* Discard the library object */
-      FT_Done_Library( library );
+    memory = library->memory;
 
-      /* discard memory manager */
-      FT_Done_Memory( memory );
-    }
+    /* Discard the library object */
+    FT_Done_Library( library );
+
+    /* discard memory manager */
+    FT_Done_Memory( memory );
 
     return FT_Err_Ok;
   }
index 0da4ba1..d8bcbbf 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for color filtering of subpixel bitmap glyphs (body).   */
 /*                                                                         */
-/*  Copyright 2006, 2008, 2009, 2010 by                                    */
+/*  Copyright 2006, 2008-2010, 2013, 2014 by                               */
 /*  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 FT_INTERNAL_DEBUG_H
+
 #include FT_LCD_FILTER_H
 #include FT_IMAGE_H
 #include FT_INTERNAL_OBJECTS_H
       FT_Byte*  line = bitmap->buffer;
 
 
+      /* take care of bitmap flow */
+      if ( bitmap->pitch < 0 )
+        line -= bitmap->pitch * ( bitmap->rows - 1 );
+
+      /* `fir' and `pix' must be at least 32 bit wide, since the sum of */
+      /* the values in `weights' can exceed 0xFF                        */
+
       for ( ; height > 0; height--, line += bitmap->pitch )
       {
-        FT_UInt  fir[5];
+        FT_UInt  fir[4];        /* below, `pix' is used as the 5th element */
         FT_UInt  val1, xx;
 
 
@@ -55,7 +64,6 @@
         fir[1] = weights[3] * val1;
         fir[2] = weights[4] * val1;
         fir[3] = 0;
-        fir[4] = 0;
 
         val1    = line[1];
         fir[0] += weights[1] * val1;
@@ -76,7 +84,7 @@
           fir[3] =          weights[4] * val;
 
           pix        >>= 8;
-          pix         |= -( pix >> 8 );
+          pix         |= (FT_UInt)-(FT_Int)( pix >> 8 );
           line[xx - 2] = (FT_Byte)pix;
         }
 
 
 
           pix          = fir[0] >> 8;
-          pix         |= -( pix >> 8 );
+          pix         |= (FT_UInt)-(FT_Int)( pix >> 8 );
           line[xx - 2] = (FT_Byte)pix;
 
           pix          = fir[1] >> 8;
-          pix         |= -( pix >> 8 );
+          pix         |= (FT_UInt)-(FT_Int)( pix >> 8 );
           line[xx - 1] = (FT_Byte)pix;
         }
       }
       FT_Int    pitch  = bitmap->pitch;
 
 
+      /* take care of bitmap flow */
+      if ( bitmap->pitch < 0 )
+        column -= bitmap->pitch * ( bitmap->rows - 1 );
+
       for ( ; width > 0; width--, column++ )
       {
         FT_Byte*  col = column;
-        FT_UInt   fir[5];
+        FT_UInt   fir[4];       /* below, `pix' is used as the 5th element */
         FT_UInt   val1, yy;
 
 
         fir[1] = weights[3] * val1;
         fir[2] = weights[4] * val1;
         fir[3] = 0;
-        fir[4] = 0;
         col   += pitch;
 
         val1    = col[0];
           fir[3] =          weights[4] * val;
 
           pix           >>= 8;
-          pix            |= -( pix >> 8 );
+          pix            |= (FT_UInt)-(FT_Int)( pix >> 8 );
           col[-2 * pitch] = (FT_Byte)pix;
           col            += pitch;
         }
 
 
           pix             = fir[0] >> 8;
-          pix            |= -( pix >> 8 );
+          pix            |= (FT_UInt)-(FT_Int)( pix >> 8 );
           col[-2 * pitch] = (FT_Byte)pix;
 
           pix         = fir[1] >> 8;
-          pix        |= -( pix >> 8 );
+          pix        |= (FT_UInt)-(FT_Int)( pix >> 8 );
           col[-pitch] = (FT_Byte)pix;
         }
       }
       FT_Byte*  line = bitmap->buffer;
 
 
+      /* take care of bitmap flow */
+      if ( bitmap->pitch < 0 )
+        line -= bitmap->pitch * ( bitmap->rows - 1 );
+
       for ( ; height > 0; height--, line += pitch )
       {
         FT_UInt  xx;
       FT_Byte*  column = bitmap->buffer;
 
 
+      /* take care of bitmap flow */
+      if ( bitmap->pitch < 0 )
+        column -= bitmap->pitch * ( bitmap->rows - 1 );
+
       for ( ; width > 0; width--, column++ )
       {
         FT_Byte*  col     = column;
   FT_Library_SetLcdFilterWeights( FT_Library      library,
                                   unsigned char  *weights )
   {
-    if ( !library || !weights )
-      return FT_Err_Invalid_Argument;
+    if ( !library )
+      return FT_THROW( Invalid_Library_Handle );
+
+    if ( !weights )
+      return FT_THROW( Invalid_Argument );
 
     ft_memcpy( library->lcd_weights, weights, 5 );
 
 
 
     if ( !library )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Library_Handle );
 
     switch ( filter )
     {
 #endif
 
     default:
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
     }
 
     library->lcd_filter = filter;
     FT_UNUSED( library );
     FT_UNUSED( weights );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
   }
 
 
     FT_UNUSED( library );
     FT_UNUSED( filter );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
   }
 
 #endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
index f200748..5301ab4 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.                                        */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,         */
-/*            2009 by                                                      */
+/*  Copyright 1996-2009, 2013, 2014 by                                     */
 /*  Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.     */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
     FT_UNUSED( pathSpec );
     FT_UNUSED( face_index );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
   }
 
 
     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 ) )
-      return FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     /* face_index calculation by searching preceding fontIDs */
     /* with same FSRef                                       */
     FT_Error  err;
 
 
+    if ( !fontName || !face_index )
+      return FT_THROW( Invalid_Argument) ;
+
     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 FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     return FT_Err_Ok;
   }
     FT_UNUSED( pathSpec );
     FT_UNUSED( face_index );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
 #else
     FSRef     ref;
     FT_Error  err;
 
 
+    if ( !fontName || !face_index )
+      return FT_THROW( Invalid_Argument );
+
     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 FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     return FT_Err_Ok;
 #endif
 
 
     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 );
   count_faces_scalable( char*  fond_data )
   {
     AsscEntry*  assoc;
-    FamRec*     fond;
     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 );
       style = (StyleTable*)p;
       p += sizeof ( StyleTable );
       string_count = EndianS16_BtoN( *(short*)(p) );
+      string_count = FT_MIN( 64, string_count );
       p += sizeof ( short );
 
-      for ( i = 0; i < string_count && i < 64; i++ )
+      for ( i = 0; i < string_count; i++ )
       {
         names[i] = p;
         p       += names[i][0];
           ps_name[ps_name_len] = 0;
         }
         if ( style->indexes[face_index] > 1 &&
-             style->indexes[face_index] <= FT_MIN( string_count, 64 ) )
+             style->indexes[face_index] <= string_count )
         {
           unsigned char*  suffixes = names[style->indexes[face_index] - 1];
 
     /* 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 ) )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     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 )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     /* 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 ) )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     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;
   }
     {
       err = lookup_lwfn_by_fond( pathname, lwfn_file_name,
                                  buff, sizeof ( buff )  );
-      if ( FT_Err_Ok == err )
+      if ( !err )
         have_lwfn = 1;
     }
 
       /* detect integer overflows */
       if ( total_size < old_total_size )
       {
-        error = FT_Err_Array_Too_Large;
+        error = FT_THROW( Array_Too_Large );
         goto Error;
       }
 
 
 
     if ( noErr != FT_FSPathMakeRes( pathname, &res ) )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     pfb_data = NULL;
     pfb_size = 0;
 
     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 ) )
                              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;
-    short          num_faces_in_res, num_faces_in_fond;
+    short          num_faces_in_res;
 
 
     if ( noErr != FT_FSPathMakeRes( pathname, &res_ref ) )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     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 )
     {
+      short  num_faces_in_fond;
+
+
       fond = Get1IndResource( TTAG_FOND, res_index );
       if ( ResError() )
         break;
     }
 
     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;
   }
     FT_Error  error = FT_Err_Ok;
 
 
+    /* check of `library' and `aface' delayed to `FT_New_Face_From_XXX' */
+
     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 );
 
 
         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;
       }
     }
                                      face_index,
                                      aface );
     else
-      error = FT_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
 
   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,
 
     /* 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;
 
     /* try resourcefork based font: LWFN, FFIL */
   {
     FT_Error      error;
     FT_Open_Args  args;
-    OSErr   err;
-    UInt8   pathname[PATH_MAX];
 
+    OSErr  err;
+    UInt8  pathname[PATH_MAX];
+
+
+    /* check of `library' and `aface' delayed to */
+    /* `FT_New_Face_From_Resource'               */
 
     if ( !ref )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     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 )
     FT_UNUSED( face_index );
     FT_UNUSED( aface );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
 #else
     FSRef  ref;
 
 
+    /* check of `library' and `aface' delayed to `FT_New_Face_From_FSRef' */
+
     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
index 0307729..056680b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Multiple Master font support (body).                                 */
 /*                                                                         */
-/*  Copyright 1996-2001, 2003, 2004, 2009 by                               */
+/*  Copyright 1996-2001, 2003, 2004, 2009, 2013, 2014 by                   */
 /*  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 FT_INTERNAL_DEBUG_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 )
-      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 ) )
     {
     FT_Service_MultiMasters  service;
 
 
+    /* check of `face' delayed to `ft_face_get_mm_service' */
+
+    if ( !amaster )
+      return FT_THROW( Invalid_Argument );
+
     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 );
     }
     FT_Service_MultiMasters  service;
 
 
+    /* check of `face' delayed to `ft_face_get_mm_service' */
+
+    if ( !amaster )
+      return FT_THROW( Invalid_Argument );
+
     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 );
     }
     FT_Service_MultiMasters  service;
 
 
+    /* check of `face' delayed to `ft_face_get_mm_service' */
+
+    if ( !coords )
+      return FT_THROW( Invalid_Argument );
+
     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 );
     }
     FT_Service_MultiMasters  service;
 
 
+    /* check of `face' delayed to `ft_face_get_mm_service' */
+
+    if ( !coords )
+      return FT_THROW( Invalid_Argument );
+
     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 );
     }
     FT_Service_MultiMasters  service;
 
 
+    /* check of `face' delayed to `ft_face_get_mm_service' */
+
+    if ( !coords )
+      return FT_THROW( Invalid_Argument );
+
     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 );
     }
     FT_Service_MultiMasters  service;
 
 
+    /* check of `face' delayed to `ft_face_get_mm_service' */
+
+    if ( !coords )
+      return FT_THROW( Invalid_Argument );
+
     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 );
     }
index 36ee797..ee15a01 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType private base classes (body).                            */
 /*                                                                         */
-/*  Copyright 1996-2012 by                                                 */
+/*  Copyright 1996-2014 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -29,6 +29,7 @@
 #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 "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 */
+#include "md5.c"
+
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
+
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
+
 #define GRID_FIT_METRICS
 
 
     *astream = 0;
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     if ( !args )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     memory = library->memory;
 
 #endif
 
     else
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
 
     if ( error )
       FT_FREE( stream );
     FT_GlyphSlot     slot = NULL;
 
 
-    if ( !face || !face->driver )
-      return FT_Err_Invalid_Argument;
+    if ( !face )
+      return FT_THROW( Invalid_Face_Handle );
+
+    if ( !face->driver )
+      return FT_THROW( Invalid_Argument );
 
     driver = face->driver;
     clazz  = driver->clazz;
       internal->transform_matrix.xy = 0;
       internal->transform_matrix.yx = 0;
       internal->transform_matrix.yy = 0x10000L;
+
       matrix = &internal->transform_matrix;
     }
     else
     {
       internal->transform_delta.x = 0;
       internal->transform_delta.y = 0;
+
       delta = &internal->transform_delta;
     }
     else
 
 
     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 check for `num_locations' assures that we actually    */
         /* test for instructions in a TTF and not in a CFF-based OTF */
+        /*                                                           */
+        /* since `maxSizeOfInstructions' might be unreliable, we     */
+        /* check the size of the `fpgm' and `prep' tables, too --    */
+        /* the assumption is that there don't exist real TTFs where  */
+        /* both `fpgm' and `prep' tables are missing                 */
         if ( mode == FT_RENDER_MODE_LIGHT                       ||
              face->internal->ignore_unpatented_hinter           ||
              ( FT_IS_SFNT( face )                             &&
                ttface->num_locations                          &&
-               ttface->max_profile.maxSizeOfInstructions == 0 ) )
+               ttface->max_profile.maxSizeOfInstructions == 0 &&
+               ttface->font_program_size == 0                 &&
+               ttface->cvt_program_size == 0                  ) )
           autohint = TRUE;
       }
     }
 
     if ( autohint )
     {
-      FT_AutoHinter_Service  hinting;
+      FT_AutoHinter_Interface  hinting;
 
 
       /* try to load embedded bitmaps first if available            */
         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,
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     glyph_index = (FT_UInt)char_code;
     if ( face->charmap )
     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
              ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE &&
                cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32    ) )
         {
-#ifdef FT_MAX_CHARMAP_CACHEABLE
-          if ( cur - first > FT_MAX_CHARMAP_CACHEABLE )
-          {
-            FT_ERROR(( "find_unicode_charmap: UCS-4 cmap is found "
-                       "at too late position (%d)\n", cur - first ));
-            continue;
-          }
-#endif
           face->charmap = cur[0];
           return FT_Err_Ok;
         }
     {
       if ( cur[0]->encoding == FT_ENCODING_UNICODE )
       {
-#ifdef FT_MAX_CHARMAP_CACHEABLE
-        if ( cur - first > FT_MAX_CHARMAP_CACHEABLE )
-        {
-          FT_ERROR(( "find_unicode_charmap: UCS-2 cmap is found "
-                     "at too late position (%d)\n", cur - first ));
-          continue;
-        }
-#endif
         face->charmap = cur[0];
         return FT_Err_Ok;
       }
     }
 
-    return FT_Err_Invalid_CharMap_Handle;
+    return FT_THROW( Invalid_CharMap_Handle );
   }
 
 
       if ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE    &&
            cur[0]->encoding_id == TT_APPLE_ID_VARIANT_SELECTOR &&
            FT_Get_CMap_Format( cur[0] ) == 14                  )
-      {
-#ifdef FT_MAX_CHARMAP_CACHEABLE
-        if ( cur - first > FT_MAX_CHARMAP_CACHEABLE )
-        {
-          FT_ERROR(( "find_unicode_charmap: UVS cmap is found "
-                     "at too late position (%d)\n", cur - first ));
-          continue;
-        }
-#endif
         return cur[0];
-      }
     }
 
     return NULL;
   /*                                                                       */
   static FT_Error
   open_face( FT_Driver      driver,
-             FT_Stream      stream,
+             FT_Stream      *astream,
+             FT_Bool        external_stream,
              FT_Long        face_index,
              FT_Int         num_params,
              FT_Parameter*  params,
   {
     FT_Memory         memory;
     FT_Driver_Class   clazz;
-    FT_Face           face = 0;
-    FT_Error          error, error2;
+    FT_Face           face     = NULL;
     FT_Face_Internal  internal = NULL;
 
+    FT_Error          error, error2;
+
 
     clazz  = driver->clazz;
     memory = driver->root.memory;
     if ( FT_ALLOC( face, clazz->face_object_size ) )
       goto Fail;
 
+    face->driver = driver;
+    face->memory = memory;
+    face->stream = *astream;
+
+    /* set the FT_FACE_FLAG_EXTERNAL_STREAM bit for FT_Done_Face */
+    if ( external_stream )
+      face->face_flags |= FT_FACE_FLAG_EXTERNAL_STREAM;
+
     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;
 #endif
 
     if ( clazz->init_face )
-      error = clazz->init_face( stream,
+      error = clazz->init_face( *astream,
                                 face,
                                 (FT_Int)face_index,
                                 num_params,
                                 params );
+    *astream = face->stream; /* Stream may have been changed. */
     if ( error )
       goto Fail;
 
     /* 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;
     FT_Open_Args  args;
 
 
-    /* test for valid `library' and `aface' delayed to FT_Open_Face() */
+    /* 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;
     FT_Open_Args  args;
 
 
-    /* test for valid `library' and `face' delayed to FT_Open_Face() */
+    /* 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;
 
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     if ( !base )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     *astream = 0;
     memory = library->memory;
     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 ( face_index >= 0 && pstable_index == face_index )
         return FT_Err_Ok;
     }
-    return FT_Err_Table_Missing;
+    return FT_THROW( Table_Missing );
   }
 
 
     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:
       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 )
                           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_Byte*   pfb_data = NULL;
     int        i, type, flags;
-    FT_Long    len;
-    FT_Long    pfb_len, pfb_pos, pfb_lenpos;
-    FT_Long    rlen, temp;
+    FT_ULong   len;
+    FT_ULong   pfb_len, pfb_pos, pfb_lenpos;
+    FT_ULong   rlen, temp;
 
 
     if ( face_index == -1 )
       error = FT_Stream_Seek( stream, offsets[i] );
       if ( error )
         goto Exit;
-      if ( FT_READ_LONG( temp ) )
+      if ( FT_READ_ULONG( temp ) )
+        goto Exit;
+
+      /* FT2 allocator takes signed long buffer length,
+       * too large value causing overflow should be checked
+       */
+      FT_TRACE4(( "                 POST fragment #%d: length=0x%08x\n",
+                  i, temp));
+      if ( 0x7FFFFFFFUL < temp || pfb_len + temp + 6 < pfb_len )
+      {
+        FT_TRACE2(( "             too long fragment length makes"
+                    " pfb_len confused: temp=0x%08x\n", temp ));
+        error = FT_THROW( Invalid_Offset );
         goto Exit;
+      }
+
       pfb_len += temp + 6;
     }
 
+    FT_TRACE2(( "             total buffer size to concatenate %d"
+                " POST fragments: 0x%08x\n",
+                 resource_cnt, pfb_len + 2));
+    if ( pfb_len + 2 < 6 ) {
+      FT_TRACE2(( "             too long fragment length makes"
+                  " pfb_len confused: pfb_len=0x%08x\n", pfb_len ));
+      error = FT_THROW( Array_Too_Large );
+      goto Exit;
+    }
     if ( FT_ALLOC( pfb_data, (FT_Long)pfb_len + 2 ) )
       goto Exit;
 
       error = FT_Stream_Seek( stream, offsets[i] );
       if ( error )
         goto Exit2;
-      if ( FT_READ_LONG( rlen ) )
-        goto Exit;
+      if ( FT_READ_ULONG( rlen ) )
+        goto Exit2;
+
+      /* FT2 allocator takes signed long buffer length,
+       * too large fragment length causing overflow should be checked
+       */
+      if ( 0x7FFFFFFFUL < rlen )
+      {
+        error = FT_THROW( Invalid_Offset );
+        goto Exit2;
+      }
+
       if ( FT_READ_USHORT( flags ) )
-        goto Exit;
+        goto Exit2;
       FT_TRACE3(( "POST fragment[%d]: offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n",
                    i, offsets[i], rlen, flags ));
 
+      error = FT_ERR( Array_Too_Large );
       /* postpone the check of rlen longer than buffer until FT_Stream_Read() */
       if ( ( flags >> 8 ) == 0 )        /* Comment, should not be loaded */
+      {
+        FT_TRACE3(( "    Skip POST fragment #%d because it is a comment\n", i ));
         continue;
+      }
 
       /* the flags are part of the resource, so rlen >= 2.  */
       /* but some fonts declare rlen = 0 for empty fragment */
         len += rlen;
       else
       {
+        FT_TRACE3(( "    Write POST fragment #%d header (4-byte) to buffer"
+                    " 0x%p + 0x%08x\n", i, pfb_data, pfb_lenpos ));
         if ( pfb_lenpos + 3 > pfb_len + 2 )
           goto Exit2;
         pfb_data[pfb_lenpos    ] = (FT_Byte)( len );
         if ( ( flags >> 8 ) == 5 )      /* End of font mark */
           break;
 
+        FT_TRACE3(( "    Write POST fragment #%d header (6-byte) to buffer"
+                    " 0x%p + 0x%08x\n", i, pfb_data, pfb_pos ));
         if ( pfb_pos + 6 > pfb_len + 2 )
           goto Exit2;
         pfb_data[pfb_pos++] = 0x80;
         pfb_data[pfb_pos++] = 0;
       }
 
-      error = FT_Err_Cannot_Open_Resource;
       if ( pfb_pos > pfb_len || pfb_pos + rlen > pfb_len )
         goto Exit2;
 
+      FT_TRACE3(( "    Load POST fragment #%d (%d byte) to buffer"
+                  " 0x%p + 0x%08x\n", i, rlen, pfb_data, pfb_pos ));
       error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen );
       if ( error )
         goto Exit2;
       pfb_pos += rlen;
     }
 
+    error = FT_ERR( Array_Too_Large );
     if ( pfb_pos + 2 > pfb_len + 2 )
       goto Exit2;
     pfb_data[pfb_pos++] = 0x80;
                                   aface );
 
   Exit2:
+    if ( error == FT_ERR( Array_Too_Large ) )
+      FT_TRACE2(( "  Abort due to too-short buffer to store"
+                  " all POST fragments\n" ));
+    else if ( error == FT_ERR( Invalid_Offset ) )
+      FT_TRACE2(( "  Abort due to invalid offset in a POST fragment\n" ));
+    if ( error )
+      error = FT_ERR( Cannot_Open_Resource );
     FT_FREE( pfb_data );
 
   Exit:
     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 );
     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,
     if ( error )
       return error;
 
+    /* POST resources must be sorted to concatenate properly */
     error = FT_Raccess_Get_DataOffsets( library, stream,
                                         map_offset, rdara_pos,
-                                        TTAG_POST,
+                                        TTAG_POST, TRUE,
                                         &data_offsets, &count );
     if ( !error )
     {
       return error;
     }
 
+    /* sfnt resources should not be sorted to preserve the face order by
+       QuickDraw API */
     error = FT_Raccess_Get_DataOffsets( library, stream,
                                         map_offset, rdara_pos,
-                                        TTAG_sfnt,
+                                        TTAG_sfnt, FALSE,
                                         &data_offsets, &count );
     if ( !error )
     {
 
 
     if ( NULL == stream )
-      return FT_Err_Invalid_Stream_Operation;
+      return FT_THROW( Invalid_Stream_Operation );
 
     error = FT_Stream_Seek( stream, 0 );
     if ( error )
                     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 ) |
     rlen = ( header[0x57] << 24 ) |
            ( header[0x58] << 16 ) |
            ( header[0x59] <<  8 ) |
-             header[0x5a];
+             header[0x5A];
 #endif /* 0 */
     offset = 128 + ( ( dlen + 127 ) & ~127 );
 
 #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];
                   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 )
 
     /* 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;
 
 
 
     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
 
     }
 
-    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;
                 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_Module*   limit;
 
 
-    /* test for valid `library' delayed to */
-    /* FT_Stream_New()                     */
+    /* test for valid `library' delayed to `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                     );
           params     = args->params;
         }
 
-        error = open_face( driver, stream, face_index,
+        error = open_face( driver, &stream, external_stream, face_index,
                            num_params, params, &face );
         if ( !error )
           goto Success;
       }
       else
-        error = FT_Err_Invalid_Handle;
+        error = FT_THROW( Invalid_Handle );
 
       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;
 
-
       for ( ; cur < limit; cur++ )
       {
         /* not all modules are font drivers, so check... */
             params     = args->params;
           }
 
-          error = open_face( driver, stream, face_index,
+          error = open_face( driver, &stream, external_stream, face_index,
                              num_params, params, &face );
           if ( !error )
             goto Success;
 
 #ifdef FT_CONFIG_OPTION_MAC_FONTS
           if ( ft_strcmp( cur[0]->clazz->module_name, "truetype" ) == 0 &&
-               FT_ERROR_BASE( error ) == FT_Err_Table_Missing           )
+               FT_ERR_EQ( error, Table_Missing )                        )
           {
             /* TrueType but essential tables are missing */
             if ( FT_Stream_Seek( stream, 0 ) )
           }
 #endif
 
-          if ( FT_ERROR_BASE( error ) != FT_Err_Unknown_File_Format )
+          if ( FT_ERR_NEQ( error, Unknown_File_Format ) )
             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 )
-    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 */
-      error = FT_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
 
   Fail2:
       FT_Stream_Free( stream, external_stream );
   Success:
     FT_TRACE4(( "FT_Open_Face: New face object, adding to list\n" ));
 
-    /* set the FT_FACE_FLAG_EXTERNAL_STREAM bit for FT_Done_Face */
-    if ( external_stream )
-      face->face_flags |= FT_FACE_FLAG_EXTERNAL_STREAM;
-
     /* add the face object to its driver's list */
     if ( FT_NEW( node ) )
       goto 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 ));
     FT_Open_Args  open;
 
 
-    /* test for valid `face' delayed to FT_Attach_Stream() */
+    /* 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;
     FT_Driver_Class  clazz;
 
 
-    /* test for valid `parameters' delayed to FT_Stream_New() */
+    /* 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 )
-      return FT_Err_Invalid_Driver_Handle;
+      return FT_THROW( Invalid_Driver_Handle );
 
     error = FT_Stream_New( driver->root.library, parameters, &stream );
     if ( error )
     /* 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 );
   FT_EXPORT_DEF( FT_Error )
   FT_Reference_Face( FT_Face  face )
   {
+    if ( !face )
+      return FT_THROW( Invalid_Face_Handle );
+
     face->internal->refcount++;
 
     return FT_Err_Ok;
     FT_ListNode  node;
 
 
-    error = FT_Err_Invalid_Face_Handle;
+    error = FT_ERR( Invalid_Face_Handle );
     if ( face && face->driver )
     {
       face->internal->refcount--;
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     if ( !asize )
-      return FT_Err_Invalid_Size_Handle;
+      return FT_THROW( Invalid_Argument );
 
     if ( !face->driver )
-      return FT_Err_Invalid_Driver_Handle;
+      return FT_THROW( Invalid_Driver_Handle );
 
     *asize = 0;
 
 
 
     if ( !size )
-      return FT_Err_Invalid_Size_Handle;
+      return FT_THROW( Invalid_Size_Handle );
 
     face = size->face;
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     driver = face->driver;
     if ( !driver )
-      return FT_Err_Invalid_Driver_Handle;
+      return FT_THROW( Invalid_Driver_Handle );
 
     memory = driver->root.memory;
 
       destroy_size( memory, size, driver );
     }
     else
-      error = FT_Err_Invalid_Size_Handle;
+      error = FT_THROW( Invalid_Size_Handle );
 
     return error;
   }
 
 
     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 )
-      return FT_Err_Unimplemented_Feature;
+      return FT_THROW( Unimplemented_Feature );
 
     w = FT_REQUEST_WIDTH ( req );
     h = FT_REQUEST_HEIGHT( req );
 
       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;
 
       }
     }
 
-    return FT_Err_Invalid_Pixel_Size;
+    return FT_THROW( Invalid_Pixel_Size );
   }
 
 
 
 
     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 )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     clazz = face->driver->clazz;
 
 
 
     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 )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     clazz = face->driver->clazz;
 
       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 );
     }
 
     FT_Size_RequestRec  req;
 
 
+    /* check of `face' delayed to `FT_Request_Size' */
+
     if ( !char_width )
       char_width = char_height;
     else if ( !char_height )
     FT_Size_RequestRec  req;
 
 
+    /* check of `face' delayed to `FT_Request_Size' */
+
     if ( pixel_width == 0 )
       pixel_width = pixel_height;
     else if ( pixel_height == 0 )
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     if ( !akerning )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     driver = face->driver;
 
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     if ( !akerning )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     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,
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     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.   */
 
     cur = face->charmaps;
     if ( !cur )
-      return FT_Err_Invalid_CharMap_Handle;
+      return FT_THROW( Invalid_CharMap_Handle );
 
     limit = cur + face->num_charmaps;
 
     {
       if ( cur[0]->encoding == encoding )
       {
-#ifdef FT_MAX_CHARMAP_CACHEABLE
-        if ( cur - face->charmaps > FT_MAX_CHARMAP_CACHEABLE )
-        {
-          FT_ERROR(( "FT_Select_Charmap: requested charmap is found (%d), "
-                     "but in too late position to cache\n",
-                     cur - face->charmaps ));
-          continue;
-        }
-#endif
         face->charmap = cur[0];
         return 0;
       }
     }
 
-    return FT_Err_Invalid_Argument;
+    return FT_THROW( Invalid_Argument );
   }
 
 
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     cur = face->charmaps;
-    if ( !cur )
-      return FT_Err_Invalid_CharMap_Handle;
+    if ( !cur || !charmap )
+      return FT_THROW( Invalid_CharMap_Handle );
+
     if ( FT_Get_CMap_Format( charmap ) == 14 )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     limit = cur + face->num_charmaps;
 
     {
       if ( cur[0] == charmap )
       {
-#ifdef FT_MAX_CHARMAP_CACHEABLE
-        if ( cur - face->charmaps > FT_MAX_CHARMAP_CACHEABLE )
-        {
-          FT_ERROR(( "FT_Set_Charmap: requested charmap is found (%d), "
-                     "but in too late position to cache\n",
-                     cur - face->charmaps ));
-          continue;
-        }
-#endif
         face->charmap = cur[0];
-        return 0;
+        return FT_Err_Ok;
       }
     }
-    return FT_Err_Invalid_Argument;
+
+    return FT_THROW( Invalid_Argument );
   }
 
 
 
     FT_ASSERT( i < charmap->face->num_charmaps );
 
-#ifdef FT_MAX_CHARMAP_CACHEABLE
-    if ( i > FT_MAX_CHARMAP_CACHEABLE )
-    {
-      FT_ERROR(( "FT_Get_Charmap_Index: requested charmap is found (%d), "
-                 "but in too late position to cache\n",
-                 i ));
-      return -i;
-    }
-#endif
     return i;
   }
 
   {
     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 == NULL || charmap == NULL || charmap->face == NULL )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     face   = charmap->face;
     memory = FT_FACE_MEMORY( face );
     FT_UInt   gindex = 0;
 
 
+    /* only do something if we have a charmap, and we have glyphs at all */
     if ( face && face->charmap && face->num_glyphs )
     {
       gindex = FT_Get_Char_Index( face, 0 );
       FT_CMap    cmap = FT_CMAP( face->charmap );
 
 
-      do {
+      do
+      {
         gindex = cmap->clazz->char_next( cmap, &code );
+
       } while ( gindex >= (FT_UInt)face->num_glyphs );
 
       result = ( gindex == 0 ) ? 0 : code;
     FT_UInt  result = 0;
 
 
-    if ( face && face->charmap &&
-        face->charmap->encoding == FT_ENCODING_UNICODE )
+    if ( face                                           &&
+         face->charmap                                  &&
+         face->charmap->encoding == FT_ENCODING_UNICODE )
     {
       FT_CharMap  charmap = find_variant_selector_charmap( face );
       FT_CMap     ucmap = FT_CMAP( face->charmap );
     FT_UInt  result = 0;
 
 
-    if ( face && FT_HAS_GLYPH_NAMES( face ) )
+    if ( face                       &&
+         FT_HAS_GLYPH_NAMES( face ) &&
+         glyph_name                 )
     {
       FT_Service_GlyphDict  service;
 
                      FT_Pointer  buffer,
                      FT_UInt     buffer_max )
   {
-    FT_Error  error = FT_Err_Invalid_Argument;
+    FT_Error              error;
+    FT_Service_GlyphDict  service;
 
 
-    /* clean up buffer */
-    if ( buffer && buffer_max > 0 )
-      ((FT_Byte*)buffer)[0] = 0;
+    if ( !face )
+      return FT_THROW( Invalid_Face_Handle );
 
-    if ( face                                     &&
-         (FT_Long)glyph_index <= face->num_glyphs &&
-         FT_HAS_GLYPH_NAMES( face )               )
-    {
-      FT_Service_GlyphDict  service;
+    if ( !buffer || buffer_max == 0 )
+      return FT_THROW( Invalid_Argument );
 
+    /* clean up buffer */
+    ((FT_Byte*)buffer)[0] = '\0';
 
-      FT_FACE_LOOKUP_SERVICE( face,
-                              service,
-                              GLYPH_DICT );
+    if ( (FT_Long)glyph_index >= face->num_glyphs )
+      return FT_THROW( Invalid_Glyph_Index );
 
-      if ( service && service->get_name )
-        error = service->get_name( face, glyph_index, buffer, buffer_max );
-    }
+    if ( !FT_HAS_GLYPH_NAMES( face ) )
+      return FT_THROW( Invalid_Argument );
+
+    FT_FACE_LOOKUP_SERVICE( face, service, GLYPH_DICT );
+    if ( service && service->get_name )
+      error = service->get_name( face, glyph_index, buffer, buffer_max );
+    else
+      error = FT_THROW( Invalid_Argument );
 
     return error;
   }
   FT_Get_Sfnt_Table( FT_Face      face,
                      FT_Sfnt_Tag  tag )
   {
-    void*                  table = 0;
+    void*                  table = NULL;
     FT_Service_SFNT_Table  service;
 
 
 
 
     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 )
-      return FT_Err_Unimplemented_Feature;
+      return FT_THROW( Unimplemented_Feature );
 
     return service->load_table( face, tag, offset, buffer, length );
   }
     FT_ULong               offset;
 
 
+    /* test for valid `length' delayed to `service->table_info' */
+
     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 )
-      return FT_Err_Unimplemented_Feature;
+      return FT_THROW( Unimplemented_Feature );
 
     return service->table_info( face, table_index, tag, &offset, length );
   }
     FT_Face  face;
 
 
-    if ( size == NULL )
-      return FT_Err_Invalid_Argument;
+    if ( !size )
+      return FT_THROW( Invalid_Size_Handle );
 
     face = size->face;
-    if ( face == NULL || face->driver == NULL )
-      return FT_Err_Invalid_Argument;
+    if ( !face || !face->driver )
+      return FT_THROW( Invalid_Face_Handle );
 
     /* we don't need anything more complex than that; all size objects */
     /* are already listed by the face                                  */
   static void
   ft_remove_renderer( FT_Module  module )
   {
-    FT_Library   library = module->library;
-    FT_Memory    memory  = library->memory;
+    FT_Library   library;
+    FT_Memory    memory;
     FT_ListNode  node;
 
 
+    library = module->library;
+    if ( !library )
+      return;
+
+    memory = library->memory;
+
     node = FT_List_Find( &library->renderers, module );
     if ( node )
     {
   FT_Get_Renderer( FT_Library       library,
                    FT_Glyph_Format  format )
   {
-    /* test for valid `library' delayed to FT_Lookup_Renderer() */
+    /* test for valid `library' delayed to `FT_Lookup_Renderer' */
 
     return FT_Lookup_Renderer( library, format, 0 );
   }
     FT_ListNode  node;
     FT_Error     error = FT_Err_Ok;
 
+    FT_Renderer_SetModeFunc  set_mode;
+
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+    {
+      error = FT_THROW( Invalid_Library_Handle );
+      goto Exit;
+    }
 
     if ( !renderer )
-      return FT_Err_Invalid_Argument;
+    {
+      error = FT_THROW( Invalid_Argument );
+      goto Exit;
+    }
+
+    if ( num_params > 0 && !parameters )
+    {
+      error = FT_THROW( Invalid_Argument );
+      goto Exit;
+    }
 
     node = FT_List_Find( &library->renderers, renderer );
     if ( !node )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     if ( renderer->glyph_format == FT_GLYPH_FORMAT_OUTLINE )
       library->cur_renderer = renderer;
 
-    if ( num_params > 0 )
-    {
-      FT_Renderer_SetModeFunc  set_mode = renderer->clazz->set_mode;
-
+    set_mode = renderer->clazz->set_mode;
 
-      for ( ; num_params > 0; num_params-- )
-      {
-        error = set_mode( renderer, parameters->tag, parameters->data );
-        if ( error )
-          break;
-        parameters++;
-      }
+    for ( ; num_params > 0; num_params-- )
+    {
+      error = set_mode( renderer, parameters->tag, parameters->data );
+      if ( error )
+        break;
+      parameters++;
     }
 
   Exit:
         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 );
-          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   */
         /* if we changed the current renderer for the glyph image format */
         /* we need to select it as the next current one                  */
         if ( !error && update && renderer )
-          FT_Set_Renderer( library, renderer, 0, 0 );
+        {
+          error = FT_Set_Renderer( library, renderer, 0, 0 );
+          if ( error )
+            break;
+        }
+      }
+    }
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_bitmap
+
+    /* we convert to a single bitmap format for computing the checksum */
+    if ( !error )
+    {
+      FT_Bitmap  bitmap;
+      FT_Error   err;
+
+
+      FT_Bitmap_New( &bitmap );
+
+      /* this also converts the bitmap flow to `down' (i.e., pitch > 0) */
+      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;
   }
 
 
 
     if ( !slot || !slot->face )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     library = FT_FACE_LIBRARY( slot->face );
 
                                 FREETYPE_MINOR                  )
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     if ( !clazz )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     /* 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++ )
       {
         /* 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..                                        */
 
     if ( library->num_modules >= FT_MAX_MODULES )
     {
-      error = FT_Err_Too_Many_Drivers;
+      error = FT_THROW( Too_Many_Drivers );
       goto Exit;
     }
 
       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 );
     }
   FT_Get_Module( FT_Library   library,
                  const char*  module_name )
   {
-    FT_Module   result = 0;
+    FT_Module   result = NULL;
     FT_Module*  cur;
     FT_Module*  limit;
 
   {
     FT_Pointer  result = NULL;
 
+
     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 )
       {
-       /* 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;
     /* 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 )
     {
         }
       }
     }
-    return FT_Err_Invalid_Driver_Handle;
+    return FT_THROW( Invalid_Driver_Handle );
+  }
+
+
+  static 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 );
   }
 
 
   FT_EXPORT_DEF( FT_Error )
   FT_Reference_Library( FT_Library  library )
   {
+    if ( !library )
+      return FT_THROW( Invalid_Library_Handle );
+
     library->refcount++;
 
     return FT_Err_Ok;
     FT_Error    error;
 
 
-    if ( !memory )
-      return FT_Err_Invalid_Argument;
+    if ( !memory || !alibrary )
+      return FT_THROW( Invalid_Argument );
 
 #ifdef FT_DEBUG_LEVEL_ERROR
     /* init debugging support */
 
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     library->refcount--;
     if ( library->refcount > 0 )
   }
 
 
-#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 )
                         FT_Int       *p_arg2,
                         FT_Matrix    *p_transform )
   {
-    FT_Error  error = FT_Err_Invalid_Argument;
+    FT_Error  error = FT_ERR( Invalid_Argument );
 
 
     if ( glyph                                      &&
       *p_arg1      = subg->arg1;
       *p_arg2      = subg->arg2;
       *p_transform = subg->transform;
+
+      error = FT_Err_Ok;
     }
 
     return error;
index 694fd2b..5fc73d7 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -16,6 +16,8 @@
 /***************************************************************************/
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_OPENTYPE_VALIDATE_H
 #include FT_OPENTYPE_VALIDATE_H
@@ -38,7 +40,7 @@
 
     if ( !face )
     {
-      error = FT_Err_Invalid_Face_Handle;
+      error = FT_THROW( Invalid_Face_Handle );
       goto Exit;
     }
 
@@ -48,7 +50,7 @@
             GSUB_table &&
             JSTF_table ) )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
@@ -63,7 +65,7 @@
                                  GSUB_table,
                                  JSTF_table );
     else
-      error = FT_Err_Unimplemented_Feature;
+      error = FT_THROW( Unimplemented_Feature );
 
   Exit:
     return error;
index 9ae276d..8749d64 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType outline management (body).                                  */
 /*                                                                         */
-/*  Copyright 1996-2008, 2010, 2012 by                                     */
+/*  Copyright 1996-2008, 2010, 2012-2014 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -26,6 +26,7 @@
 #include <ft2build.h>
 #include FT_OUTLINE_H
 #include FT_INTERNAL_OBJECTS_H
+#include FT_INTERNAL_CALC_H
 #include FT_INTERNAL_DEBUG_H
 #include FT_TRIGONOMETRY_H
 
     FT_Pos   delta;
 
 
-    if ( !outline || !func_interface )
-      return FT_Err_Invalid_Argument;
+    if ( !outline )
+      return FT_THROW( Invalid_Outline );
+
+    if ( !func_interface )
+      return FT_THROW( Invalid_Argument );
 
     shift = func_interface->shift;
     delta = func_interface->delta;
           v_start.x = ( v_start.x + v_last.x ) / 2;
           v_start.y = ( v_start.y + v_last.y ) / 2;
 
-          v_last = v_start;
+       /* v_last = v_start; */
         }
         point--;
         tags--;
     return error;
 
   Invalid_Outline:
-    return FT_Err_Invalid_Outline;
+    return FT_THROW( Invalid_Outline );
   }
 
 
 
 
     if ( !anoutline || !memory )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     *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 ) )
                   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 );
 
       /* empty glyph? */
       if ( n_points == 0 && n_contours == 0 )
-        return 0;
+        return FT_Err_Ok;
 
       /* check point and contour counts */
       if ( n_points <= 0 || n_contours <= 0 )
         goto Bad;
 
       /* XXX: check the tags array */
-      return 0;
+      return FT_Err_Ok;
     }
 
   Bad:
-    return FT_Err_Invalid_Argument;
+    return FT_THROW( Invalid_Argument );
   }
 
 
     FT_Int  is_owner;
 
 
-    if ( !source            || !target            ||
-         source->n_points   != target->n_points   ||
+    if ( !source || !target )
+      return FT_THROW( Invalid_Outline );
+
+    if ( 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;
   FT_Outline_Done_Internal( FT_Memory    memory,
                             FT_Outline*  outline )
   {
-    if ( memory && outline )
-    {
-      if ( outline->flags & FT_OUTLINE_OWNER )
-      {
-        FT_FREE( outline->points   );
-        FT_FREE( outline->tags     );
-        FT_FREE( outline->contours );
-      }
-      *outline = null_outline;
+    if ( !outline )
+      return FT_THROW( Invalid_Outline );
 
-      return FT_Err_Ok;
+    if ( !memory )
+      return FT_THROW( Invalid_Argument );
+
+    if ( outline->flags & FT_OUTLINE_OWNER )
+    {
+      FT_FREE( outline->points   );
+      FT_FREE( outline->tags     );
+      FT_FREE( outline->contours );
     }
-    else
-      return FT_Err_Invalid_Argument;
+    *outline = null_outline;
+
+    return FT_Err_Ok;
   }
 
 
     /* 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 );
   }
       {
         char*  p = outline->tags + first;
         char*  q = outline->tags + last;
-        char   swap;
 
 
         while ( p < q )
         {
+          char  swap;
+
+
           swap = *p;
           *p   = *q;
           *q   = swap;
 
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
-    if ( !outline || !params )
-      return FT_Err_Invalid_Argument;
+    if ( !outline )
+      return FT_THROW( Invalid_Outline );
+
+    if ( !params )
+      return FT_THROW( Invalid_Argument );
 
     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 );
-      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   */
     /* if we changed the current renderer for the glyph image format */
     /* we need to select it as the next current one                  */
     if ( !error && update && renderer )
-      FT_Set_Renderer( library, renderer, 0, 0 );
+      error = FT_Set_Renderer( library, renderer, 0, 0 );
 
     return error;
   }
 
 
     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' */
 
     params.target = abitmap;
     params.flags  = 0;
 #if 0
 
 #define FT_OUTLINE_GET_CONTOUR( outline, c, first, last )  \
-  do {                                                     \
+  do                                                       \
+  {                                                        \
     (first) = ( c > 0 ) ? (outline)->points +              \
                             (outline)->contours[c - 1] + 1 \
                         : (outline)->points;               \
   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_Angle    rotate, angle_in, angle_out;
     FT_Int      c, n, first;
     FT_Int      orientation;
 
 
     if ( !outline )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Outline );
 
-    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_Invalid_Argument;
+        return FT_THROW( Invalid_Argument );
       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++ )
     {
-      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;
 
-      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;
 
-        /* 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;
+        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;
+
+          /* 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 );
 
-          FT_Vector_From_Polar( &in, d, angle_in + angle_diff / 2 - rotate );
+          /* 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;
   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 )
     /* 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;
-
+    FT_Outline_Get_CBox( outline, &cbox );
 
-      last = outline->points + *contour;
+    /* Handle collapsed outlines to avoid undefined FT_MSB. */
+    if ( cbox.xMin == cbox.xMax || cbox.yMin == cbox.yMax )
+      return FT_ORIENTATION_NONE;
 
-      /* skip degenerate contours */
-      if ( last < first + 2 )
-        continue;
+    xshift = FT_MSB( FT_ABS( cbox.xMax ) | FT_ABS( cbox.xMin ) ) - 14;
+    xshift = FT_MAX( xshift, 0 );
 
-      for ( point = first; point <= last; ++point )
-      {
-        if ( point->x < contour_xmin )
-          contour_xmin = point->x;
+    yshift = FT_MSB( cbox.yMax - cbox.yMin ) - 14;
+    yshift = FT_MAX( yshift, 0 );
 
-        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;
-      }
-    }
-
-    if ( xmin == 32768L )
-      return FT_ORIENTATION_TRUETYPE;
-
-    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 3a0f92d..7425abe 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for accessing PFR-specific data (body).                 */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2008, 2010 by                              */
+/*  Copyright 2002-2004, 2008, 2010, 2013, 2014 by                         */
 /*  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 FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_PFR_H
 
@@ -48,7 +50,7 @@
 
 
     if ( !face )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Face_Handle );
 
     service = ft_pfr_check( face );
     if ( service )
@@ -84,7 +86,7 @@
       if ( ametrics_y_scale )
         *ametrics_y_scale = y_scale;
 
-      error = FT_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
     }
 
     return error;
 
 
     if ( !face )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Face_Handle );
+
+    if ( !avector )
+      return FT_THROW( Invalid_Argument );
 
     service = ft_pfr_check( face );
     if ( service )
     FT_Service_PfrMetrics  service;
 
 
+    if ( !face )
+      return FT_THROW( Invalid_Face_Handle );
+
+    if ( !aadvance )
+      return FT_THROW( Invalid_Argument );
+
     service = ft_pfr_check( face );
     if ( service )
-    {
       error = service->get_advance( face, gindex, aadvance );
-    }
     else
       /* XXX: TODO: PROVIDE ADVANCE-LOADING METHOD TO ALL FONT DRIVERS */
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
 
     return error;
   }
index b74e90d..9bd92f7 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services (body).              */
 /*                                                                         */
-/*  Copyright 2009 by                                                      */
+/*  Copyright 2009, 2013 by                                                */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -29,7 +29,8 @@
   ft_pic_container_init( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
-    FT_Error  error = FT_Err_Ok;
+    FT_Error           error;
+
 
     FT_MEM_SET( pic_container, 0, sizeof ( *pic_container ) );
 
index 01d8625..efe24d6 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Embedded resource forks accessor (body).                             */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010 by                  */
+/*  Copyright 2004-2010, 2013, 2014 by                                     */
 /*  Masatake YAMATO and Redhat K.K.                                        */
 /*                                                                         */
 /*  FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are     */
@@ -29,6 +29,7 @@
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_RFORK_H
 #include "basepic.h"
+#include "ftbase.h"
 
 #undef  FT_COMPONENT
 #define FT_COMPONENT  trace_raccess
@@ -86,7 +87,7 @@
     /* 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 )
         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 ( 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 )
                               FT_Long     map_offset,
                               FT_Long     rdata_pos,
                               FT_Long     tag,
+                              FT_Bool     sort_by_res_id,
                               FT_Long   **offsets,
                               FT_Long    *count )
   {
     FT_RFork_Ref  *ref = NULL;
 
 
+    FT_TRACE3(( "\n" ));
     error = FT_Stream_Seek( stream, map_offset );
     if ( error )
       return error;
         return error;
 
       FT_TRACE2(( "Resource tags: %c%c%c%c\n",
-                  (char)( 0xff & ( tag_internal >> 24 ) ),
-                  (char)( 0xff & ( tag_internal >> 16 ) ),
-                  (char)( 0xff & ( tag_internal >>  8 ) ),
-                  (char)( 0xff & ( tag_internal >>  0 ) ) ));
+                  (char)( 0xFF & ( tag_internal >> 24 ) ),
+                  (char)( 0xFF & ( tag_internal >> 16 ) ),
+                  (char)( 0xFF & ( tag_internal >>  8 ) ),
+                  (char)( 0xFF & ( tag_internal >>  0 ) ) ));
+      FT_TRACE3(( "             : subcount=%d, suboffset=0x%04x\n",
+                  subcnt, rpos ));
 
       if ( tag_internal == tag )
       {
             goto Exit;
 
           ref[j].offset = temp & 0xFFFFFFL;
+          FT_TRACE3(( "             [%d]:"
+                      " resource_id=0x%04x, offset=0x%08x\n",
+                      j, ref[j].res_id, ref[j].offset ));
         }
 
-        ft_qsort( ref, *count, sizeof ( FT_RFork_Ref ),
-                  ( int(*)(const void*, const void*) )
-                  ft_raccess_sort_ref_by_id );
+        if (sort_by_res_id)
+        {
+          ft_qsort( ref, *count, sizeof ( FT_RFork_Ref ),
+                    ( int(*)(const void*, const void*) )
+                    ft_raccess_sort_ref_by_id );
+
+          FT_TRACE3(( "             -- sort resources by their ids --\n" ));
+          for ( j = 0; j < *count; ++ j ) {
+            FT_TRACE3(( "             [%d]:"
+                        " resource_id=0x%04x, offset=0x%08x\n",
+                        j, ref[j].res_id, ref[j].offset ));
+          }
+        }
 
         if ( FT_NEW_ARRAY( offsets_internal, *count ) )
           goto Exit;
       }
     }
 
-    return FT_Err_Cannot_Open_Resource;
+    return FT_THROW( Cannot_Open_Resource );
   }
 
 
                     FT_Long    *offsets,
                     FT_Error   *errors )
   {
-    FT_Long  i;
+    FT_Int  i;
 
 
     for ( i = 0; i < FT_RACCESS_N_RULES; i++ )
 
     *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 );
 
     *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 );
     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 );
     FT_Error   error;
     char*      newpath = NULL;
     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 );
 
     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;
     FT_Error   error;
     char*      newpath = NULL;
     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 );
 
     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;
     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;
 
     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;
 
     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 );
     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 );
     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_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++ )
     {
       }
     }
 
-    return FT_Err_Unknown_File_Format;
+    return FT_THROW( Unknown_File_Format );
   }
 
 
                     FT_Long    *offsets,
                     FT_Error   *errors )
   {
-    int  i;
+    FT_Int  i;
 
     FT_UNUSED( library );
     FT_UNUSED( stream );
     {
       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_Error  error = FT_Err_Invalid_Argument;
+    FT_Error  error = FT_ERR( Invalid_Argument );
 
 
     if ( aname && face && FT_IS_SFNT( face ) )
index fc2868e..759fd8f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    I/O stream support (body).                                           */
 /*                                                                         */
-/*  Copyright 2000-2002, 2004-2006, 2008-2011 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,       */
@@ -68,7 +68,7 @@
                    " 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 */
@@ -78,7 +78,7 @@
                  " 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 )
@@ -93,7 +93,7 @@
                   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 ) );
   }
                  " 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 )
                  " 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;
                    " 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;
       }
 
                    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;
                    " 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;
       }
 
     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 ));
     return result;
 
   Fail:
-    *error = FT_Err_Invalid_Stream_Operation;
+    *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 ));
     return result;
 
   Fail:
-    *error = FT_Err_Invalid_Stream_Operation;
+    *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 ));
     return result;
 
   Fail:
-    *error = FT_Err_Invalid_Stream_Operation;
+    *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 ));
     return result;
 
   Fail:
-    *error = FT_Err_Invalid_Stream_Operation;
+    *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 ));
     return result;
 
   Fail:
-    *error = FT_Err_Invalid_Stream_Operation;
+    *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 ));
     FT_Bool   frame_accessed = 0;
     FT_Byte*  cursor;
 
-    if ( !fields || !stream )
-      return FT_Err_Invalid_Argument;
+
+    if ( !fields )
+      return FT_THROW( Invalid_Argument );
+
+    if ( !stream )
+      return FT_THROW( Invalid_Stream_Handle );
 
     cursor = stream->cursor;
 
 
           if ( cursor + len > stream->limit )
           {
-            error = FT_Err_Invalid_Stream_Operation;
+            error = FT_THROW( Invalid_Stream_Operation );
             goto Exit;
           }
 
 
       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 */
-        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 */
-        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 */
-        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 */
-        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 */
-        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 */
-        value = FT_NEXT_UOFF3_LE(cursor);
+        value = FT_NEXT_UOFF3_LE( cursor );
         sign_shift = 8;
         break;
 
       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;
 
-      case (16 / FT_CHAR_BIT):
+      case ( 16 / FT_CHAR_BIT ):
         *(FT_UShort*)p = (FT_UShort)value;
         break;
 
-      case (32 / FT_CHAR_BIT):
+      case ( 32 / FT_CHAR_BIT ):
         *(FT_UInt32*)p = (FT_UInt32)value;
         break;
 
index 5399efe..5fc41fc 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType path stroker (body).                                        */
 /*                                                                         */
-/*  Copyright 2002-2006, 2008-2011 by                                      */
+/*  Copyright 2002-2006, 2008-2011, 2013, 2014 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   FT_Stroker_New( FT_Library   library,
                   FT_Stroker  *astroker )
   {
-    FT_Error    error;
+    FT_Error    error;           /* assigned in FT_NEW */
     FT_Memory   memory;
     FT_Stroker  stroker = NULL;
 
 
     if ( !library )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Library_Handle );
+
+    if ( !astroker )
+      return FT_THROW( Invalid_Argument );
 
     memory = library->memory;
 
                   FT_Stroker_LineJoin  line_join,
                   FT_Fixed             miter_limit )
   {
+    if ( !stroker )
+      return;
+
     stroker->radius      = radius;
     stroker->line_cap    = line_cap;
     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;
+    if ( stroker->miter_limit < 0x10000L )
+      stroker->miter_limit = 0x10000L;
 
     /* save line join style:                                           */
     /* line join style can be temporarily changed when stroking curves */
                                                     FT_Tan( theta ) ) );
 
 
-      intersect = FT_BOOL( stroker->line_length >= min_length &&
+      intersect = FT_BOOL( min_length                         &&
+                           stroker->line_length >= min_length &&
                            line_length          >= min_length );
     }
 
           middle.y += stroker->center.y;
 
           /* compute first angle point */
-          length = FT_MulFix( radius,
-                              FT_DivFix( 0x10000L - sigma,
-                                         ft_pos_abs( FT_Sin( theta ) ) ) );
+          length = FT_MulDiv( radius, 0x10000L - sigma,
+                              ft_pos_abs( FT_Sin( theta ) ) );
 
           FT_Vector_From_Polar( &delta, length, phi + rotate );
           delta.x += middle.x;
     FT_Fixed         line_length;
 
 
+    if ( !stroker || !to )
+      return FT_THROW( Invalid_Argument );
+
     delta.x = to->x - stroker->center.x;
     delta.y = to->y - stroker->center.y;
 
     FT_Bool     first_arc = TRUE;
 
 
+    if ( !stroker || !control || !to )
+    {
+      error = FT_THROW( Invalid_Argument );
+      goto Exit;
+    }
+
     /* 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 ) &&
               sinA = ft_pos_abs( FT_Sin( alpha1 - gamma ) );
               sinB = ft_pos_abs( FT_Sin( beta - gamma ) );
 
-              alen = FT_DivFix( FT_MulFix( blen, sinA ), sinB );
+              alen = FT_MulDiv( blen, sinA, sinB );
 
               FT_Vector_From_Polar( &delta, alen, beta );
               delta.x += start.x;
     FT_Bool     first_arc = TRUE;
 
 
+    if ( !stroker || !control1 || !control2 || !to )
+    {
+      error = FT_THROW( Invalid_Argument );
+      goto Exit;
+    }
+
     /* 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 ) &&
               sinA = ft_pos_abs( FT_Sin( alpha1 - gamma ) );
               sinB = ft_pos_abs( FT_Sin( beta - gamma ) );
 
-              alen = FT_DivFix( FT_MulFix( blen, sinA ), sinB );
+              alen = FT_MulDiv( blen, sinA, sinB );
 
               FT_Vector_From_Polar( &delta, alen, beta );
               delta.x += start.x;
                            FT_Vector*  to,
                            FT_Bool     open )
   {
+    if ( !stroker || !to )
+      return FT_THROW( Invalid_Argument );
+
     /* We cannot process the first point, because there is not enough      */
     /* information regarding its corner/cap.  The latter will be processed */
     /* in the `FT_Stroker_EndSubPath' routine.                             */
     FT_Error  error = FT_Err_Ok;
 
 
+    if ( !stroker )
+    {
+      error = FT_THROW( Invalid_Argument );
+      goto Exit;
+    }
+
     if ( stroker->subpath_open )
     {
       FT_StrokeBorder  right = stroker->borders;
 
     if ( !stroker || border > 1 )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     FT_Error  error;
 
 
+    if ( !stroker )
+    {
+      error = FT_THROW( Invalid_Argument );
+      goto Exit;
+    }
+
     error = ft_stroke_border_get_counts( stroker->borders + 0,
                                          &count1, &count2 );
     if ( error )
     num_contours = count2 + count4;
 
   Exit:
-    *anum_points   = num_points;
-    *anum_contours = num_contours;
+    if ( anum_points )
+      *anum_points   = num_points;
+
+    if ( anum_contours )
+      *anum_contours = num_contours;
+
     return error;
   }
 
                            FT_StrokerBorder  border,
                            FT_Outline*       outline )
   {
+    if ( !stroker || !outline )
+      return;
+
     if ( border == FT_STROKER_BORDER_LEFT  ||
          border == FT_STROKER_BORDER_RIGHT )
     {
     FT_Int      tag;       /* current point's state           */
 
 
-    if ( !outline || !stroker )
-      return FT_Err_Invalid_Argument;
+    if ( !outline )
+      return FT_THROW( Invalid_Outline );
+
+    if ( !stroker )
+      return FT_THROW( Invalid_Argument );
 
     FT_Stroker_Rewind( stroker );
 
     return error;
 
   Invalid_Outline:
-    return FT_Err_Invalid_Outline;
+    return FT_THROW( Invalid_Outline );
   }
 
 
                    FT_Stroker   stroker,
                    FT_Bool      destroy )
   {
-    FT_Error    error   = FT_Err_Invalid_Argument;
-    FT_Glyph    glyph   = NULL;
+    FT_Error  error = FT_ERR( Invalid_Argument );
+    FT_Glyph  glyph = NULL;
+
+    /* for FT_OUTLINE_GLYPH_CLASS_GET (in PIC mode) */
     FT_Library  library = stroker->library;
 
     FT_UNUSED( library );
 
 
-    if ( pglyph == NULL )
+    if ( !pglyph )
       goto Exit;
 
     glyph = *pglyph;
-    if ( glyph == NULL || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET )
+    if ( !glyph || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET )
       goto Exit;
 
     {
       if ( error )
         goto Fail;
 
-      (void)FT_Stroker_GetCounts( stroker, &num_points, &num_contours );
+      FT_Stroker_GetCounts( stroker, &num_points, &num_contours );
 
       FT_Outline_Done( glyph->library, outline );
 
                          FT_Bool      inside,
                          FT_Bool      destroy )
   {
-    FT_Error    error   = FT_Err_Invalid_Argument;
-    FT_Glyph    glyph   = NULL;
+    FT_Error  error = FT_ERR( Invalid_Argument );
+    FT_Glyph  glyph = NULL;
+
+    /* for FT_OUTLINE_GLYPH_CLASS_GET (in PIC mode) */
     FT_Library  library = stroker->library;
 
     FT_UNUSED( library );
 
 
-    if ( pglyph == NULL )
+    if ( !pglyph )
       goto Exit;
 
     glyph = *pglyph;
-    if ( glyph == NULL || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET )
+    if ( !glyph || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET )
       goto Exit;
 
     {
       if ( error )
         goto Fail;
 
-      (void)FT_Stroker_GetBorderCounts( stroker, border,
-                                        &num_points, &num_contours );
+      FT_Stroker_GetBorderCounts( stroker, border,
+                                  &num_points, &num_contours );
 
       FT_Outline_Done( glyph->library, outline );
 
index d4ec0da..0567bd5 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType synthesizing code for emboldening and slanting (body).      */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2010 by             */
+/*  Copyright 2000-2006, 2010, 2012-2014 by                                */
 /*  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
 
+
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
   FT_GlyphSlot_Oblique( FT_GlyphSlot  slot )
   {
     FT_Matrix    transform;
-    FT_Outline*  outline = &slot->outline;
+    FT_Outline*  outline;
+
+
+    if ( !slot )
+      return;
 
+    outline = &slot->outline;
 
     /* only oblique outline glyphs */
     if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )
@@ -62,7 +68,7 @@
     transform.xx = 0x10000L;
     transform.yx = 0x00000L;
 
-    transform.xy = 0x06000L;
+    transform.xy = 0x0366AL;
     transform.yy = 0x10000L;
 
     FT_Outline_Transform( outline, &transform );
@@ -72,7 +78,7 @@
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
-  /****   EXPERIMENTAL EMBOLDENING/OUTLINING SUPPORT                    ****/
+  /****   EXPERIMENTAL EMBOLDENING SUPPORT                              ****/
   /****                                                                 ****/
   /*************************************************************************/
   /*************************************************************************/
   FT_EXPORT_DEF( void )
   FT_GlyphSlot_Embolden( FT_GlyphSlot  slot )
   {
-    FT_Library  library = slot->library;
-    FT_Face     face    = slot->face;
+    FT_Library  library;
+    FT_Face     face;
     FT_Error    error;
     FT_Pos      xstr, ystr;
 
 
+    if ( !slot )
+      return;
+
+    library = slot->library;
+    face    = slot->face;
+
     if ( slot->format != FT_GLYPH_FORMAT_OUTLINE &&
          slot->format != FT_GLYPH_FORMAT_BITMAP  )
       return;
     ystr = xstr;
 
     if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
-    {
-      /* ignore error */
-      (void)FT_Outline_Embolden( &slot->outline, xstr );
+      FT_Outline_EmboldenXY( &slot->outline, xstr, ystr );
 
-      /* 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;
-    }
     else /* slot->format == FT_GLYPH_FORMAT_BITMAP */
     {
       /* round to full pixels */
 
     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.horiBearingY += ystr;
 
     /* XXX: 16-bit overflow case must be excluded before here */
     if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
index 7e203be..2c6ddac 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    ANSI-specific FreeType low-level system interface (body).            */
 /*                                                                         */
-/*  Copyright 1996-2002, 2006, 2008-2011 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,       */
 
 
     if ( !stream )
-      return FT_Err_Invalid_Stream_Handle;
+      return FT_THROW( Invalid_Stream_Handle );
 
     stream->descriptor.pointer = NULL;
     stream->pathname.pointer   = (char*)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_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 );
 
index fdf433a..22b7ecf 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType trigonometric functions (body).                             */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004, 2005 by                              */
+/*  Copyright 2001-2005, 2012-2014 by                                      */
 /*  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 FT_INTERNAL_CALC_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
-  ft_trig_arctan_table[24] =
+  static const FT_Angle
+  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
   };
 
-  /* 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
   ft_trig_downscale( FT_Fixed  val )
   {
-    FT_Fixed  s;
-    FT_Int64  v;
+    FT_Int  s = 1;
 
 
-    s   = val;
-    val = ( val >= 0 ) ? val : -val;
+    if ( val < 0 )
+    {
+       val = -val;
+       s = -1;
+    }
 
-    v   = ( val * (FT_Int64)FT_TRIG_SCALE ) + 0x100000000UL;
-    val = (FT_Fixed)( v >> 32 );
+    /* 0x40000000 comes from regression analysis between true */
+    /* and CORDIC hypotenuse, so it minimizes the error       */
+    val = (FT_Fixed)( ( (FT_Int64)val * FT_TRIG_SCALE + 0x40000000UL ) >> 32 );
 
-    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
   ft_trig_downscale( FT_Fixed  val )
   {
-    FT_Fixed   s;
-    FT_UInt32  v1, v2, k1, k2, hi, lo1, lo2, lo3;
+    FT_Int     s = 1;
+    FT_UInt32  lo1, hi1, lo2, hi2, lo, hi, i1, i2;
+
 
+    if ( val < 0 )
+    {
+       val = -val;
+       s = -1;
+    }
+
+    lo1 = val & 0x0000FFFFU;
+    hi1 = val >> 16;
+    lo2 = FT_TRIG_SCALE & 0x0000FFFFU;
+    hi2 = FT_TRIG_SCALE >> 16;
 
-    s   = val;
-    val = ( val >= 0 ) ? val : -val;
+    lo = lo1 * lo2;
+    i1 = lo1 * hi2;
+    i2 = lo2 * hi1;
+    hi = hi1 * hi2;
 
-    v1 = (FT_UInt32)val >> 16;
-    v2 = (FT_UInt32)(val & 0xFFFFL);
+    /* Check carry overflow of i1 + i2 */
+    i1 += i2;
+    hi += (FT_UInt32)( i1 < i2 ) << 16;
 
-    k1 = (FT_UInt32)FT_TRIG_SCALE >> 16;       /* constant */
-    k2 = (FT_UInt32)(FT_TRIG_SCALE & 0xFFFFL);   /* constant */
+    hi += i1 >> 16;
+    i1  = i1 << 16;
 
-    hi   = k1 * v1;
-    lo1  = k1 * v2 + k2 * v1;       /* can't overflow */
+    /* Check carry overflow of i1 + lo */
+    lo += i1;
+    hi += ( lo < i1 );
 
-    lo2  = ( k2 * v2 ) >> 16;
-    lo3  = ( lo1 >= lo2 ) ? lo1 : lo2;
-    lo1 += lo2;
+    /* 0x40000000 comes from regression analysis between true */
+    /* and CORDIC hypotenuse, so it minimizes the error       */
 
-    hi  += lo1 >> 16;
-    if ( lo1 < lo3 )
-      hi += (FT_UInt32)0x10000UL;
+    /* Check carry overflow of lo + 0x40000000 */
+    lo += 0x40000000UL;
+    hi += ( lo < 0x40000000UL );
 
     val  = (FT_Fixed)hi;
 
-    return ( s >= 0 ) ? val : -val;
+    return s < 0 ? -val : val;
   }
 
-#endif /* !FT_CONFIG_HAS_INT64 */
+#endif /* !FT_LONG64 */
 
 
+  /* undefined and never called for zero vector */
   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;
 
-    z     = ( ( x >= 0 ) ? x : - x ) | ( (y >= 0) ? y : -y );
-    shift = 0;
-
-#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 ) )
-    {
-      z     >>= 2;
-      shift  += 2;
-    }
-    if ( z >= ( 1L << 1 ) )
-    {
-      z    >>= 1;
-      shift += 1;
-    }
+    shift = FT_MSB( FT_ABS( x ) | FT_ABS( y ) );
 
-    if ( shift <= 27 )
+    if ( shift <= FT_TRIG_SAFE_MSB )
     {
-      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
     {
-      shift -= 27;
+      shift -= FT_TRIG_SAFE_MSB;
       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 ) );
-
-      vec->x = x >> shift;
-      vec->y = y >> shift;
-      shift  = -shift;
-    }
-
-#endif /* 0 */
-
     return shift;
   }
 
                          FT_Angle    theta )
   {
     FT_Int           i;
-    FT_Fixed         x, y, xtemp;
-    const FT_Fixed  *arctanptr;
+    FT_Fixed         x, y, xtemp, b;
+    const FT_Angle  *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;
 
-    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 )
       {
-        xtemp  = x + ( y >> i );
-        y      = y - ( x >> i );
+        xtemp  = x + ( ( y + b ) >> i );
+        y      = y - ( ( x + b ) >> i );
         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++;
       }
-    } while ( ++i < FT_TRIG_MAX_ITERS );
+    }
 
     vec->x = x;
     vec->y = y;
   static void
   ft_trig_pseudo_polarize( FT_Vector*  vec )
   {
-    FT_Fixed         theta;
-    FT_Fixed         yi, i;
-    FT_Fixed         x, y;
-    const FT_Fixed  *arctanptr;
+    FT_Angle         theta;
+    FT_Int           i;
+    FT_Fixed         x, y, xtemp, b;
+    const FT_Angle  *arctanptr;
 
 
     x = vec->x;
     y = vec->y;
 
-    /* Get the vector into the right half plane */
-    theta = 0;
-    if ( x < 0 )
-    {
-      x = -x;
-      y = -y;
-      theta = 2 * FT_ANGLE_PI2;
-    }
-
-    if ( y > 0 )
-      theta = - theta;
-
-    arctanptr = ft_trig_arctan_table;
-
-    if ( y < 0 )
+    /* Get the vector into [-PI/4,PI/4] sector */
+    if ( y > x )
     {
-      /* 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
     {
-      /* 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
       {
-        /* 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 */
+    /* round theta to acknowledge its error that mostly comes */
+    /* from accumulated rounding errors in the arctan table   */
     if ( theta >= 0 )
-      theta = FT_PAD_ROUND( theta, 32 );
+      theta = FT_PAD_ROUND( theta, 16 );
     else
-      theta = -FT_PAD_ROUND( -theta, 32 );
+      theta = -FT_PAD_ROUND( -theta, 16 );
 
     vec->x = x;
     vec->y = theta;
     FT_Vector  v;
 
 
-    v.x = FT_TRIG_COSCALE >> 2;
+    v.x = FT_TRIG_SCALE >> 8;
     v.y = 0;
     ft_trig_pseudo_rotate( &v, angle );
 
-    return v.x / ( 1 << 12 );
+    return ( v.x + 0x80L ) >> 8;
   }
 
 
     FT_Vector  v;
 
 
-    v.x = FT_TRIG_COSCALE >> 2;
+    v.x = FT_TRIG_SCALE >> 8;
     v.y = 0;
     ft_trig_pseudo_rotate( &v, angle );
 
   FT_Vector_Unit( FT_Vector*  vec,
                   FT_Angle    angle )
   {
-    vec->x = FT_TRIG_COSCALE >> 2;
+    if ( !vec )
+      return;
+
+    vec->x = FT_TRIG_SCALE >> 8;
     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;
   }
 
 
     FT_Vector  v;
 
 
+    if ( !vec )
+      return;
+
     v.x   = vec->x;
     v.y   = vec->y;
 
       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 );
       }
     }
   }
     FT_Vector  v;
 
 
+    if ( !vec )
+      return 0;
+
     v = *vec;
 
     /* 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 )
     {
-      return ( v.x >= 0 ) ? v.x : -v.x;
+      return FT_ABS( v.x );
     }
 
     /* general case */
     if ( shift > 0 )
       return ( v.x + ( 1 << ( shift - 1 ) ) ) >> shift;
 
-    return v.x << -shift;
+    return (FT_Fixed)( (FT_UInt32)v.x << -shift );
   }
 
 
     FT_Vector  v;
 
 
+    if ( !vec || !length || !angle )
+      return;
+
     v = *vec;
 
     if ( v.x == 0 && v.y == 0 )
 
     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;
   }
 
                         FT_Fixed    length,
                         FT_Angle    angle )
   {
+    if ( !vec )
+      return;
+
     vec->x = length;
     vec->y = 0;
 
index 885dba5..47af19a 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility file for PS names support (body).                   */
 /*                                                                         */
-/*  Copyright 2002-2004, 2011 by                                           */
+/*  Copyright 2002-2004, 2011, 2014 by                                     */
 /*  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_INTERNAL_DEBUG_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_INTERNAL_SERVICE_H
 #include FT_SERVICE_POSTSCRIPT_INFO_H
   FT_Get_PS_Font_Info( FT_Face          face,
                        PS_FontInfoRec*  afont_info )
   {
-    FT_Error  error = FT_Err_Invalid_Argument;
+    FT_Error           error;
+    FT_Service_PsInfo  service;
 
 
-    if ( face )
-    {
-      FT_Service_PsInfo  service = NULL;
+    if ( !face )
+      return FT_THROW( Invalid_Face_Handle );
 
+    if ( !afont_info )
+      return FT_THROW( Invalid_Argument );
 
-      FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
+    FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
 
-      if ( service && service->ps_get_font_info )
-        error = service->ps_get_font_info( face, afont_info );
-    }
+    if ( service && service->ps_get_font_info )
+      error = service->ps_get_font_info( face, afont_info );
+    else
+      error = FT_THROW( Invalid_Argument );
 
     return error;
   }
@@ -51,8 +55,8 @@
   FT_EXPORT_DEF( FT_Int )
   FT_Has_PS_Glyph_Names( FT_Face  face )
   {
-    FT_Int             result  = 0;
-    FT_Service_PsInfo  service = NULL;
+    FT_Int             result = 0;
+    FT_Service_PsInfo  service;
 
 
     if ( face )
   FT_Get_PS_Font_Private( FT_Face         face,
                           PS_PrivateRec*  afont_private )
   {
-    FT_Error  error = FT_Err_Invalid_Argument;
+    FT_Error           error;
+    FT_Service_PsInfo  service;
 
 
-    if ( face )
-    {
-      FT_Service_PsInfo  service = NULL;
+    if ( !face )
+      return FT_THROW( Invalid_Face_Handle );
 
+    if ( !afont_private )
+      return FT_THROW( Invalid_Argument );
 
-      FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
+    FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
 
-      if ( service && service->ps_get_font_private )
-        error = service->ps_get_font_private( face, afont_private );
-    }
+    if ( service && service->ps_get_font_private )
+      error = service->ps_get_font_private( face, afont_private );
+    else
+      error = FT_THROW( Invalid_Argument );
 
     return error;
   }
index 5f77be5..56e2800 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
     {
       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 */
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
     }
 
     *p_error = error;
@@ -98,6 +98,7 @@
   {
     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 )
     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 > FT_INT_MAX/item_size )
     {
-      error = FT_Err_Array_Too_Large;
+      error = FT_THROW( Array_Too_Large );
     }
     else if ( cur_count == 0 )
     {
 
       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;
     }
     FT_ListNode  cur;
 
 
+    if ( !list )
+      return NULL;
+
     cur = list->head;
     while ( cur )
     {
       cur = cur->next;
     }
 
-    return (FT_ListNode)0;
+    return NULL;
   }
 
 
   FT_List_Add( FT_List      list,
                FT_ListNode  node )
   {
-    FT_ListNode  before = list->tail;
+    FT_ListNode  before;
+
+
+    if ( !list || !node )
+      return;
 
+    before = list->tail;
 
     node->next = 0;
     node->prev = before;
   FT_List_Insert( FT_List      list,
                   FT_ListNode  node )
   {
-    FT_ListNode  after = list->head;
+    FT_ListNode  after;
+
+
+    if ( !list || !node )
+      return;
 
+    after = list->head;
 
     node->next = after;
     node->prev = 0;
     FT_ListNode  before, after;
 
 
+    if ( !list || !node )
+      return;
+
     before = node->prev;
     after  = node->next;
 
     FT_ListNode  before, after;
 
 
+    if ( !list || !node )
+      return;
+
     before = node->prev;
     after  = node->next;
 
   /* documentation is in ftlist.h */
 
   FT_EXPORT_DEF( FT_Error )
-  FT_List_Iterate( FT_List            list,
-                   FT_List_Iterator   iterator,
-                   void*              user )
+  FT_List_Iterate( FT_List           list,
+                   FT_List_Iterator  iterator,
+                   void*             user )
   {
-    FT_ListNode  cur   = list->head;
+    FT_ListNode  cur;
     FT_Error     error = FT_Err_Ok;
 
 
+    if ( !list || !iterator )
+      return FT_THROW( Invalid_Argument );
+
+    cur = list->head;
+
     while ( cur )
     {
       FT_ListNode  next = cur->next;
     FT_ListNode  cur;
 
 
+    if ( !list || !memory )
+      return;
+
     cur = list->head;
     while ( cur )
     {
   }
 
 
-  FT_BASE_DEF( FT_UInt32 )
-  ft_highpow2( FT_UInt32  value )
-  {
-    FT_UInt32  value2;
-
-
-    /*
-     *  We simply clear the lowest bit in each iteration.  When
-     *  we reach 0, we know that the previous value was our result.
-     */
-    for ( ;; )
-    {
-      value2 = value & (value - 1);  /* clear lowest bit */
-      if ( value2 == 0 )
-        break;
-
-      value = value2;
-    }
-    return value;
-  }
-
-
-#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 */
index bc2e90e..8e337fb 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for accessing Windows FNT specific info (body).         */
 /*                                                                         */
-/*  Copyright 2003, 2004 by                                                */
+/*  Copyright 2003, 2004, 2014 by                                          */
 /*  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_INTERNAL_DEBUG_H
 #include FT_WINFONTS_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_WINFNT_H
     FT_Error           error;
 
 
-    error = FT_Err_Invalid_Argument;
+    if ( !face )
+      return FT_THROW( Invalid_Face_Handle );
 
-    if ( face != NULL )
-    {
-      FT_FACE_LOOKUP_SERVICE( face, service, WINFNT );
+    if ( !header )
+      return FT_THROW( Invalid_Argument );
 
-      if ( service != NULL )
-      {
-        error = service->get_header( face, header );
-      }
-    }
+    FT_FACE_LOOKUP_SERVICE( face, service, WINFNT );
+
+    if ( service )
+      error = service->get_header( face, header );
+    else
+      error = FT_THROW( Invalid_Argument );
 
     return error;
   }
diff --git a/src/base/md5.c b/src/base/md5.c
new file mode 100644 (file)
index 0000000..52d96ac
--- /dev/null
@@ -0,0 +1,296 @@
+/*
+ * 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 H2(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 const void *body(MD5_CTX *ctx, const void *data, unsigned long size)
+{
+       const unsigned char *ptr;
+       MD5_u32plus a, b, c, d;
+       MD5_u32plus saved_a, saved_b, saved_c, saved_d;
+
+       ptr = (const 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(H2, d, a, b, c, GET(8), 0x8771f681, 11)
+               STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16)
+               STEP(H2, b, c, d, a, GET(14), 0xfde5380c, 23)
+               STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4)
+               STEP(H2, d, a, b, c, GET(4), 0x4bdecfa9, 11)
+               STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16)
+               STEP(H2, b, c, d, a, GET(10), 0xbebfbc70, 23)
+               STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4)
+               STEP(H2, d, a, b, c, GET(0), 0xeaa127fa, 11)
+               STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16)
+               STEP(H2, b, c, d, a, GET(6), 0x04881d05, 23)
+               STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4)
+               STEP(H2, d, a, b, c, GET(12), 0xe6db99e5, 11)
+               STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16)
+               STEP(H2, 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, const void *data, unsigned long size)
+{
+       MD5_u32plus saved_lo;
+       unsigned long used, available;
+
+       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) {
+               available = 64 - used;
+
+               if (size < available) {
+                       memcpy(&ctx->buffer[used], data, size);
+                       return;
+               }
+
+               memcpy(&ctx->buffer[used], data, available);
+               data = (const unsigned char *)data + available;
+               size -= available;
+               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, available;
+
+       used = ctx->lo & 0x3f;
+
+       ctx->buffer[used++] = 0x80;
+
+       available = 64 - used;
+
+       if (available < 8) {
+               memset(&ctx->buffer[used], 0, available);
+               body(ctx, ctx->buffer, 64);
+               used = 0;
+               available = 64;
+       }
+
+       memset(&ctx->buffer[used], 0, available - 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/src/base/md5.h b/src/base/md5.h
new file mode 100644 (file)
index 0000000..2da44bf
--- /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, const void *data, unsigned long size);
+extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
+
+#endif
index 10f578a..cbd8107 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,
@@ -19,8 +19,8 @@
 #   BASE_OBJ_S:   The single-object base layer.
 #   BASE_OBJ_M:   A list of all objects for a multiple-objects build.
 #   BASE_EXT_OBJ: A list of base layer extensions, i.e., components found
-#                 in `freetype/src/base' which are not compiled within the
-#                 base layer proper.
+#                 in `src/base' which are not compiled within the base
+#                 layer proper.
 
 
 BASE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SRC_DIR)/base)
@@ -33,12 +33,14 @@ BASE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SRC_DIR)/base)
 # All files listed here should be included in `ftbase.c' (for a `single'
 # build).
 #
-BASE_SRC := $(BASE_DIR)/ftadvanc.c \
+BASE_SRC := $(BASE_DIR)/basepic.c  \
+            $(BASE_DIR)/ftadvanc.c \
             $(BASE_DIR)/ftcalc.c   \
             $(BASE_DIR)/ftdbgmem.c \
             $(BASE_DIR)/ftgloadr.c \
             $(BASE_DIR)/ftobjs.c   \
             $(BASE_DIR)/ftoutln.c  \
+            $(BASE_DIR)/ftpic.c    \
             $(BASE_DIR)/ftrfork.c  \
             $(BASE_DIR)/ftsnames.c \
             $(BASE_DIR)/ftstream.c \
@@ -50,7 +52,11 @@ ifneq ($(ftmac_c),)
   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)/basepic.h \
+          $(BASE_DIR)/ftbase.h  \
+          $(BASE_DIR)/md5.c     \
+          $(BASE_DIR)/md5.h
 
 # Base layer `extensions' sources
 #
index 0edcc77..55a428c 100644 (file)
@@ -2,7 +2,7 @@
 
     FreeType font driver for bdf files
 
-    Copyright (C) 2001-2008, 2011 by
+    Copyright (C) 2001-2008, 2011, 2013, 2014 by
     Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -72,7 +72,7 @@ THE SOFTWARE.
     cmap->num_encodings = face->bdffont->glyphs_used;
     cmap->encodings     = face->en_table;
 
-    return BDF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
@@ -182,7 +182,7 @@ THE SOFTWARE.
   }
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FT_CMap_ClassRec  bdf_cmap_class =
   {
     sizeof ( BDF_CMapRec ),
@@ -198,7 +198,7 @@ THE SOFTWARE.
   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;
@@ -243,8 +243,6 @@ THE SOFTWARE.
          !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) )
       strings[0] = (char *)(prop->value.atom);
 
-    len = 0;
-
     for ( len = 0, nn = 0; nn < 4; nn++ )
     {
       lengths[nn] = 0;
@@ -342,7 +340,7 @@ THE SOFTWARE.
                  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 );
 
@@ -351,7 +349,6 @@ THE SOFTWARE.
 
     FT_UNUSED( num_params );
     FT_UNUSED( params );
-    FT_UNUSED( face_index );
 
 
     FT_TRACE2(( "BDF driver\n" ));
@@ -365,7 +362,7 @@ THE SOFTWARE.
     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 BDF file\n" ));
       goto Fail;
@@ -375,6 +372,19 @@ THE SOFTWARE.
 
     /* we have a bdf font: let's construct the face object */
     face->bdffont = font;
+
+    /* BDF could not have multiple face in single font file.
+     * XXX: non-zero face_index is already invalid argument, but
+     *      Type1, Type42 driver has a convention to return
+     *      an invalid argument error when the font could be
+     *      opened by the specified driver.
+     */
+    if ( face_index > 0 ) {
+      FT_ERROR(( "BDF_Face_Init: invalid face index\n" ));
+      BDF_Face_Done( bdfface );
+      return FT_THROW( Invalid_Argument );
+    }
+
     {
       bdf_property_t*  prop = NULL;
 
@@ -388,9 +398,10 @@ THE SOFTWARE.
 
       bdfface->num_faces  = 1;
       bdfface->face_index = 0;
-      bdfface->face_flags = FT_FACE_FLAG_FIXED_SIZES |
-                            FT_FACE_FLAG_HORIZONTAL  |
-                            FT_FACE_FLAG_FAST_GLYPHS;
+
+      bdfface->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
+                             FT_FACE_FLAG_HORIZONTAL  |
+                             FT_FACE_FLAG_FAST_GLYPHS;
 
       prop = bdf_get_font_property( font, "SPACING" );
       if ( prop && prop->format == BDF_ATOM                             &&
@@ -591,7 +602,7 @@ THE SOFTWARE.
 
   Fail:
     BDF_Face_Done( bdfface );
-    return BDF_Err_Unknown_File_Format;
+    return FT_THROW( Unknown_File_Format );
   }
 
 
@@ -608,7 +619,7 @@ THE SOFTWARE.
     size->metrics.descender   = -bdffont->font_descent << 6;
     size->metrics.max_advance = bdffont->bbx.width << 6;
 
-    return BDF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
@@ -619,7 +630,7 @@ THE SOFTWARE.
     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;
 
 
@@ -630,17 +641,17 @@ THE SOFTWARE.
     {
     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 ) )
-        error = BDF_Err_Ok;
+        error = FT_Err_Ok;
       break;
 
     default:
-      error = BDF_Err_Unimplemented_Feature;
+      error = FT_THROW( Unimplemented_Feature );
       break;
     }
 
@@ -660,7 +671,7 @@ THE SOFTWARE.
   {
     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;
@@ -668,12 +679,20 @@ THE SOFTWARE.
     FT_UNUSED( load_flags );
 
 
-    if ( !face || glyph_index >= (FT_UInt)face->num_glyphs )
+    if ( !face )
     {
-      error = BDF_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Face_Handle );
       goto Exit;
     }
 
+    if ( glyph_index >= (FT_UInt)face->num_glyphs )
+    {
+      error = FT_THROW( Invalid_Argument );
+      goto Exit;
+    }
+
+    FT_TRACE1(( "BDF_Glyph_Load: glyph index %d\n", glyph_index ));
+
     /* index 0 is the undefined glyph */
     if ( glyph_index == 0 )
       glyph_index = bdf->default_glyph;
@@ -786,7 +805,7 @@ THE SOFTWARE.
     }
 
   Fail:
-    return BDF_Err_Invalid_Argument;
+    return FT_THROW( Invalid_Argument );
   }
 
 
@@ -864,10 +883,6 @@ THE SOFTWARE.
     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,
 
     0,                          /* FT_Face_GetKerningFunc  */
index b7b6857..abcfdee 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright 2000 Computing Research Labs, New Mexico State University
- * Copyright 2001-2012
+ * Copyright 2001-2014
  *   Francesco Zappa Nardelli
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
                         sizeof ( _bdf_properties[0] );
 
 
+  /* An auxiliary macro to parse properties, to be used in conditionals. */
+  /* It behaves like `strncmp' but also tests the following character    */
+  /* whether it is a whitespace or NULL.                                 */
+  /* `property' is a constant string of length `n' to compare with.      */
+#define _bdf_strncmp( name, property, n )      \
+          ( ft_strncmp( name, property, n ) || \
+            !( name[n] == ' '  ||              \
+               name[n] == '\0' ||              \
+               name[n] == '\n' ||              \
+               name[n] == '\r' ||              \
+               name[n] == '\t' )            )
+
   /* Auto correction messages. */
 #define ACMSG1   "FONT_ASCENT property missing.  " \
                  "Added `FONT_ASCENT %hd'.\n"
   {
     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;
   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;
                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;
   _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 )
 
       if ( oldsize == bigsize )
       {
-        error = BDF_Err_Out_Of_Memory;
+        error = FT_THROW( Out_Of_Memory );
         goto Exit;
       }
       else if ( newsize < oldsize || newsize > bigsize )
                   unsigned long  *alen )
   {
     unsigned long  i, j;
-    char           *fp, *dp;
+    char*          dp;
 
 
     *alen = 0;
     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++;
 
     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->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. */
     /* this, so an error is signaled.                                 */
     if ( separators == 0 || *separators == 0 )
     {
-      error = BDF_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     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_Error          error = BDF_Err_Ok;
+    FT_Error          error  = FT_Err_Ok;
 
 
     if ( callback == 0 )
     {
-      error = BDF_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     lineno  = 1;
     buf[0]  = 0;
     start   = 0;
-    end     = 0;
     avail   = 0;
     cursor  = 0;
     refill  = 1;
           if ( buf_size >= 65536UL )  /* limit ourselves to 64KByte */
           {
             FT_ERROR(( "_bdf_readstream: " ERRMSG6, lineno ));
-            error = BDF_Err_Invalid_Argument;
+            error = FT_THROW( Invalid_Argument );
             goto Exit;
           }
 
         {
           bytes = avail - start;
 
-          FT_MEM_COPY( buf, buf + start, bytes );
+          FT_MEM_MOVE( buf, buf + start, bytes );
 
           cursor = bytes;
           avail -= bytes;
       hold     = buf[end];
       buf[end] = 0;
 
-      /* 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 )
-          error = (*cb)( buf + start, end - start, lineno,
+          error = (*cb)( buf + start, (unsigned long)( end - start ), lineno,
                          (void*)&cb, client_data );
         if ( error )
           break;
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
   };
 
   static const unsigned char  odigits[32] =
   {
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
   static const unsigned char  ddigits[32] =
   {
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
   static const unsigned char  hdigits[32] =
   {
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03,
-    0x7e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03,
+    0x7E, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   };
 
 
-#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,
       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 )
       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 )
       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 )
     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 whether the property has        */
 
     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;
   {
     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,
     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 )
     {
-      error = BDF_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     if ( len >= 256 )
     {
       FT_ERROR(( "_bdf_set_default_spacing: " ERRMSG7, lineno ));
-      error = BDF_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       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;
 
     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 whether the property already exists in the font. */
 
     /* If the property happens to be a comment, then it doesn't need */
     /* to be added to the internal hash table.                       */
-    if ( ft_memcmp( name, "COMMENT", 7 ) != 0 )
+    if ( _bdf_strncmp( name, "COMMENT", 7 ) != 0 )
     {
       /* Add the property to the font property table. */
       error = hash_insert( fp->name,
     /* FONT_ASCENT and FONT_DESCENT need to be assigned if they are        */
     /* present, and the SPACING property should override the default       */
     /* spacing.                                                            */
-    if ( ft_memcmp( name, "DEFAULT_CHAR", 12 ) == 0 )
+    if ( _bdf_strncmp( name, "DEFAULT_CHAR", 12 ) == 0 )
       font->default_char = fp->value.l;
-    else if ( ft_memcmp( name, "FONT_ASCENT", 11 ) == 0 )
+    else if ( _bdf_strncmp( name, "FONT_ASCENT", 11 ) == 0 )
       font->font_ascent = fp->value.l;
-    else if ( ft_memcmp( name, "FONT_DESCENT", 12 ) == 0 )
+    else if ( _bdf_strncmp( name, "FONT_DESCENT", 12 ) == 0 )
       font->font_descent = fp->value.l;
-    else if ( ft_memcmp( name, "SPACING", 7 ) == 0 )
+    else if ( _bdf_strncmp( name, "SPACING", 7 ) == 0 )
     {
       if ( !fp->value.atom )
       {
         FT_ERROR(( "_bdf_add_property: " ERRMSG8, lineno, "SPACING" ));
-        error = BDF_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
     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 */
     memory = font->memory;
 
     /* Check for a comment. */
-    if ( ft_memcmp( line, "COMMENT", 7 ) == 0 )
+    if ( _bdf_strncmp( line, "COMMENT", 7 ) == 0 )
     {
       linelen -= 7;
 
     /* The very first thing expected is the number of glyphs. */
     if ( !( p->flags & _BDF_GLYPHS ) )
     {
-      if ( ft_memcmp( line, "CHARS", 5 ) != 0 )
+      if ( _bdf_strncmp( 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;
       }
 
       if ( p->cnt >= 0x110000UL )
       {
         FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG5, lineno, "CHARS" ));
-        error = BDF_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Exit;
       }
 
     }
 
     /* Check for the ENDFONT field. */
-    if ( ft_memcmp( line, "ENDFONT", 7 ) == 0 )
+    if ( _bdf_strncmp( line, "ENDFONT", 7 ) == 0 )
     {
+      if ( p->flags & _BDF_GLYPH_BITS )
+      {
+        /* Missing ENDCHAR field. */
+        FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENDCHAR" ));
+        error = FT_THROW( Corrupted_Font_Glyphs );
+        goto Exit;
+      }
+
       /* Sort the glyphs by encoding. */
       ft_qsort( (char *)font->glyphs,
                 font->glyphs_used,
     }
 
     /* Check for the ENDCHAR field. */
-    if ( ft_memcmp( line, "ENDCHAR", 7 ) == 0 )
+    if ( _bdf_strncmp( line, "ENDCHAR", 7 ) == 0 )
     {
       p->glyph_enc = 0;
       p->flags    &= ~_BDF_GLYPH_BITS;
       goto Exit;
 
     /* Check for the STARTCHAR field. */
-    if ( ft_memcmp( line, "STARTCHAR", 9 ) == 0 )
+    if ( _bdf_strncmp( line, "STARTCHAR", 9 ) == 0 )
     {
       /* Set the character name in the parse info first until the */
       /* encoding can be checked for an unencoded character.      */
       if ( !s )
       {
         FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG8, lineno, "STARTCHAR" ));
-        error = BDF_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
     }
 
     /* Check for the ENCODING field. */
-    if ( ft_memcmp( line, "ENCODING", 8 ) == 0 )
+    if ( _bdf_strncmp( line, "ENCODING", 8 ) == 0 )
     {
       if ( !( p->flags & _BDF_GLYPH ) )
       {
         /* 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;
       }
 
       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 ) * 8 )
+      if ( p->glyph_enc > 0                                      &&
+           (size_t)p->glyph_enc >= sizeof ( p->have ) /
+                                   sizeof ( unsigned long ) * 32 )
       {
         FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG5, lineno, "ENCODING" ));
-        error = BDF_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
       for ( i = 0; i < nibbles; i++ )
       {
         c = line[i];
-        if ( !isdigok( hdigits, c ) )
+        if ( !sbitset( hdigits, c ) )
           break;
         *bp = (FT_Byte)( ( *bp << 4 ) + a2i[c] );
         if ( i + 1 < nibbles && ( i & 1 ) )
 
       /* If any line has extra columns, indicate they have been removed. */
       if ( i == nibbles                           &&
-           isdigok( hdigits, line[nibbles] )      &&
+           sbitset( hdigits, line[nibbles] )      &&
            !( p->flags & _BDF_GLYPH_WIDTH_CHECK ) )
       {
         FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG14, glyph->encoding ));
     }
 
     /* Expect the SWIDTH (scalable width) field next. */
-    if ( ft_memcmp( line, "SWIDTH", 6 ) == 0 )
+    if ( _bdf_strncmp( line, "SWIDTH", 6 ) == 0 )
     {
       if ( !( p->flags & _BDF_ENCODING ) )
         goto Missing_Encoding;
     }
 
     /* Expect the DWIDTH (scalable width) field next. */
-    if ( ft_memcmp( line, "DWIDTH", 6 ) == 0 )
+    if ( _bdf_strncmp( line, "DWIDTH", 6 ) == 0 )
     {
       if ( !( p->flags & _BDF_ENCODING ) )
         goto Missing_Encoding;
     }
 
     /* Expect the BBX field next. */
-    if ( ft_memcmp( line, "BBX", 3 ) == 0 )
+    if ( _bdf_strncmp( line, "BBX", 3 ) == 0 )
     {
       if ( !( p->flags & _BDF_ENCODING ) )
         goto Missing_Encoding;
     }
 
     /* And finally, gather up the bitmap. */
-    if ( ft_memcmp( line, "BITMAP", 6 ) == 0 )
+    if ( _bdf_strncmp( line, "BITMAP", 6 ) == 0 )
     {
       unsigned long  bitmap_size;
 
       {
         /* 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;
       }
 
       if ( glyph->bpr > 0xFFFFU || bitmap_size > 0xFFFFU )
       {
         FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG4, lineno ));
-        error = BDF_Err_Bbx_Too_Big;
+        error = FT_THROW( Bbx_Too_Big );
         goto Exit;
       }
       else
     }
 
     FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG9, lineno ));
-    error = BDF_Err_Invalid_File_Format;
+    error = FT_THROW( Invalid_File_Format );
     goto Exit;
 
   Missing_Encoding:
     /* Missing ENCODING field. */
     FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENCODING" ));
-    error = BDF_Err_Missing_Encoding_Field;
+    error = FT_THROW( Missing_Encoding_Field );
 
   Exit:
     if ( error && ( p->flags & _BDF_GLYPH ) )
     char*              name;
     char*              value;
     char               nbuf[128];
-    FT_Error           error = BDF_Err_Ok;
+    FT_Error           error = FT_Err_Ok;
 
     FT_UNUSED( lineno );
 
     p    = (_bdf_parse_t *)    client_data;
 
     /* Check for the end of the properties. */
-    if ( ft_memcmp( line, "ENDPROPERTIES", 13 ) == 0 )
+    if ( _bdf_strncmp( line, "ENDPROPERTIES", 13 ) == 0 )
     {
       /* If the FONT_ASCENT or FONT_DESCENT properties have not been      */
       /* encountered yet, then make sure they are added as properties and */
     }
 
     /* Ignore the _XFREE86_GLYPH_RANGES properties. */
-    if ( ft_memcmp( line, "_XFREE86_GLYPH_RANGES", 21 ) == 0 )
+    if ( _bdf_strncmp( line, "_XFREE86_GLYPH_RANGES", 21 ) == 0 )
       goto Exit;
 
     /* Handle COMMENT fields and properties in a special way to preserve */
     /* the spacing.                                                      */
-    if ( ft_memcmp( line, "COMMENT", 7 ) == 0 )
+    if ( _bdf_strncmp( line, "COMMENT", 7 ) == 0 )
     {
       name = value = line;
       value += 7;
     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 */
 
 
     /* Check for a comment.  This is done to handle those fonts that have */
     /* comments before the STARTFONT line for some reason.                */
-    if ( ft_memcmp( line, "COMMENT", 7 ) == 0 )
+    if ( _bdf_strncmp( line, "COMMENT", 7 ) == 0 )
     {
       if ( p->opts->keep_comments != 0 && p->font != 0 )
       {
     {
       memory = p->memory;
 
-      if ( ft_memcmp( line, "STARTFONT", 9 ) != 0 )
+      if ( _bdf_strncmp( line, "STARTFONT", 9 ) != 0 )
       {
         /* we don't emit an error message since this code gets */
         /* explicitly caught one level higher                  */
-        error = BDF_Err_Missing_Startfont_Field;
+        error = FT_THROW( Missing_Startfont_Field );
         goto Exit;
       }
 
     }
 
     /* Check for the start of the properties. */
-    if ( ft_memcmp( line, "STARTPROPERTIES", 15 ) == 0 )
+    if ( _bdf_strncmp( line, "STARTPROPERTIES", 15 ) == 0 )
     {
       if ( !( p->flags & _BDF_FONT_BBX ) )
       {
         /* 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;
       }
 
       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;
+      }
 
       p->flags |= _BDF_PROPS;
       *next     = _bdf_parse_properties;
     }
 
     /* Check for the FONTBOUNDINGBOX field. */
-    if ( ft_memcmp( line, "FONTBOUNDINGBOX", 15 ) == 0 )
+    if ( _bdf_strncmp( line, "FONTBOUNDINGBOX", 15 ) == 0 )
     {
       if ( !( p->flags & _BDF_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;
       }
 
     }
 
     /* The next thing to check for is the FONT field. */
-    if ( ft_memcmp( line, "FONT", 4 ) == 0 )
+    if ( _bdf_strncmp( line, "FONT", 4 ) == 0 )
     {
       error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
       if ( !s )
       {
         FT_ERROR(( "_bdf_parse_start: " ERRMSG8, lineno, "FONT" ));
-        error = BDF_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
     }
 
     /* Check for the SIZE field. */
-    if ( ft_memcmp( line, "SIZE", 4 ) == 0 )
+    if ( _bdf_strncmp( line, "SIZE", 4 ) == 0 )
     {
       if ( !( p->flags & _BDF_FONT_NAME ) )
       {
         /* 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;
       }
 
     }
 
     /* Check for the CHARS field -- font properties are optional */
-    if ( ft_memcmp( line, "CHARS", 5 ) == 0 )
+    if ( _bdf_strncmp( line, "CHARS", 5 ) == 0 )
     {
       char  nbuf[128];
 
       {
         /* 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;
       }
 
     }
 
     FT_ERROR(( "_bdf_parse_start: " ERRMSG9, lineno ));
-    error = BDF_Err_Invalid_File_Format;
+    error = FT_THROW( Invalid_File_Format );
 
   Exit:
     return error;
     unsigned long  lineno = 0; /* make compiler happy */
     _bdf_parse_t   *p     = NULL;
 
-    FT_Memory      memory = extmemory;
-    FT_Error       error  = BDF_Err_Ok;
+    FT_Memory  memory = extmemory; /* needed for FT_NEW */
+    FT_Error   error  = FT_Err_Ok;
 
 
     if ( FT_NEW( p ) )
     {
       /* If the font is not proportional, set the font's monowidth */
       /* field to the width of the font bounding box.              */
-      memory = p->font->memory;
 
       if ( p->font->spacing != BDF_PROPORTIONAL )
         p->font->monowidth = p->font->bbx.width;
       {
         /* Error happened while parsing header. */
         FT_ERROR(( "bdf_load_font: " ERRMSG2, lineno ));
-        error = BDF_Err_Corrupted_Font_Header;
+        error = FT_THROW( Corrupted_Font_Header );
         goto Exit;
       }
       else
       {
         /* Error happened when parsing glyphs. */
         FT_ERROR(( "bdf_load_font: " ERRMSG3, lineno ));
-        error = BDF_Err_Corrupted_Font_Glyphs;
+        error = FT_THROW( Corrupted_Font_Glyphs );
         goto Exit;
       }
     }
         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;
 
index d60ee3e..7e406b1 100644 (file)
@@ -8,7 +8,7 @@
 /*  parse compressed PCF fonts, as found with many X11 server              */
 /*  distributions.                                                         */
 /*                                                                         */
-/*  Copyright 2010, 2012 by                                                */
+/*  Copyright 2010, 2012-2014 by                                           */
 /*  Joel Klinghed.                                                         */
 /*                                                                         */
 /*  Based on src/gzip/ftgzip.c, Copyright 2002 - 2010 by                   */
   static FT_Error
   ft_bzip2_check_header( FT_Stream  stream )
   {
-    FT_Error  error = Bzip2_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_Byte   head[4];
 
 
     /* 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[1] != 0x5A  ||
          head[2] != 0x68  )  /* only support bzip2 (huffman) */
     {
-      error = Bzip2_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
                       FT_Stream     source )
   {
     bz_stream*  bzstream = &zip->bzstream;
-    FT_Error    error    = Bzip2_Err_Ok;
+    FT_Error    error    = FT_Err_Ok;
 
 
     zip->stream = stream;
 
     if ( BZ2_bzDecompressInit( bzstream, 0, 0 ) != BZ_OK ||
          bzstream->next_in == NULL                       )
-      error = Bzip2_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
 
   Exit:
     return error;
       size = stream->read( stream, stream->pos, zip->input,
                            FT_BZIP2_BUFFER_SIZE );
       if ( size == 0 )
-        return Bzip2_Err_Invalid_Stream_Operation;
+        return FT_THROW( Invalid_Stream_Operation );
     }
     else
     {
         size = FT_BZIP2_BUFFER_SIZE;
 
       if ( size == 0 )
-        return Bzip2_Err_Invalid_Stream_Operation;
+        return FT_THROW( Invalid_Stream_Operation );
 
       FT_MEM_COPY( zip->input, stream->base + stream->pos, size );
     }
     bzstream->next_in  = (char*)zip->input;
     bzstream->avail_in = size;
 
-    return Bzip2_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   ft_bzip2_file_fill_output( FT_BZip2File  zip )
   {
     bz_stream*  bzstream = &zip->bzstream;
-    FT_Error    error    = Bzip2_Err_Ok;
+    FT_Error    error    = FT_Err_Ok;
 
 
     zip->cursor         = zip->buffer;
       {
         zip->limit = (FT_Byte*)bzstream->next_out;
         if ( zip->limit == zip->cursor )
-          error = Bzip2_Err_Invalid_Stream_Operation;
+          error = FT_THROW( Invalid_Stream_Operation );
         break;
       }
       else if ( err != BZ_OK )
       {
-        error = Bzip2_Err_Invalid_Stream_Operation;
+        error = FT_THROW( Invalid_Stream_Operation );
         break;
       }
     }
   ft_bzip2_file_skip_output( FT_BZip2File  zip,
                              FT_ULong      count )
   {
-    FT_Error  error = Bzip2_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_ULong  delta;
 
 
                        FT_Stream  source )
   {
     FT_Error      error;
-    FT_Memory     memory = source->memory;
+    FT_Memory     memory;
     FT_BZip2File  zip = NULL;
 
 
+    if ( !stream || !source )
+    {
+      error = FT_THROW( Invalid_Stream_Handle );
+      goto Exit;
+    }
+
+    memory = source->memory;
+
     /*
      *  check the header right now; this prevents allocating unnecessary
      *  objects when we don't need them
     FT_UNUSED( stream );
     FT_UNUSED( source );
 
-    return Bzip2_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
   }
 
 #endif /* !FT_CONFIG_OPTION_USE_BZIP2 */
index 340cff7..6563991 100644 (file)
@@ -1,6 +1,6 @@
 # FreeType 2 src/cache Jamfile
 #
-# Copyright 2001, 2003, 2004 by
+# Copyright 2001, 2003, 2004, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -11,7 +11,7 @@
 
 SubDir  FT2_TOP $(FT2_SRC_DIR) cache ;
 
-# The file <freetype/ftcache.h> contains some macro definitions that are
+# The file <ftcache.h> contains some macro definitions that are
 # later used in #include statements related to the cache sub-system.  It
 # needs to be parsed through a HDRMACRO rule for macro definitions.
 #
index d4fc353..6bad39d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType basic cache interface (body).                           */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 by            */
+/*  Copyright 2003-2007, 2009-2011, 2013, 2014 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #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
    *
       return result;
 
     if ( (FT_ULong)face->num_glyphs > FT_UINT_MAX || 0 > face->num_glyphs )
-    {
-      FT_TRACE1(( "ftc_basic_family_get_count: too large number of glyphs " ));
-      FT_TRACE1(( "in this face, truncated\n", face->num_glyphs ));
-    }
+      FT_TRACE1(( "ftc_basic_family_get_count:"
+                  " too large number of glyphs in this face, truncated\n",
+                  face->num_glyphs ));
 
     if ( !error )
       result = (FT_UInt)face->num_glyphs;
           }
         }
         else
-          error = FTC_Err_Invalid_Argument;
+          error = FT_THROW( Invalid_Argument );
       }
     }
 
   *
   */
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FTC_IFamilyClassRec  ftc_basic_image_family_class =
   {
     {
   };
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FTC_GCacheClassRec  ftc_basic_image_cache_class =
   {
     {
     FT_PtrDist         hash;
 
 
-    /* some argument checks are delayed to FTC_Cache_Lookup */
+    /* some argument checks are delayed to `FTC_Cache_Lookup' */
     if ( !aglyph )
     {
-      error = FTC_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     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 )
-      {
-        FT_TRACE1(( "FTC_ImageCache_Lookup: higher bits in load_flags" ));
-        FT_TRACE1(( "0x%x are dropped\n", (type->flags & ~((FT_ULong)FT_UINT_MAX)) ));
-      }
+    if ( (FT_ULong)( type->flags - FT_INT_MIN ) > FT_UINT_MAX )
+      FT_TRACE1(( "FTC_ImageCache_Lookup:"
+                  " higher bits in load_flags 0x%x are dropped\n",
+                  type->flags & ~((FT_ULong)FT_UINT_MAX) ));
 
-      query.attrs.scaler.face_id = type->face_id;
-      query.attrs.scaler.width   = type->width;
-      query.attrs.scaler.height  = type->height;
-      query.attrs.load_flags     = (FT_UInt)type->flags;
-    }
+    query.attrs.scaler.face_id = type->face_id;
+    query.attrs.scaler.width   = type->width;
+    query.attrs.scaler.height  = type->height;
+    query.attrs.load_flags     = (FT_UInt)type->flags;
 
     query.attrs.scaler.pixel = 1;
     query.attrs.scaler.x_res = 0;  /* make compilers happy */
     FT_PtrDist         hash;
 
 
-    /* some argument checks are delayed to FTC_Cache_Lookup */
+    /* some argument checks are delayed to `FTC_Cache_Lookup' */
     if ( !aglyph || !scaler )
     {
-      error = FTC_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     if ( anode )
       *anode  = NULL;
 
-    /* FT_Load_Glyph(), FT_Load_Char() take FT_UInt flags */
+    /* `FT_Load_Glyph' and `FT_Load_Char' take FT_UInt flags */
     if ( load_flags > FT_UINT_MAX )
-    {
-      FT_TRACE1(( "FTC_ImageCache_LookupScaler: higher bits in load_flags" ));
-      FT_TRACE1(( "0x%x are dropped\n", (load_flags & ~((FT_ULong)FT_UINT_MAX)) ));
-    }
+      FT_TRACE1(( "FTC_ImageCache_LookupScaler:"
+                  " higher bits in load_flags 0x%x are dropped\n",
+                  load_flags & ~((FT_ULong)FT_UINT_MAX) ));
 
     query.attrs.scaler     = scaler[0];
     query.attrs.load_flags = (FT_UInt)load_flags;
   }
 
 
+  /*
+   *
+   * basic small bitmap cache
+   *
+   */
 
-#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
-  *
-  */
-
-
-  FT_CALLBACK_TABLE_DEF
+  static
   const FTC_SFamilyClassRec  ftc_basic_sbit_family_class =
   {
     {
   };
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FTC_GCacheClassRec  ftc_basic_sbit_cache_class =
   {
     {
     if ( anode )
       *anode = NULL;
 
-    /* other argument checks delayed to FTC_Cache_Lookup */
+    /* other argument checks delayed to `FTC_Cache_Lookup' */
     if ( !ansbit )
-      return FTC_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     *ansbit = NULL;
 
-#if defined( FT_CONFIG_OPTION_OLD_INTERNALS ) && ( FT_INT_MAX > 0xFFFFU )
+    if ( (FT_ULong)( type->flags - FT_INT_MIN ) > FT_UINT_MAX )
+      FT_TRACE1(( "FTC_ImageCache_Lookup:"
+                  " higher bits in load_flags 0x%x are dropped\n",
+                  type->flags & ~((FT_ULong)FT_UINT_MAX) ));
 
-    /*  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 )
-      {
-        FT_TRACE1(( "FTC_ImageCache_Lookup: higher bits in load_flags" ));
-        FT_TRACE1(( "0x%x are dropped\n", (type->flags & ~((FT_ULong)FT_UINT_MAX)) ));
-      }
-
-      query.attrs.scaler.face_id = type->face_id;
-      query.attrs.scaler.width   = type->width;
-      query.attrs.scaler.height  = type->height;
-      query.attrs.load_flags     = (FT_UInt)type->flags;
-    }
+    query.attrs.scaler.face_id = type->face_id;
+    query.attrs.scaler.width   = type->width;
+    query.attrs.scaler.height  = type->height;
+    query.attrs.load_flags     = (FT_UInt)type->flags;
 
     query.attrs.scaler.pixel = 1;
     query.attrs.scaler.x_res = 0;  /* make compilers happy */
     if ( anode )
         *anode = NULL;
 
-    /* other argument checks delayed to FTC_Cache_Lookup */
+    /* other argument checks delayed to `FTC_Cache_Lookup' */
     if ( !ansbit || !scaler )
-        return FTC_Err_Invalid_Argument;
+        return FT_THROW( Invalid_Argument );
 
     *ansbit = NULL;
 
-    /* FT_Load_Glyph(), FT_Load_Char() take FT_UInt flags */
+    /* `FT_Load_Glyph' and `FT_Load_Char' take FT_UInt flags */
     if ( load_flags > FT_UINT_MAX )
-    {
-      FT_TRACE1(( "FTC_ImageCache_LookupScaler: higher bits in load_flags" ));
-      FT_TRACE1(( "0x%x are dropped\n", (load_flags & ~((FT_ULong)FT_UINT_MAX)) ));
-    }
+      FT_TRACE1(( "FTC_ImageCache_LookupScaler:"
+                  " higher bits in load_flags 0x%x are dropped\n",
+                  load_flags & ~((FT_ULong)FT_UINT_MAX) ));
 
     query.attrs.scaler     = scaler[0];
     query.attrs.load_flags = (FT_UInt)load_flags;
   }
 
 
-#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 */
index f01c403..f20dd45 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    The FreeType internal cache interface (body).                        */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010,   */
-/*            2011 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,       */
 
 
   /* remove a node from the cache manager */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-  FT_BASE_DEF( void )
-#else
   FT_LOCAL_DEF( void )
-#endif
   ftc_node_destroy( FTC_Node     node,
                     FTC_Manager  manager )
   {
     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 )
-      return FTC_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     /* Go to the `top' node of the list sharing same masked hash */
     bucket = pnode = FTC_NODE__TOP_FOR_HASH( cache, hash );
index d60984f..4155f32 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    FreeType internal cache interface (specification).                   */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010,   */
-/*            2011 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,       */
@@ -87,12 +86,6 @@ FT_BEGIN_HEADER
         ftc_get_top_node_for_hash( ( cache ), ( hash ) )
 #endif
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-  FT_BASE( void )
-  ftc_node_destroy( FTC_Node     node,
-                    FTC_Manager  manager );
-#endif
-
 
   /*************************************************************************/
   /*************************************************************************/
@@ -223,7 +216,7 @@ FT_BEGIN_HEADER
     FT_Bool               _list_changed = FALSE;                         \
                                                                          \
                                                                          \
-    error = FTC_Err_Ok;                                                  \
+    error = FT_Err_Ok;                                                   \
     node  = NULL;                                                        \
                                                                          \
     /* Go to the `top' node of the list sharing same masked hash */      \
@@ -328,7 +321,7 @@ FT_BEGIN_HEADER
 
 
 #define FTC_CACHE_TRYLOOP_END( list_changed )                     \
-      if ( !error || error != FTC_Err_Out_Of_Memory )             \
+      if ( !error || FT_ERR_NEQ( error, Out_Of_Memory ) )         \
         break;                                                    \
                                                                   \
       _try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \
index 80ec9ce..9528279 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Callback functions of the caching sub-system (specification only).   */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2011 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,       */
   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 );
-#endif
+
 
 #endif /* __FTCCBACK_H__ */
 
index ad436ef..ab22366 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    FreeType CharMap cache (body)                                        */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010, 2011 by                                                */
+/*  Copyright 2000-2014 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #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 */
 
   /* 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_TABLE_DEF
+  static
   const FTC_CacheClassRec  ftc_cmap_cache_class =
   {
     ftc_cmap_node_new,
   }
 
 
-#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 )
       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 */
+    if ( !face_id )
+      return 0;
 
-    {
-      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 );
 
       if ( error )
         goto Exit;
 
-#ifdef FT_MAX_CHARMAP_CACHEABLE
-      /* something rotten can happen with rogue clients */
-      if ( cmap_index > FT_MAX_CHARMAP_CACHEABLE )
-        return 0; /* XXX: should return appropriate error */
-#endif
-
       if ( (FT_UInt)cmap_index < (FT_UInt)face->num_charmaps )
       {
         FT_CharMap  old, cmap  = NULL;
index 76a510d..fff7a08 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType Cache Manager (body).                                       */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by */
+/*  Copyright 2000-2006, 2008-2010, 2013, 2014 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   }
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FTC_MruListClassRec  ftc_size_list_class =
   {
     sizeof ( FTC_SizeNodeRec ),
     FTC_MruNode  mrunode;
 
 
-    if ( asize == NULL )
-      return FTC_Err_Invalid_Argument;
+    if ( !asize || !scaler )
+      return FT_THROW( Invalid_Argument );
 
     *asize = NULL;
 
     if ( !manager )
-      return FTC_Err_Invalid_Cache_Handle;
+      return FT_THROW( Invalid_Cache_Handle );
 
 #ifdef FTC_INLINE
 
   }
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FTC_MruListClassRec  ftc_face_list_class =
   {
     sizeof ( FTC_FaceNodeRec),
     FTC_MruNode  mrunode;
 
 
-    if ( aface == NULL )
-      return FTC_Err_Invalid_Argument;
+    if ( !aface || !face_id )
+      return FT_THROW( Invalid_Argument );
 
     *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
 
 
     if ( !library )
-      return FTC_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
+
+    if ( !amanager || !requester )
+      return FT_THROW( Invalid_Argument );
 
     memory = library->memory;
 
   FT_EXPORT_DEF( void )
   FTC_Manager_Reset( FTC_Manager  manager )
   {
-    if ( manager )
-    {
-      FTC_MruList_Reset( &manager->sizes );
-      FTC_MruList_Reset( &manager->faces );
-    }
-    /* XXX: FIXME: flush the caches? */
+    if ( !manager )
+      return;
+
+    FTC_MruList_Reset( &manager->sizes );
+    FTC_MruList_Reset( &manager->faces );
+
+    FTC_Manager_FlushN( manager, manager->num_nodes );
   }
 
 
     /* check node weights */
     if ( first )
     {
-      FT_ULong  weight = 0;
+      FT_Offset  weight = 0;
 
 
       node = first;
                              FTC_CacheClass   clazz,
                              FTC_Cache       *acache )
   {
-    FT_Error   error = FTC_Err_Invalid_Argument;
+    FT_Error   error = FT_ERR( Invalid_Argument );
     FTC_Cache  cache = NULL;
 
 
 
       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_UInt  nn;
 
+
+    if ( !manager || !face_id )
+      return;
+
     /* this will remove all FTC_SizeNode that correspond to
      * the face_id as well
      */
   FTC_Node_Unref( FTC_Node     node,
                   FTC_Manager  manager )
   {
-    if ( node && (FT_UInt)node->cache_index < manager->num_caches )
+    if ( node                                             &&
+         manager                                          &&
+         (FT_UInt)node->cache_index < manager->num_caches )
       node->ref_count--;
   }
 
 
-#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 */
index d6c8516..0aec33c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType Cache Manager (specification).                              */
 /*                                                                         */
-/*  Copyright 2000-2001, 2003, 2004, 2006, 2010 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,       */
@@ -94,8 +94,8 @@ FT_BEGIN_HEADER
     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];
index 8c3797f..6fccf11 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -166,7 +166,7 @@ FT_BEGIN_HEADER
     FTC_MruNode              _first, _node;                                 \
                                                                             \
                                                                             \
-    error  = FTC_Err_Ok;                                                    \
+    error  = FT_Err_Ok;                                                     \
     _first = *(_pfirst);                                                    \
     _node  = NULL;                                                          \
                                                                             \
index 8bf8d60..59727d1 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType sbits manager (body).                                       */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2011 by */
+/*  Copyright 2000-2006, 2009-2011, 2013, 2014 by                          */
 /*  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" ));
-      return FTC_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
     }
 
     sbit  = snode->sbits + ( gindex - gnode->gindex );
         goto BadGlyph;
       }
 
-      /* Check that our values fit into 8-bit containers!       */
+      /* Check whether our values fit into 8-bit containers!    */
       /* If this is not the case, our bitmap is too large       */
       /* and we will leave it as `missing' with sbit.buffer = 0 */
 
-#define CHECK_CHAR( d )  ( temp = (FT_Char)d, temp == d )
-#define CHECK_BYTE( d )  ( temp = (FT_Byte)d, temp == d )
+#define CHECK_CHAR( d )  ( temp = (FT_Char)d, (FT_Int) temp == (FT_Int) d )
+#define CHECK_BYTE( d )  ( temp = (FT_Byte)d, (FT_UInt)temp == (FT_UInt)d )
 
       /* horizontal advance in pixels */
       xadvance = ( slot->advance.x + 32 ) >> 6;
     /* 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;
-      error        = FTC_Err_Ok;
+      error        = FT_Err_Ok;
       if ( asize )
         *asize = 0;
     }
     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;
     }
 
diff --git a/src/cff/cf2arrst.c b/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/src/cff/cf2arrst.h b/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/src/cff/cf2blues.c b/src/cff/cf2blues.c
new file mode 100644 (file)
index 0000000..250f89e
--- /dev/null
@@ -0,0 +1,579 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2blues.c                                                             */
+/*                                                                         */
+/*    Adobe's code for handling Blue Zones (body).                         */
+/*                                                                         */
+/*  Copyright 2009-2014 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;
+
+#if 0
+    CF2_Int  unitsPerEm = font->unitsPerEm;
+
+
+    if ( unitsPerEm == 0 )
+      unitsPerEm = 1000;
+#endif
+
+    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 = cf2_floatToFixed( .6 ) -
+                       FT_MulDiv( cf2_floatToFixed ( .6 ),
+                                  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/src/cff/cf2blues.h b/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/src/cff/cf2error.c b/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/src/cff/cf2error.h b/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/src/cff/cf2fixed.h b/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/src/cff/cf2font.c b/src/cff/cf2font.c
new file mode 100644 (file)
index 0000000..83fd348
--- /dev/null
@@ -0,0 +1,512 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2font.c                                                              */
+/*                                                                         */
+/*    Adobe's code for font instances (body).                              */
+/*                                                                         */
+/*  Copyright 2007-2014 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 <ft2build.h>
+#include FT_INTERNAL_CALC_H
+
+#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,
+                        FT_Int*     darkenParams )
+  {
+    /*
+     * Total darkening amount is computed in 1000 unit character space
+     * using the modified 5 part curve as Adobe's Avalon rasterizer.
+     * The darkening amount is smaller for thicker stems.
+     * It becomes zero when the stem is thicker than 2.333 pixels.
+     *
+     * By default, we use
+     *
+     *   darkenAmount = 0.4 pixels   if scaledStem <= 0.5 pixels,
+     *   darkenAmount = 0.275 pixels if 1 <= scaledStem <= 1.667 pixels,
+     *   darkenAmount = 0 pixel      if scaledStem >= 2.333 pixels,
+     *
+     * and piecewise linear in-between:
+     *
+     *
+     *   darkening
+     *       ^
+     *       |
+     *       |      (x1,y1)
+     *       |--------+
+     *       |         \
+     *       |          \
+     *       |           \          (x3,y3)
+     *       |            +----------+
+     *       |        (x2,y2)         \
+     *       |                         \
+     *       |                          \
+     *       |                           +-----------------
+     *       |                         (x4,y4)
+     *       +--------------------------------------------->   stem
+     *                                                       thickness
+     *
+     *
+     * This corresponds to the following values for the
+     * `darkening-parameters' property:
+     *
+     *   (x1, y1) = (500, 400)
+     *   (x2, y2) = (1000, 275)
+     *   (x3, y3) = (1667, 275)
+     *   (x4, y4) = (2333, 0)
+     *
+     */
+
+    /* Internal calculations are done in units per thousand for */
+    /* convenience. The x axis is scaled stem width in          */
+    /* thousandths of a pixel. That is, 1000 is 1 pixel.        */
+    /* The y axis is darkening amount in thousandths of a pixel.*/
+    /* In the code, below, dividing by ppem and                 */
+    /* adjusting for emRatio converts darkenAmount to character */
+    /* space (font units).                                      */
+    CF2_Fixed  stemWidthPer1000, scaledStem;
+    FT_Int     logBase2;
+
+
+    *darkenAmount = 0;
+
+    if ( boldenAmount == 0 && !stemDarkened )
+      return;
+
+    /* protect against range problems and divide by zero */
+    if ( emRatio < cf2_floatToFixed( .01 ) )
+      return;
+
+    if ( stemDarkened )
+    {
+      FT_Int  x1 = darkenParams[0];
+      FT_Int  y1 = darkenParams[1];
+      FT_Int  x2 = darkenParams[2];
+      FT_Int  y2 = darkenParams[3];
+      FT_Int  x3 = darkenParams[4];
+      FT_Int  y3 = darkenParams[5];
+      FT_Int  x4 = darkenParams[6];
+      FT_Int  y4 = darkenParams[7];
+
+
+      /* convert from true character space to 1000 unit character space; */
+      /* add synthetic emboldening effect                                */
+
+      /* `stemWidthPer1000' will not overflow for a legitimate font      */
+
+      stemWidthPer1000 = FT_MulFix( stemWidth + boldenAmount, emRatio );
+
+      /* `scaledStem' can easily overflow, so we must clamp its maximum  */
+      /* value; the test doesn't need to be precise, but must be         */
+      /* conservative.  The clamp value (default 2333) where             */
+      /* `darkenAmount' is zero is well below the overflow value of      */
+      /* 32767.                                                          */
+      /*                                                                 */
+      /* FT_MSB computes the integer part of the base 2 logarithm.  The  */
+      /* number of bits for the product is 1 or 2 more than the sum of   */
+      /* logarithms; remembering that the 16 lowest bits of the fraction */
+      /* are dropped this is correct to within a factor of almost 4.     */
+      /* For example, 0x80.0000 * 0x80.0000 = 0x4000.0000 is 23+23 and   */
+      /* is flagged as possible overflow because 0xFF.FFFF * 0xFF.FFFF = */
+      /* 0xFFFF.FE00 is also 23+23.                                      */
+
+      logBase2 = FT_MSB( (FT_UInt32)stemWidthPer1000 ) +
+                   FT_MSB( (FT_UInt32)ppem );
+
+      if ( logBase2 >= 46 )
+        /* possible overflow */
+        scaledStem = cf2_intToFixed( x4 );
+      else
+        scaledStem = FT_MulFix( stemWidthPer1000, ppem );
+
+      /* now apply the darkening parameters */
+
+      if ( scaledStem < cf2_intToFixed( x1 ) )
+        *darkenAmount = FT_DivFix( cf2_intToFixed( y1 ), ppem );
+
+      else if ( scaledStem < cf2_intToFixed( x2 ) )
+      {
+        FT_Int  xdelta = x2 - x1;
+        FT_Int  ydelta = y2 - y1;
+        FT_Int  x      = stemWidthPer1000 -
+                           FT_DivFix( cf2_intToFixed( x1 ), ppem );
+
+
+        if ( !xdelta )
+          goto Try_x3;
+
+        *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) +
+                          FT_DivFix( cf2_intToFixed( y1 ), ppem );
+      }
+
+      else if ( scaledStem < cf2_intToFixed( x3 ) )
+      {
+      Try_x3:
+        {
+          FT_Int  xdelta = x3 - x2;
+          FT_Int  ydelta = y3 - y2;
+          FT_Int  x      = stemWidthPer1000 -
+                             FT_DivFix( cf2_intToFixed( x2 ), ppem );
+
+
+          if ( !xdelta )
+            goto Try_x4;
+
+          *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) +
+                            FT_DivFix( cf2_intToFixed( y2 ), ppem );
+        }
+      }
+
+      else if ( scaledStem < cf2_intToFixed( x4 ) )
+      {
+      Try_x4:
+        {
+          FT_Int  xdelta = x4 - x3;
+          FT_Int  ydelta = y4 - y3;
+          FT_Int  x      = stemWidthPer1000 -
+                             FT_DivFix( cf2_intToFixed( x3 ), ppem );
+
+
+          if ( !xdelta )
+            goto Use_y4;
+
+          *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) +
+                            FT_DivFix( cf2_intToFixed( y3 ), ppem );
+        }
+      }
+
+      else
+      {
+      Use_y4:
+        *darkenAmount = FT_DivFix( cf2_intToFixed( y4 ), ppem );
+      }
+
+      /* 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 = FALSE;
+
+    /* character space units */
+    CF2_Fixed  boldenX = font->syntheticEmboldeningAmountX;
+    CF2_Fixed  boldenY = font->syntheticEmboldeningAmountY;
+
+    CFF_SubFont  subFont;
+    CF2_Fixed    ppem;
+
+
+    /* clear previous error */
+    font->error = FT_Err_Ok;
+
+    /* if a CID fontDict has changed, we need to recompute some cached */
+    /* data                                                            */
+    subFont = cf2_getSubfont( decoder );
+    if ( font->lastSubfont != subFont )
+    {
+      font->lastSubfont = subFont;
+      needExtraSetup    = TRUE;
+    }
+
+    /* 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,
+                              font->darkenParams );
+      }
+      else
+        cf2_computeDarkening( emRatio,
+                              ppem,
+                              font->stdVW,
+                              &font->darkenX,
+                              0,
+                              font->stemDarkened,
+                              font->darkenParams );
+
+#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,
+                            font->darkenParams );
+
+      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/src/cff/cf2font.h b/src/cff/cf2font.h
new file mode 100644 (file)
index 0000000..d8860ce
--- /dev/null
@@ -0,0 +1,116 @@
+/***************************************************************************/
+/*                                                                         */
+/*  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;
+
+    FT_Int  darkenParams[8];              /* 1000 unit character space */
+
+    /* 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/src/cff/cf2ft.c b/src/cff/cf2ft.c
new file mode 100644 (file)
index 0000000..ebba469
--- /dev/null
@@ -0,0 +1,691 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2ft.c                                                                */
+/*                                                                         */
+/*    FreeType Glue Component to Adobe's Interpreter (body).               */
+/*                                                                         */
+/*  Copyright 2013-2014 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 );
+
+    if ( transform->a <= 0 || transform->d <= 0 )
+      return FT_THROW( Invalid_Size_Handle );
+
+    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 )
+  {
+    FT_Error  error;
+
+    /* 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'                                               */
+      error = cff_builder_start_point( builder,
+                                       params->pt0.x,
+                                       params->pt0.y );
+      if ( error )
+      {
+        if ( !*callbacks->error )
+          *callbacks->error =  error;
+        return;
+      }
+    }
+
+    /* `cff_builder_add_point1' includes a check_points call for one point */
+    error = cff_builder_add_point1( builder,
+                                    params->pt1.x,
+                                    params->pt1.y );
+    if ( error )
+    {
+      if ( !*callbacks->error )
+        *callbacks->error =  error;
+      return;
+    }
+  }
+
+
+  static void
+  cf2_builder_cubeTo( CF2_OutlineCallbacks      callbacks,
+                      const CF2_CallbackParams  params )
+  {
+    FT_Error  error;
+
+    /* 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'                                               */
+      error = cff_builder_start_point( builder,
+                                       params->pt0.x,
+                                       params->pt0.y );
+      if ( error )
+      {
+        if ( !*callbacks->error )
+          *callbacks->error =  error;
+        return;
+      }
+    }
+
+    /* prepare room for 3 points: 2 off-curve, 1 on-curve */
+    error = cff_check_points( builder, 3 );
+    if ( error )
+    {
+      if ( !*callbacks->error )
+        *callbacks->error =  error;
+      return;
+    }
+
+    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 = ( decoder->builder.glyph->x_scale + 32 ) / 64;
+      *y_scale = ( decoder->builder.glyph->y_scale + 32 ) / 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;
+
+      font->darkenParams[0] = driver->darken_params[0];
+      font->darkenParams[1] = driver->darken_params[1];
+      font->darkenParams[2] = driver->darken_params[2];
+      font->darkenParams[3] = driver->darken_params[3];
+      font->darkenParams[4] = driver->darken_params[4];
+      font->darkenParams[5] = driver->darken_params[5];
+      font->darkenParams[6] = driver->darken_params[6];
+      font->darkenParams[7] = driver->darken_params[7];
+
+      /* now get an outline for this glyph;      */
+      /* also get units per em to validate scale */
+      font->unitsPerEm = (CF2_Int)cf2_getUnitsPerEm( decoder );
+
+      if ( scaled )
+      {
+        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 );
+
+    /*
+     * Note that `y_ppem' can be zero if there wasn't a call to
+     * `FT_Set_Char_Size' or something similar.  However, this isn't a
+     * problem since we come to this place in the code only if
+     * FT_LOAD_NO_SCALE is set (the other case gets caught by
+     * `cf2_checkTransform').  The ppem value is needed to compute the stem
+     * darkening, which is disabled for getting the unscaled outline.
+     *
+     */
+    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 );
+
+    FT_ZERO( buf );
+
+    idx += decoder->globals_bias;
+    if ( idx >= decoder->num_globals )
+      return TRUE;     /* error */
+
+    FT_ASSERT( decoder->globals );
+
+    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 );
+
+    FT_ZERO( buf );
+
+    idx += decoder->locals_bias;
+    if ( idx >= decoder->num_locals )
+      return TRUE;     /* error */
+
+    FT_ASSERT( decoder->locals );
+
+    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/src/cff/cf2ft.h b/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/src/cff/cf2glue.h b/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/src/cff/cf2hints.c b/src/cff/cf2hints.c
new file mode 100644 (file)
index 0000000..040d193
--- /dev/null
@@ -0,0 +1,1847 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2hints.c                                                             */
+/*                                                                         */
+/*    Adobe's code for handling CFF hints (body).                          */
+/*                                                                         */
+/*  Copyright 2007-2014 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 )
+  {
+    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;
+
+      FT_ASSERT( hintmap->lastIndex < CF2_MAX_HINT_EDGES );
+
+      /* 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, where captured hints from all
+     * zones are combined.  Define overlap to include hints that `touch'
+     * (overlap zero).  Hiragino Sans/Gothic fonts have numerous hints that
+     * touch.  Some fonts have non-ideographic glyphs that overlap our
+     * synthetic hints.
+     *
+     * Overlap also occurs when darkening stem hints that are close.
+     *
+     */
+    if ( indexInsert < hintmap->count )
+    {
+      /* we are inserting before an existing edge:    */
+      /* verify that an existing edge is not the same */
+      if ( hintmap->edge[indexInsert].csCoord == firstHintEdge->csCoord )
+        return; /* ignore overlapping stem hint */
+
+      /* 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.
+     *
+     * TODO: Although we might correct this later during adjustment, we
+     * don't currently have a way to delete a conflicting hint once it has
+     * been inserted.  See v2.030 MinionPro-Regular, 12 ppem darkened,
+     * initial hint map for second path, glyph 945 (the perispomeni (tilde)
+     * in U+1F6E, Greek omega with psili and perispomeni).  Darkening is
+     * 25.  Pair 667,747 initially conflicts in design space with top edge
+     * 660.  This is because 667 maps to 7.87, and the top edge was
+     * captured by a zone at 8.0.  The pair is later successfully inserted
+     * in a zone without the top edge.  In this zone it is adjusted to 8.0,
+     * and no longer conflicts with the top edge in design space.  This
+     * means it can be included in yet a later zone which does have the top
+     * edge hint.  This produces a small mismatch between the first and
+     * last points of this path, even though the hint masks are the same.
+     * The density map difference is tiny (1/256).
+     *
+     */
+
+    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 ) );
+      if ( !cf2_hintmask_isValid( hintMask ) )
+          return;                   /* too many stem hints */
+    }
+
+    /* 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 */
+    bitCount = cf2_arrstack_size( hStemHintArray );
+
+    /* Defense-in-depth.  Should never return here. */
+    if ( bitCount > hintMask->bitCount )
+        return;
+
+    /* 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->pathIsClosing = 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 we may
+   * synthesize a connecting line to the current element.  If we are
+   * closing a subpath, we may also generate a connecting line to the start
+   * point.
+   *
+   * This is where Character Space (CS) is converted to Device Space (DS)
+   * using a hint map.  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 */
+
+      if ( close )
+      {
+        /* use first hint map if closing */
+        cf2_glyphpath_hintPoint( glyphpath,
+                                 &glyphpath->firstHintMap,
+                                 &params.pt1,
+                                 glyphpath->prevElemP1.x,
+                                 glyphpath->prevElemP1.y );
+      }
+      else
+      {
+        cf2_glyphpath_hintPoint( glyphpath,
+                                 hintmap,
+                                 &params.pt1,
+                                 glyphpath->prevElemP1.x,
+                                 glyphpath->prevElemP1.y );
+      }
+
+      /* output only non-zero length lines */
+      if ( params.pt0.x != params.pt1.x || params.pt0.y != params.pt1.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                                       */
+
+      if ( close )
+      {
+        /* if we are closing the subpath, then nextP0 is in the first     */
+        /* hint zone                                                      */
+        cf2_glyphpath_hintPoint( glyphpath,
+                                 &glyphpath->firstHintMap,
+                                 &params.pt1,
+                                 nextP0->x,
+                                 nextP0->y );
+      }
+      else
+      {
+        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->yOffset;
+        }
+        else
+        {
+          /* -x -y */
+          *x = FT_MulFix( cf2_floatToFixed( -0.7 ),
+                          glyphpath->xOffset );
+          *y = FT_MulFix( cf2_floatToFixed( 1.0 + 0.7 ),
+                          glyphpath->yOffset );
+        }
+      }
+    }
+  }
+
+
+  /*
+   * The functions cf2_glyphpath_{moveTo,lineTo,curveTo,closeOpenPath} are
+   * called by the interpreter with Character Space (CS) coordinates.  Each
+   * path element is placed into a queue of length one to await the
+   * calculation of the following element.  At that time, the darkening
+   * offset of the following element is known and joins can be computed,
+   * including possible modification of this element, before mapping to
+   * Device Space (DS) and passing it on to the outline consumer.
+   *
+   */
+  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;
+    FT_Bool    newHintMap;
+
+    /*
+     * New hints will be applied after cf2_glyphpath_pushPrevElem has run.
+     * In case this is a synthesized closing line, any new hints should be
+     * delayed until this path is closed (`cf2_hintmask_isNew' will be
+     * called again before the next line or curve).
+     */
+
+    /* true if new hint map not on close */
+    newHintMap = cf2_hintmask_isNew( glyphpath->hintMask ) &&
+                 !glyphpath->pathIsClosing;
+
+    /*
+     * Zero-length lines may occur in the charstring.  Because we cannot
+     * compute darkening offsets or intersections from zero-length lines,
+     * it is best to remove them and avoid artifacts.  However, zero-length
+     * lines in CS at the start of a new hint map can generate non-zero
+     * lines in DS due to hint substitution.  We detect a change in hint
+     * map here and pass those zero-length lines along.
+     */
+
+    /*
+     * Note: Find explicitly closed paths here with a conditional
+     *       breakpoint using
+     *
+     *         !gp->pathIsClosing && gp->start.x == x && gp->start.y == y
+     *
+     */
+
+    if ( glyphpath->currentCS.x == x &&
+         glyphpath->currentCS.y == y &&
+         !newHintMap                 )
+      /*
+       * Ignore zero-length lines in CS where the hint map is the same
+       * because the line in DS will also be zero length.
+       *
+       * Ignore zero-length lines when we synthesize a closing line because
+       * the close will be handled in cf2_glyphPath_pushPrevElem.
+       */
+      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 ) ||
+                 glyphpath->hintMap.count == 0              );
+
+      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 ( newHintMap )
+      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 ) ||
+                 glyphpath->hintMap.count == 0              );
+
+      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 )
+    {
+      /*
+       * A closing line in Character Space line is always generated below
+       * with `cf2_glyphPath_lineTo'.  It may be ignored later if it turns
+       * out to be zero length in Device Space.
+       */
+      glyphpath->pathIsClosing = TRUE;
+
+      cf2_glyphpath_lineTo( glyphpath,
+                            glyphpath->start.x,
+                            glyphpath->start.y );
+
+      /* empty the final element from the queue and close the path */
+      if ( glyphpath->elemIsQueued )
+        cf2_glyphpath_pushPrevElem( glyphpath,
+                                    &glyphpath->hintMap,
+                                    &glyphpath->offsetStart0,
+                                    glyphpath->offsetStart1,
+                                    TRUE );
+
+      /* reset state machine */
+      glyphpath->moveIsPending = TRUE;
+      glyphpath->pathIsOpen    = FALSE;
+      glyphpath->pathIsClosing = FALSE;
+      glyphpath->elemIsQueued  = FALSE;
+    }
+  }
+
+
+/* END */
diff --git a/src/cff/cf2hints.h b/src/cff/cf2hints.h
new file mode 100644 (file)
index 0000000..f25d91b
--- /dev/null
@@ -0,0 +1,289 @@
+/***************************************************************************/
+/*                                                                         */
+/*  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  pathIsClosing;  /* true when synthesizing closepath line */
+    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;
+    /* start point of subpath, character space */
+    FT_Vector  start;
+
+    /* 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/src/cff/cf2intrp.c b/src/cff/cf2intrp.c
new file mode 100644 (file)
index 0000000..a269606
--- /dev/null
@@ -0,0 +1,1545 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2intrp.c                                                             */
+/*                                                                         */
+/*    Adobe's CFF Interpreter (body).                                      */
+/*                                                                         */
+/*  Copyright 2007-2014 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" ));
+          break;
+        }
+
+        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" ));
+          break;
+        }
+
+        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" ));
+
+        /* never add hints after the mask is computed */
+        if ( cf2_stack_count( opStack ) > 1    &&
+             cf2_hintmask_isValid( &hintMask ) )
+        {
+          FT_TRACE4(( "cf2_interpT2CharString: invalid hint mask\n" ));
+          break;
+        }
+
+        /* if there are arguments on the stack, there this is an */
+        /* implied cf2_cmdVSTEMHM                                */
+        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/src/cff/cf2intrp.h b/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/src/cff/cf2read.c b/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/src/cff/cf2read.h b/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/src/cff/cf2stack.c b/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/src/cff/cf2stack.h b/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/src/cff/cf2types.h b/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).                      */
 /*                                                                         */
-/*  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,       */
@@ -19,6 +19,7 @@
 #define FT_MAKE_OPTION_SINGLE_OBJECT
 
 #include <ft2build.h>
+
 #include "cffpic.c"
 #include "cffdrivr.c"
 #include "cffparse.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 */
index 1298371..52248b2 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -16,6 +16,8 @@
 /***************************************************************************/
 
 
+#include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
 #include "cffcmap.h"
 #include "cffload.h"
 
   /*************************************************************************/
 
   FT_CALLBACK_DEF( FT_Error )
-  cff_cmap_encoding_init( CFF_CMapStd  cmap )
+  cff_cmap_encoding_init( CFF_CMapStd  cmap,
+                          FT_Pointer   pointer )
   {
     TT_Face       face     = (TT_Face)FT_CMAP_FACE( cmap );
     CFF_Font      cff      = (CFF_Font)face->extra.data;
     CFF_Encoding  encoding = &cff->encoding;
 
+    FT_UNUSED( pointer );
+
 
     cmap->gids  = encoding->codes;
 
 
 
   FT_CALLBACK_DEF( FT_Error )
-  cff_cmap_unicode_init( PS_Unicodes  unicodes )
+  cff_cmap_unicode_init( PS_Unicodes  unicodes,
+                         FT_Pointer   pointer )
   {
     TT_Face             face    = (TT_Face)FT_CMAP_FACE( unicodes );
     FT_Memory           memory  = FT_FACE_MEMORY( face );
     CFF_Charset         charset = &cff->charset;
     FT_Service_PsCMaps  psnames = (FT_Service_PsCMaps)cff->psnames;
 
+    FT_UNUSED( pointer );
+
 
     /* 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,
index eb4c14e..3e8898e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType font driver implementation (body).                          */
 /*                                                                         */
-/*  Copyright 1996-2012 by                                                 */
+/*  Copyright 1996-2014 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -37,6 +37,8 @@
 
 #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 );
 
-    return CFF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
 
 
     if ( !slot )
-      return CFF_Err_Invalid_Slot_Handle;
+      return FT_THROW( Invalid_Slot_Handle );
+
+    FT_TRACE1(( "cff_glyph_load: glyph index %d\n", glyph_index ));
 
     /* check whether we want a scaled outline or bitmap */
     if ( !size )
     {
       /* 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 */
                     FT_Fixed*  advances )
   {
     FT_UInt       nn;
-    FT_Error      error = CFF_Err_Ok;
+    FT_Error      error = FT_Err_Ok;
     FT_GlyphSlot  slot  = face->glyph;
 
 
                  " cannot get glyph name from CFF & CEF fonts\n"
                  "                   "
                  " without the `PSNames' module\n" ));
-      error = CFF_Err_Missing_Module;
+      error = FT_THROW( Missing_Module );
       goto Exit;
     }
 
     if ( gname )
       FT_STRCPYN( buffer, gname, buffer_max );
 
-    error = CFF_Err_Ok;
+    error = FT_Err_Ok;
 
   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
   )
                         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 )
   }
 
 
-  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,
   }
 
 
-  FT_DEFINE_SERVICE_PSFONTNAMEREC(cff_service_ps_name,
+  FT_DEFINE_SERVICE_PSFONTNAMEREC(
+    cff_service_ps_name,
     (FT_PsName_GetFunc)cff_get_ps_name
   )
 
                      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;
 
-    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_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
   )
 
                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;
 
 
 
       if ( dict->cid_registry == 0xFFFFU )
       {
-        error = CFF_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Fail;
       }
 
   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;
 
 
                                 FT_UInt   glyph_index,
                                 FT_UInt  *cid )
   {
-    FT_Error  error = CFF_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     CFF_Font  cff;
 
 
 
       if ( dict->cid_registry == 0xFFFFU )
       {
-        error = CFF_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Fail;
       }
 
       if ( glyph_index > cff->num_glyphs )
       {
-        error = CFF_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         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
   )
 
 
+  /*
+   *  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, "darkening-parameters" ) )
+    {
+      FT_Int*  darken_params = (FT_Int*)value;
+
+      FT_Int  x1 = darken_params[0];
+      FT_Int  y1 = darken_params[1];
+      FT_Int  x2 = darken_params[2];
+      FT_Int  y2 = darken_params[3];
+      FT_Int  x3 = darken_params[4];
+      FT_Int  y3 = darken_params[5];
+      FT_Int  x4 = darken_params[6];
+      FT_Int  y4 = darken_params[7];
+
+
+      if ( x1 < 0   || x2 < 0   || x3 < 0   || x4 < 0   ||
+           y1 < 0   || y2 < 0   || y3 < 0   || y4 < 0   ||
+           x1 > x2  || x2 > x3  || x3 > x4              ||
+           y1 > 500 || y2 > 500 || y3 > 500 || y4 > 500 )
+        return FT_THROW( Invalid_Argument );
+
+      driver->darken_params[0] = x1;
+      driver->darken_params[1] = y1;
+      driver->darken_params[2] = x2;
+      driver->darken_params[3] = y2;
+      driver->darken_params[4] = x3;
+      driver->darken_params[5] = y3;
+      driver->darken_params[6] = x4;
+      driver->darken_params[7] = y4;
+
+      return error;
+    }
+    else 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;
+
+
+    if ( !ft_strcmp( property_name, "darkening-parameters" ) )
+    {
+      FT_Int*  darken_params = driver->darken_params;
+      FT_Int*  val           = (FT_Int*)value;
+
+
+      val[0] = darken_params[0];
+      val[1] = darken_params[1];
+      val[2] = darken_params[2];
+      val[3] = darken_params[3];
+      val[4] = darken_params[4];
+      val[5] = darken_params[5];
+      val[6] = darken_params[6];
+      val[7] = darken_params[7];
+
+      return error;
+    }
+    else if ( !ft_strcmp( property_name, "hinting-engine" ) )
+    {
+      FT_UInt   hinting_engine    = driver->hinting_engine;
+      FT_UInt*  val               = (FT_UInt*)value;
+
+
+      *val = hinting_engine;
+
+      return error;
+    }
+    else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
+    {
+      FT_Bool   no_stem_darkening = driver->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
-  FT_DEFINE_SERVICEDESCREC6(cff_services,
+  FT_DEFINE_SERVICEDESCREC7(
+    cff_services,
     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
-  FT_DEFINE_SERVICEDESCREC5(cff_services,
+  FT_DEFINE_SERVICEDESCREC6(
+    cff_services,
     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
 
+
   FT_CALLBACK_DEF( FT_Module_Interface )
   cff_get_interface( FT_Module    driver,       /* CFF_Driver */
                      const char*  module_interface )
     FT_Module_Interface  result;
 
 
-    /* FT_CFF_SERVICES_GET derefers `library' in PIC mode */
+    /* CFF_SERVICES_GET dereferences `library' in PIC mode */
 #ifdef FT_CONFIG_OPTION_PIC
     if ( !driver )
       return NULL;
       return NULL;
 #endif
 
-    result = ft_service_list_lookup( FT_CFF_SERVICES_GET, module_interface );
+    result = ft_service_list_lookup( CFF_SERVICES_GET, module_interface );
     if ( result != NULL )
       return result;
 
 #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   |
     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 */
-
     cff_glyph_load,
 
     cff_get_kerning,
index 84847fd..758a3d3 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType Glyph Loader (body).                                        */
 /*                                                                         */
-/*  Copyright 1996-2012 by                                                 */
+/*  Copyright 1996-2014 by                                                 */
 /*  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_CFF_DRIVER_H
 
 #include "cffobjs.h"
 #include "cffload.h"
 #include "cffgload.h"
+#include "cf2ft.h"      /* for cf2_decoder_parse_charstrings */
 
 #include "cfferrs.h"
 
@@ -39,6 +41,8 @@
 #define FT_COMPONENT  trace_cffgload
 
 
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+
   typedef enum  CFF_Operator_
   {
     cff_op_unknown = 0,
     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;
-    FT_Error      error   = CFF_Err_Ok;
+    FT_Error      error   = FT_Err_Ok;
 
 
     /* manage CID fonts */
       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;
       }
 
-      FT_TRACE3(( "glyph index %d (subfont %d):\n", glyph_index, fd_index ));
+      FT_TRACE3(( "  in subfont %d:\n", fd_index ));
 
       sub = cff->subfonts[fd_index];
 
         builder->hints_globals = (void *)internal->subfonts[fd_index];
       }
     }
-#ifdef FT_DEBUG_LEVEL_TRACE
-    else
-      FT_TRACE3(( "glyph index %d:\n", glyph_index ));
-#endif
 
     decoder->num_locals    = sub->local_subrs_index.count;
     decoder->locals        = sub->local_subrs;
     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 */
-  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 */
-  static void
+  FT_LOCAL_DEF( void )
   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;
 
+#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 );
     }
 
 
 
   /* 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 )
     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 ( !builder->load_points )
     {
       outline->n_contours++;
-      return CFF_Err_Ok;
+      return FT_Err_Ok;
     }
 
     error = FT_GLYPHLOADER_CHECK_POINTS( builder->loader, 0, 1 );
 
 
   /* 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 )
   {
-    FT_Error  error = CFF_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     /* test whether we are building a new contour */
 
 
   /* close the current contour */
-  static void
+  FT_LOCAL_DEF( void )
   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 )
   {
   }
 
 
-  static FT_Error
+  FT_LOCAL_DEF( FT_Error )
   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 )
     /* callback function.                                     */
     if ( face->root.internal->incremental_interface )
     {
-      FT_Data data;
+      FT_Data  data;
 
 
       data.pointer = *pointer;
   }
 
 
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+
   static FT_Error
   cff_operator_seac( CFF_Decoder*  decoder,
                      FT_Pos        asb,
     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;
     {
       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 */
     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;
 
 
         /* 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;
-          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 )
         {
           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;
         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 ) )
-          FT_TRACE4(( " %ld", (FT_Int32)( val >> 16 ) ));
+          FT_TRACE4(( " %hd", (FT_Short)( (FT_UInt32)val >> 16 ) ));
         else
           FT_TRACE4(( " %.2f", val / 65536.0 ));
 #endif
         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 )
             if ( num_args == 0 )
               break;
 
-            if ( cff_builder_start_point ( builder, x, y ) ||
-                 check_points( builder, num_args )         )
+            if ( cff_builder_start_point( builder, x, y ) ||
+                 cff_check_points( builder, num_args )    )
               goto Fail;
 
             args = stack;
 
             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;
               nargs--;
             }
 
-            if ( check_points( builder, 3 * ( nargs / 4 ) ) )
+            if ( cff_check_points( builder, 3 * ( nargs / 4 ) ) )
               goto Fail;
 
             while ( args < decoder->top )
               nargs--;
             }
 
-            if ( check_points( builder, 3 * ( nargs / 4 ) ) )
+            if ( cff_check_points( builder, 3 * ( nargs / 4 ) ) )
               goto Fail;
 
             while ( args < decoder->top )
             nargs = num_args & ~2;
 
             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 );
             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;
             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;
             /* -- 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 */
 
             /* 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 */
 
             /* 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 */
             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-- )
           }
           else
           {
-            if ( !error )
-              error = CFF_Err_Ok;
-
             cff_builder_close_contour( builder );
 
             /* close hints recording session */
                 goto Syntax_Error;
 
               /* apply hints to the loaded glyph outline now */
-              hinter->apply( hinter->hints,
-                             builder->current,
-                             (PSH_Globals)builder->hints_globals,
-                             decoder->hint_mode );
+              error = hinter->apply( hinter->hints,
+                                     builder->current,
+                                     (PSH_Globals)builder->hints_globals,
+                                     decoder->hint_mode );
+              if ( error )
+                goto Fail;
             }
 
             /* add current outline to the glyph slot */
             FT_ERROR(( " %d", ip[0] ));
           FT_ERROR(( "\n" ));
 
-          return CFF_Err_Unimplemented_Feature;
+          return FT_THROW( Unimplemented_Feature );
         }
 
         decoder->top = args;
 
   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" ));
-    return CFF_Err_Too_Few_Arguments;
+    return FT_THROW( Too_Few_Arguments );
 
   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 )
   {
-    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;
       }
 
       /* 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;
 
-    return CFF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     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;
         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 )
-      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 ( !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.bitmap_left = metrics.horiBearingX;
             glyph->root.bitmap_top  = metrics.horiBearingY;
           }
+
+          /* compute linear advance widths */
+
+          (void)( (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 )
+          {
+            (void)( (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 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)                       */
       FT_Byte   fd_index = cff_fd_select_get( &cff->fd_select,
                                               glyph_index );
 
+
       if ( fd_index >= cff->num_subfonts )
         fd_index = (FT_Byte)( cff->num_subfonts - 1 );
 
     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 */
 
     {
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+      CFF_Driver  driver = (CFF_Driver)FT_FACE_DRIVER( face );
+#endif
+
+
       FT_Byte*  charstring;
       FT_ULong  charstring_len;
 
       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 );
 
         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 );
-#endif
 
         /* get the vertical metrics from the vtmx table if we have one */
         if ( has_vertical_info )
           FT_UShort  vertAdvance  = 0;
 
 
-          ( (SFNT_Service)face->sfnt )->get_metrics( face, 1,
-                                                     glyph_index,
-                                                     &vertBearingY,
-                                                     &vertAdvance );
+          (void)( (SFNT_Service)face->sfnt )->get_metrics( face, 1,
+                                                           glyph_index,
+                                                           &vertBearingY,
+                                                           &vertAdvance );
           metrics->vertBearingY = vertBearingY;
           metrics->vertAdvance  = vertAdvance;
         }
index 38937be..41df7db 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -106,6 +106,41 @@ FT_BEGIN_HEADER
   } 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_
@@ -156,6 +191,8 @@ FT_BEGIN_HEADER
 
     FT_Bool            seac;
 
+    CFF_SubFont        current_subfont; /* for current glyph_index */
+
   } CFF_Decoder;
 
 
@@ -181,10 +218,12 @@ FT_BEGIN_HEADER
 
 #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 );
+#endif
 
   FT_LOCAL( FT_Error )
   cff_slot_load( CFF_GlyphSlot  glyph,
index 2be6ba0..d9bec59 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType and CFF data/program tables loader (body).                  */
 /*                                                                         */
-/*  Copyright 1996-2011 by                                                 */
+/*  Copyright 1996-2014 by                                                 */
 /*  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 )
       {
-        error = CFF_Err_Invalid_Table;
+        error = FT_THROW( Invalid_Table );
         goto Exit;
       }
 
 
       if ( size == 0 )
       {
-        error = CFF_Err_Invalid_Table;
+        error = FT_THROW( Invalid_Table );
         goto Exit;
       }
 
   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_Byte***  table,
                           FT_Byte**   pool )
   {
-    FT_Error   error     = CFF_Err_Ok;
+    FT_Error   error     = FT_Err_Ok;
     FT_Memory  memory    = idx->stream->memory;
-    FT_Byte**  t = NULL;
+
+    FT_Byte**  t         = NULL;
     FT_Byte*   new_bytes = NULL;
 
 
       cur_offset = idx->offsets[0] - 1;
 
       /* sanity check */
-      if ( cur_offset >= idx->data_size )
+      if ( cur_offset != 0 )
       {
         FT_TRACE0(( "cff_index_get_pointers:"
                     " invalid first offset value %d set to zero\n",
         FT_ULong  next_offset = idx->offsets[n] - 1;
 
 
-        /* empty slot + two sanity checks for invalid offset tables */
-        if ( next_offset == 0                                    ||
-             next_offset < cur_offset                            ||
-             ( next_offset >= idx->data_size && n < idx->count ) )
+        /* two sanity checks for invalid offset tables */
+        if ( next_offset < cur_offset )
           next_offset = cur_offset;
+        else if ( next_offset > idx->data_size )
+          next_offset = idx->data_size;
 
         if ( !pool )
           t[n] = org_bytes + next_offset;
                             FT_Byte**  pbytes,
                             FT_ULong*  pbyte_len )
   {
-    FT_Error  error = CFF_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     if ( idx && idx->count > element )
       }
     }
     else
-      error = CFF_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
 
   Exit:
     return error;
       if ( FT_READ_USHORT( num_ranges ) )
         goto Exit;
 
+      if ( !num_ranges )
+      {
+        FT_TRACE0(( "CFF_Load_FD_Select: empty FDSelect array\n" ));
+        error = FT_THROW( Invalid_File_Format );
+        goto Exit;
+      }
+
       fdselect->data_size = num_ranges * 3 + 2;
 
     Load_Data:
       break;
 
     default:    /* hmm... that's wrong */
-      error = CFF_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
     }
 
   Exit:
       break;
 
     case 3:
-      /* first, compare to cache */
+      /* first, compare to the cache */
       if ( (FT_UInt)( glyph_index - fdselect->cache_first ) <
                         fdselect->cache_count )
       {
         break;
       }
 
-      /* then, lookup the ranges array */
+      /* then, look up the ranges array */
       {
         FT_Byte*  p       = fdselect->data;
         FT_Byte*  p_limit = p + fdselect->data_size;
 
             /* update cache */
             fdselect->cache_first = first;
-            fdselect->cache_count = limit-first;
+            fdselect->cache_count = limit - first;
             fdselect->cache_fd    = fd2;
             break;
           }
                             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_Bool      invert )
   {
     FT_Memory  memory = stream->memory;
-    FT_Error   error  = CFF_Err_Ok;
+    FT_Error   error  = FT_Err_Ok;
     FT_UShort  glyph_sid;
 
 
 
       default:
         FT_ERROR(( "cff_charset_load: invalid table format\n" ));
-        error = CFF_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
     }
         {
           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;
         }
 
         {
           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;
         }
 
         {
           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;
         }
 
         break;
 
       default:
-        error = CFF_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
     }
                      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;
     /* 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;
     }
 
 
       default:
         FT_ERROR(( "cff_encoding_load: invalid table format\n" ));
-        error = CFF_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
 
       default:
         FT_ERROR(( "cff_encoding_load: invalid table format\n" ));
-        error = CFF_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
     }
     /* 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;
     FT_ULong         base_offset;
     CFF_FontRecDict  dict;
     CFF_IndexRec     string_index;
+    FT_Int           subfont_index;
 
 
     FT_ZERO( font );
          font->absolute_offsize > 4 )
     {
       FT_TRACE2(( "  not a CFF font header\n" ));
-      error = CFF_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
 
     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 */
     FT_TRACE4(( "parsing top-level\n" ));
     error = cff_subfont_load( &font->top_font,
                               &font->font_dict_index,
-                              face_index,
+                              subfont_index,
                               stream,
                               base_offset,
                               library );
     if ( dict->charstrings_offset == 0 )
     {
       FT_ERROR(( "cff_font_load: no charstrings offset\n" ));
-      error = CFF_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
 
     /* 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 );
     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 6ad0e50..da3d019 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType objects manager (body).                                     */
 /*                                                                         */
-/*  Copyright 1996-2012 by                                                 */
+/*  Copyright 1996-2014 by                                                 */
 /*  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_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_CFF_DRIVER_H
+
 #include "cffobjs.h"
 #include "cffload.h"
 #include "cffcmap.h"
-#include "cfferrs.h"
 #include "cffpic.h"
 
+#include "cfferrs.h"
+
 
   /*************************************************************************/
   /*                                                                       */
   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 );
 
 
       }
     }
 
-    return CFF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 #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;
-    FT_Int32  length          = strlen( name ) + 1;
+    FT_Int32  length          = (FT_Int32)strlen( name ) + 1;
     FT_Bool   continue_search = 1;
 
 
     FT_Int32  family_name_length, style_name_length;
 
 
-    family_name_length = strlen( family_name );
-    style_name_length  = strlen( style_name );
+    family_name_length = (FT_Int32)strlen( family_name );
+    style_name_length  = (FT_Int32)strlen( style_name );
 
     if ( family_name_length > style_name_length )
     {
     if ( !sfnt )
     {
       FT_ERROR(( "cff_face_init: cannot access `sfnt' module\n" ));
-      error = CFF_Err_Missing_Module;
+      error = FT_THROW( Missing_Module );
       goto Exit;
     }
 
       if ( face->format_tag != TTAG_OTTO )  /* `OTTO'; OpenType/CFF font */
       {
         FT_TRACE2(( "  not an OpenType/CFF font\n" ));
-        error = CFF_Err_Unknown_File_Format;
+        error = FT_THROW( Unknown_File_Format );
         goto Exit;
       }
 
       /* 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;
 
         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;
       }
         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 */
       /* 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 */
                    " cannot open CFF & CEF fonts\n"
                    "              "
                    " without the `PSNames' module\n" ));
-        error = CFF_Err_Missing_Module;
+        error = FT_THROW( Missing_Module );
         goto Exit;
       }
 
           flags |= FT_FACE_FLAG_KERNING;
 #endif
 
-        cffface->face_flags = flags;
+        cffface->face_flags |= flags;
 
         /*******************************************************************/
         /*                                                                 */
         if ( pure_cff && cff->top_font.font_dict.cid_registry != 0xFFFFU )
           goto Exit;
 
-#ifdef FT_MAX_CHARMAP_CACHEABLE
-        if ( nn + 1 > FT_MAX_CHARMAP_CACHEABLE )
-        {
-          FT_ERROR(( "cff_face_init: no Unicode cmap is found, "
-                     "and too many subtables (%d) to add synthesized cmap\n",
-                     nn ));
-          goto Exit;
-        }
-#endif
-
         /* we didn't find a Unicode charmap -- synthesize one */
         cmaprec.face        = cffface;
         cmaprec.platform_id = TT_PLATFORM_MICROSOFT;
 
         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 );
-        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;
 
           cffface->charmap = cffface->charmaps[nn];
 
       Skip_Unicode:
-#ifdef FT_MAX_CHARMAP_CACHEABLE
-        if ( nn > FT_MAX_CHARMAP_CACHEABLE )
-        {
-          FT_ERROR(( "cff_face_init: Unicode cmap is found, "
-                     "but too many preceding subtables (%d) to access\n",
-                     nn - 1 ));
-          goto Exit;
-        }
-#endif
         if ( encoding->count > 0 )
         {
           FT_CMap_Class  clazz;
           {
             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;
-            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;
-            clazz               = &FT_CFF_CMAP_ENCODING_CLASS_REC_GET;
+            clazz               = &CFF_CMAP_ENCODING_CLASS_REC_GET;
           }
 
           error = FT_CMap_New( clazz, NULL, &cmaprec, NULL );
 
 
   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, cf. `ftcffdrv.h' */
+#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;
+
+    driver->darken_params[0] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1;
+    driver->darken_params[1] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1;
+    driver->darken_params[2] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2;
+    driver->darken_params[3] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2;
+    driver->darken_params[4] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3;
+    driver->darken_params[5] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3;
+    driver->darken_params[6] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4;
+    driver->darken_params[7] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4;
 
-    return CFF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   FT_LOCAL_DEF( void )
-  cff_driver_done( FT_Module  module )
+  cff_driver_done( FT_Module  module )        /* CFF_Driver */
   {
     FT_UNUSED( module );
   }
index 3c81cee..dfbf9a9 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -112,12 +112,16 @@ FT_BEGIN_HEADER
 
   /***********************************************************************/
   /*                                                                     */
-  /* TrueType driver class.                                              */
+  /* CFF driver class.                                                   */
   /*                                                                     */
   typedef struct  CFF_DriverRec_
   {
     FT_DriverRec  root;
-    void*         extension_component;
+
+    FT_UInt  hinting_engine;
+    FT_Bool  no_stem_darkening;
+
+    FT_Int  darken_params[8];
 
   } CFF_DriverRec;
 
@@ -167,10 +171,10 @@ FT_BEGIN_HEADER
   /* Driver functions                                                      */
   /*                                                                       */
   FT_LOCAL( FT_Error )
-  cff_driver_init( FT_Module  module );
+  cff_driver_init( FT_Module  module );         /* CFF_Driver */
 
   FT_LOCAL( void )
-  cff_driver_done( FT_Module  module );
+  cff_driver_done( FT_Module  module );         /* CFF_Driver */
 
 
 FT_END_HEADER
index 61fa87c..c79ab62 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CFF token stream parser (body)                                       */
 /*                                                                         */
-/*  Copyright 1996-2004, 2007-2011 by                                      */
+/*  Copyright 1996-2004, 2007-2014 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
       if ( p + 2 > limit )
         goto Bad;
 
-      val = (FT_Short)( ( (FT_Int)p[0] << 8 ) | p[1] );
-      p  += 2;
+      val = (FT_Short)( ( (FT_UShort)p[0] << 8 ) | p[1] );
     }
     else if ( v == 29 )
     {
       if ( p + 4 > limit )
         goto Bad;
 
-      val = ( (FT_Long)p[0] << 24 ) |
-            ( (FT_Long)p[1] << 16 ) |
-            ( (FT_Long)p[2] <<  8 ) |
-                       p[3];
-      p += 4;
+      val = (FT_Long)( ( (FT_ULong)p[0] << 24 ) |
+                       ( (FT_ULong)p[1] << 16 ) |
+                       ( (FT_ULong)p[2] <<  8 ) |
+                         (FT_ULong)p[3]         );
     }
     else if ( v < 247 )
     {
@@ -89,7 +87,6 @@
         goto Bad;
 
       val = ( v - 247 ) * 256 + p[0] + 108;
-      p++;
     }
     else
     {
@@ -97,7 +94,6 @@
         goto Bad;
 
       val = -( v - 251 ) * 256 - p[0] - 108;
-      p++;
     }
 
   Exit:
 
   Bad:
     val = 0;
+    FT_TRACE4(( "!!!END OF DATA:!!!" ));
     goto Exit;
   }
 
     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;
 
 
 
         /* Make sure we don't read past the end. */
         if ( p >= limit )
-          goto Exit;
+          goto Bad;
       }
 
       /* Get the nibble. */
     }
 
     /* Read fraction part, if any. */
-    if ( nib == 0xa )
+    if ( nib == 0xA )
       for (;;)
       {
         /* If we entered this iteration with phase == 4, we need */
 
           /* Make sure we don't read past the end. */
           if ( p >= limit )
-            goto Exit;
+            goto Bad;
         }
 
         /* Get the nibble. */
 
           /* Make sure we don't read past the end. */
           if ( p >= limit )
-            goto Exit;
+            goto Bad;
         }
 
         /* Get the nibble. */
         if ( nib >= 10 )
           break;
 
-        exponent = exponent * 10 + nib;
-
         /* Arbitrarily limit exponent. */
         if ( exponent > 1000 )
-          goto Exit;
+          have_overflow = 1;
+        else
+          exponent = exponent * 10 + nib;
       }
 
       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;
 
 
             /* Make `scaling' as small as possible. */
             new_fraction_length = FT_MIN( exponent, 5 );
-            exponent           -= new_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;
 
-          result   = number << 16;
+          result   = (FT_Long)( (FT_ULong)number << 16 );
           *scaling = 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 )
         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;
 
-  Exit:
     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 )
   {
-    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 )
   {
-    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;
-        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_Error         error  = CFF_Err_Stack_Underflow;
+    FT_Error         error  = FT_ERR( Stack_Underflow );
 
 
     if ( parser->top >= parser->stack + 6 )
       FT_Long  scaling;
 
 
-      error = CFF_Err_Ok;
+      error = FT_Err_Ok;
 
       dict->has_font_matrix = TRUE;
 
     FT_Error         error;
 
 
-    error = CFF_Err_Stack_Underflow;
+    error = FT_ERR( Stack_Underflow );
 
     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   ) );
-      error = CFF_Err_Ok;
+      error = FT_Err_Ok;
 
       FT_TRACE4(( " [%d %d %d %d]\n",
                   bbox->xMin / 65536,
     FT_Error         error;
 
 
-    error = CFF_Err_Stack_Underflow;
+    error = FT_ERR( Stack_Underflow );
 
     if ( parser->top >= parser->stack + 2 )
     {
       FT_TRACE4(( " %lu %lu\n",
                   dict->private_size, dict->private_offset ));
 
-      error = CFF_Err_Ok;
+      error = FT_Err_Ok;
     }
 
     return error;
     FT_Error         error;
 
 
-    error = CFF_Err_Stack_Underflow;
+    error = FT_ERR( Stack_Underflow );
 
     if ( parser->top >= parser->stack + 3 )
     {
       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,
   FT_Create_Class_cff_field_handlers( FT_Library           library,
                                       CFF_Field_Handler**  output_class )
   {
-    CFF_Field_Handler*  clazz;
+    CFF_Field_Handler*  clazz  = NULL;
     FT_Error            error;
     FT_Memory           memory = library->memory;
 
 
     *output_class = clazz;
 
-    return CFF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
                   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_UNUSED( library );
 
         }
         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 )
           {
     return error;
 
   Stack_Overflow:
-    error = CFF_Err_Invalid_Argument;
+    error = FT_THROW( Invalid_Argument );
     goto Exit;
 
   Stack_Underflow:
-    error = CFF_Err_Invalid_Argument;
+    error = FT_THROW( Invalid_Argument );
     goto Exit;
 
   Syntax_Error:
-    error = CFF_Err_Invalid_Argument;
+    error = FT_THROW( Invalid_Argument );
     goto Exit;
   }
 
index 1c19d58..f22e4f0 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
 #include "cffpic.h"
 #include "cfferrs.h"
 
+
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from cffdrivr.c */
   FT_Error
-  FT_Create_Class_cff_services(
-    FT_Library           library,
-    FT_ServiceDescRec**  output_class );
-
+  FT_Create_Class_cff_services( FT_Library           library,
+                                FT_ServiceDescRec**  output_class );
   void
-  FT_Destroy_Class_cff_services(
-    FT_Library          library,
-    FT_ServiceDescRec*  clazz );
-
+  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 );
-
+  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 );
-
+  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 );
-
+  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 );
-
+  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 );
+  FT_Init_Class_cff_service_cid_info( FT_Library          library,
+                                      FT_Service_CIDRec*  clazz );
 
   /* forward declaration of PIC init functions from cffparse.c */
   FT_Error
-  FT_Create_Class_cff_field_handlers(
-    FT_Library           library,
-    CFF_Field_Handler**  output_class );
-
+  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 );
+  FT_Destroy_Class_cff_field_handlers( FT_Library          library,
+                                       CFF_Field_Handler*  clazz );
+
 
   void
   cff_driver_class_pic_free( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
-    FT_Memory  memory = library->memory;
+    FT_Memory          memory        = library->memory;
 
 
     if ( pic_container->cff )
     {
-      CffModulePIC*  container = ( CffModulePIC* )pic_container->cff;
+      CffModulePIC*  container = (CffModulePIC*)pic_container->cff;
 
 
       if ( container->cff_services )
   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_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->cff = 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_cff_services( library,
                                           &container->cff_services );
     if ( error )
       goto Exit;
+
     error = FT_Create_Class_cff_field_handlers(
               library, &container->cff_field_handlers );
     if ( error )
       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_cmap_encoding_class_rec );
     FT_Init_Class_cff_cmap_unicode_class_rec(
       library, &container->cff_cmap_unicode_class_rec );
-Exit:
+
+  Exit:
     if ( error )
       cff_driver_class_pic_free( library );
     return error;
index 342edd8..50bab4c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -24,16 +24,19 @@ FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
+
 #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 */
 
@@ -43,30 +46,48 @@ FT_BEGIN_HEADER
 #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;
 
-#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
index 7c99036..8727446 100644 (file)
@@ -5,7 +5,7 @@
 /*    Basic OpenType/CFF type definitions and interface (specification     */
 /*    only).                                                               */
 /*                                                                         */
-/*  Copyright 1996-2003, 2006-2008, 2010-2011 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,       */
@@ -270,6 +270,9 @@ FT_BEGIN_HEADER
     FT_String*       registry;
     FT_String*       ordering;
 
+    /* since version 2.4.12 */
+    FT_Generic       cf2_instance;
+
   } CFF_FontRec, *CFF_Font;
 
 
index ca7aa5d..13115c2 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2001, 2003, 2011 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,
@@ -29,14 +29,27 @@ CFF_DRV_SRC := $(CFF_DIR)/cffcmap.c  \
                $(CFF_DIR)/cffload.c  \
                $(CFF_DIR)/cffobjs.c  \
                $(CFF_DIR)/cffparse.c \
-               $(CFF_DIR)/cffpic.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_DIR)/cfferrs.h   \
              $(CFF_DIR)/cfftoken.h  \
-             $(CFF_DIR)/cfftypes.h
+             $(CFF_DIR)/cfftypes.h  \
+             $(CFF_DIR)/cf2fixed.h  \
+             $(CFF_DIR)/cf2glue.h   \
+             $(CFF_DIR)/cf2types.h
 
 
 # CFF driver object(s)
index bd84023..7febab8 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -46,7 +46,7 @@
     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;
@@ -58,7 +58,7 @@
 #endif
 
 
-    FT_TRACE4(( "cid_load_glyph: glyph index %d\n", glyph_index ));
+    FT_TRACE1(( "cid_load_glyph: glyph index %d\n", glyph_index ));
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
 
 
       if ( fd_select >= (FT_UInt)cid->num_dicts )
       {
-        error = CID_Err_Invalid_Offset;
+        error = FT_THROW( Invalid_Offset );
         goto Exit;
       }
       if ( glyph_length == 0 )
 
     psaux->t1_decoder_funcs->done( &decoder );
 
-    return CID_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
 
     if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
     {
-      error = CID_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
index 3b840b7..1cda0ee 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID-keyed Type1 font loader (body).                                  */
 /*                                                                         */
-/*  Copyright 1996-2006, 2009, 2011-2012 by                                */
+/*  Copyright 1996-2006, 2009, 2011-2014 by                                */
 /*  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 )
   {
-    FT_Long   result;
+    FT_ULong  result;
     FT_Byte*  p = *start;
 
 
@@ -53,7 +53,7 @@
     }
 
     *start = p;
-    return result;
+    return (FT_Long)result;
   }
 
 
         {
           FT_ERROR(( "cid_load_keyword: invalid use of `%s'\n",
                      keyword->ident ));
-          error = CID_Err_Syntax_Error;
+          error = FT_THROW( Syntax_Error );
           goto Exit;
         }
 
   cid_parse_font_matrix( CID_Face     face,
                          CID_Parser*  parser )
   {
-    FT_Matrix*    matrix;
-    FT_Vector*    offset;
     CID_FaceDict  dict;
     FT_Face       root = (FT_Face)&face->root;
     FT_Fixed      temp[6];
 
     if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts )
     {
+      FT_Matrix*  matrix;
+      FT_Vector*  offset;
+      FT_Int      result;
+
+
       dict   = face->cid.font_dicts + parser->num_dict;
       matrix = &dict->font_matrix;
       offset = &dict->font_offset;
 
-      (void)cid_parser_to_fixed_array( parser, 6, temp, 3 );
+      result = cid_parser_to_fixed_array( parser, 6, temp, 3 );
+
+      if ( result < 6 )
+        return FT_THROW( Invalid_File_Format );
 
       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 ) ) );
+      if ( temp_scale == 0 )
+      {
+        FT_ERROR(( "cid_parse_font_matrix: invalid font matrix\n" ));
+        return FT_THROW( Invalid_File_Format );
+      }
+
+      /* 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 )
         temp[2] = FT_DivFix( temp[2], temp_scale );
         temp[4] = FT_DivFix( temp[4], temp_scale );
         temp[5] = FT_DivFix( temp[5], temp_scale );
-        temp[3] = 0x10000L;
+        temp[3] = temp[3] < 0 ? -0x10000L : 0x10000L;
       }
 
       matrix->xx = temp[0];
       offset->y  = temp[5] >> 16;
     }
 
-    return CID_Err_Ok;      /* this is a callback function; */
-                            /* we must return an error code */
+    return FT_Err_Ok;
   }
 
 
   {
     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;
 
 
       dict->private_dict.expansion_factor = dict->expansion_factor;
     }
 
-    return CID_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
 
     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;
       /* Check for possible overflow. */
       if ( num_subrs == FT_UINT_MAX )
       {
-        error = CID_Err_Syntax_Error;
+        error = FT_THROW( Syntax_Error );
         goto Fail;
       }
 
 
         if ( new_max <= max_offsets )
         {
-          error = CID_Err_Syntax_Error;
+          error = FT_THROW( Syntax_Error );
           goto Fail;
         }
 
 
         if ( size == 0 )
         {
-          error = CID_Err_Syntax_Error;
+          error = FT_THROW( Syntax_Error );
           goto Exit;
         }
 
       }
       else
       {
-        error = CID_Err_Syntax_Error;
+        error = FT_THROW( Syntax_Error );
         goto Exit;
       }
 
       p++;
     }
 
-    error = CID_Err_Ok;
+    error = FT_Err_Ok;
 
   Exit:
     return error;
index cc2a200..5932ffa 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID objects manager (body).                                          */
 /*                                                                         */
-/*  Copyright 1996-2006, 2008, 2010-2011 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,       */
   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 );
 
 
                         size->metrics.y_scale,
                         0, 0 );
 
-    return CID_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
       if ( !psaux )
       {
         FT_ERROR(( "cid_face_init: cannot access `psaux' module\n" ));
-        error = CID_Err_Missing_Module;
+        error = FT_THROW( Missing_Module );
         goto Exit;
       }
 
     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;
     }
 
       cidface->num_charmaps = 0;
 
       cidface->face_index = face_index;
-      cidface->face_flags = FT_FACE_FLAG_SCALABLE   | /* scalable outlines */
-                            FT_FACE_FLAG_HORIZONTAL | /* horizontal data   */
-                            FT_FACE_FLAG_HINTER;      /* has native hinter */
+
+      cidface->face_flags |= FT_FACE_FLAG_SCALABLE   | /* scalable outlines */
+                             FT_FACE_FLAG_HORIZONTAL | /* horizontal data   */
+                             FT_FACE_FLAG_HINTER;      /* has native hinter */
 
       if ( info->is_fixed_pitch )
         cidface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
   {
     FT_UNUSED( driver );
 
-    return CID_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
index 4d21160..d8476cd 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID-keyed Type1 parser (body).                                       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by       */
+/*  Copyright 1996-2007, 2009, 2013, 2014 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -74,7 +74,7 @@
                      "%!PS-Adobe-3.0 Resource-CIDFont", 31 ) )
     {
       FT_TRACE2(( "  not a CID-keyed font\n" ));
-      error = CID_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
     }
 
     FT_FRAME_EXIT();
@@ -99,7 +99,7 @@
         if ( stream_len == 0 )
         {
           FT_TRACE2(( "cid_parser_new: no `StartData' keyword found\n" ));
-          error = CID_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Exit;
         }
 
           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 )
           {
-            offset += p - buffer + 7;
+            offset += (FT_ULong)( p - buffer + 7 );
             goto Found;
           }
         }
         if ( ft_strncmp( (char*)arg1, "(Hex)", 5 ) == 0 )
           parser->binary_length = ft_atol( (const char *)arg2 );
 
-        limit = parser->root.limit;
-        cur   = parser->root.cursor;
         goto Exit;
       }
       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;
       }
 
index ca37dea..f27be65 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID-keyed Type1 parser (specification).                              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2004, 2014 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -92,26 +92,26 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*************************************************************************/
 
-#define cid_parser_skip_spaces( p ) \
+#define cid_parser_skip_spaces( p )                 \
           (p)->root.funcs.skip_spaces( &(p)->root )
-#define cid_parser_skip_PS_token( p ) \
+#define cid_parser_skip_PS_token( p )                 \
           (p)->root.funcs.skip_PS_token( &(p)->root )
 
-#define cid_parser_to_int( p )        (p)->root.funcs.to_int( &(p)->root )
-#define cid_parser_to_fixed( p, t )   (p)->root.funcs.to_fixed( &(p)->root, t )
+#define cid_parser_to_int( p )       (p)->root.funcs.to_int( &(p)->root )
+#define cid_parser_to_fixed( p, t )  (p)->root.funcs.to_fixed( &(p)->root, t )
 
-#define cid_parser_to_coord_array( p, m, c )                          \
+#define cid_parser_to_coord_array( p, m, c )                 \
           (p)->root.funcs.to_coord_array( &(p)->root, m, c )
-#define cid_parser_to_fixed_array( p, m, f, t )                          \
+#define cid_parser_to_fixed_array( p, m, f, t )                 \
           (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )
-#define cid_parser_to_token( p, t )                         \
+#define cid_parser_to_token( p, t )                 \
           (p)->root.funcs.to_token( &(p)->root, t )
-#define cid_parser_to_token_array( p, t, m, c )                          \
+#define cid_parser_to_token_array( p, t, m, c )                 \
           (p)->root.funcs.to_token_array( &(p)->root, t, m, c )
 
-#define cid_parser_load_field( p, f, o )                              \
+#define cid_parser_load_field( p, f, o )                       \
           (p)->root.funcs.load_field( &(p)->root, f, o, 0, 0 )
-#define cid_parser_load_field_table( p, f, o )                              \
+#define cid_parser_load_field_table( p, f, o )                       \
           (p)->root.funcs.load_field_table( &(p)->root, f, o, 0, 0 )
 
 
index 694070a..6132a27 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID driver interface (body).                                         */
 /*                                                                         */
-/*  Copyright 1996-2004, 2006, 2008, 2009, 2011 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,       */
@@ -74,7 +74,7 @@
   {
     *afont_info = ((CID_Face)face)->cid.font_info;
 
-    return CID_Err_Ok;
+    return FT_Err_Ok;
   }
 
   static FT_Error
@@ -83,7 +83,7 @@
   {
     *afont_extra = ((CID_Face)face)->font_extra;
 
-    return CID_Err_Ok;
+    return FT_Err_Ok;
   }
 
   static const FT_Service_PsInfoRec  cid_service_ps_info =
     if ( supplement )
       *supplement = cid->supplement;
 
-    return CID_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   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_UInt   glyph_index,
                                 FT_UInt  *cid )
   {
-    FT_Error  error = CID_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_UNUSED( face );
 
 
     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  */
index 3d10031..d165118 100644 (file)
   static void
   gxv_bsln_LookupValue_validate( FT_UShort            glyph,
                                  GXV_LookupValueCPtr  value_p,
-                                 GXV_Validator        valid )
+                                 GXV_Validator        gxvalid )
   {
-    FT_UShort   v = value_p->u;
-    FT_UShort*  ctlPoints;
+    FT_UShort     v = value_p->u;
+    FT_UShort*    ctlPoints;
 
     FT_UNUSED( glyph );
 
   gxv_bsln_LookupFmt4_transit( FT_UShort            relative_gindex,
                                GXV_LookupValueCPtr  base_value_p,
                                FT_Bytes             lookuptbl_limit,
-                               GXV_Validator        valid )
+                               GXV_Validator        gxvalid )
   {
     FT_Bytes             p;
     FT_Bytes             limit;
     offset = (FT_UShort)( base_value_p->u +
                           ( relative_gindex * sizeof ( FT_UShort ) ) );
 
-    p     = valid->lookuptbl_head + offset;
+    p     = gxvalid->lookuptbl_head + offset;
     limit = lookuptbl_limit;
     GXV_LIMIT_CHECK( 2 );
 
   static void
   gxv_bsln_parts_fmt0_validate( FT_Bytes       tables,
                                 FT_Bytes       limit,
-                                GXV_Validator  valid )
+                                GXV_Validator  gxvalid )
   {
     FT_Bytes  p = tables;
 
     /* deltas */
     GXV_LIMIT_CHECK( 2 * GXV_BSLN_VALUE_COUNT );
 
-    valid->table_data = NULL;      /* No ctlPoints here. */
+    gxvalid->table_data = NULL;      /* No ctlPoints here. */
 
     GXV_EXIT;
   }
   static void
   gxv_bsln_parts_fmt1_validate( FT_Bytes       tables,
                                 FT_Bytes       limit,
-                                GXV_Validator  valid )
+                                GXV_Validator  gxvalid )
   {
     FT_Bytes  p = tables;
 
     GXV_NAME_ENTER( "parts format 1" );
 
     /* deltas */
-    gxv_bsln_parts_fmt0_validate( p, limit, valid );
+    gxv_bsln_parts_fmt0_validate( p, limit, gxvalid );
 
     /* mappingData */
-    valid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
-    valid->lookupval_func   = gxv_bsln_LookupValue_validate;
-    valid->lookupfmt4_trans = gxv_bsln_LookupFmt4_transit;
+    gxvalid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
+    gxvalid->lookupval_func   = gxv_bsln_LookupValue_validate;
+    gxvalid->lookupfmt4_trans = gxv_bsln_LookupFmt4_transit;
     gxv_LookupTable_validate( p + 2 * GXV_BSLN_VALUE_COUNT,
                               limit,
-                              valid );
+                              gxvalid );
 
     GXV_EXIT;
   }
   static void
   gxv_bsln_parts_fmt2_validate( FT_Bytes       tables,
                                 FT_Bytes       limit,
-                                GXV_Validator  valid )
+                                GXV_Validator  gxvalid )
   {
     FT_Bytes   p = tables;
 
     stdGlyph = FT_NEXT_USHORT( p );
     GXV_TRACE(( " (stdGlyph = %u)\n", stdGlyph ));
 
-    gxv_glyphid_validate( stdGlyph, valid );
+    gxv_glyphid_validate( stdGlyph, gxvalid );
 
     /* Record the position of ctlPoints */
     GXV_BSLN_DATA( ctlPoints_p ) = p;
           FT_INVALID_DATA;
       }
       else
-        gxv_ctlPoint_validate( stdGlyph, (FT_Short)ctlPoint, valid );
+        gxv_ctlPoint_validate( stdGlyph, (FT_Short)ctlPoint, gxvalid );
     }
 
     GXV_EXIT;
   static void
   gxv_bsln_parts_fmt3_validate( FT_Bytes       tables,
                                 FT_Bytes       limit,
-                                GXV_Validator  valid)
+                                GXV_Validator  gxvalid)
   {
     FT_Bytes  p = tables;
 
     GXV_NAME_ENTER( "parts format 3" );
 
     /* stdGlyph + ctlPoints */
-    gxv_bsln_parts_fmt2_validate( p, limit, valid );
+    gxv_bsln_parts_fmt2_validate( p, limit, gxvalid );
 
     /* mappingData */
-    valid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
-    valid->lookupval_func   = gxv_bsln_LookupValue_validate;
-    valid->lookupfmt4_trans = gxv_bsln_LookupFmt4_transit;
+    gxvalid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
+    gxvalid->lookupval_func   = gxv_bsln_LookupValue_validate;
+    gxvalid->lookupfmt4_trans = gxv_bsln_LookupFmt4_transit;
     gxv_LookupTable_validate( p + ( 2 + 2 * GXV_BSLN_VALUE_COUNT ),
                               limit,
-                              valid );
+                              gxvalid );
 
     GXV_EXIT;
   }
                      FT_Face       face,
                      FT_Validator  ftvalid )
   {
-    GXV_ValidatorRec  validrec;
-    GXV_Validator     valid = &validrec;
+    GXV_ValidatorRec  gxvalidrec;
+    GXV_Validator     gxvalid = &gxvalidrec;
 
     GXV_bsln_DataRec  bslnrec;
     GXV_bsln_Data     bsln = &bslnrec;
     };
 
 
-    valid->root       = ftvalid;
-    valid->table_data = bsln;
-    valid->face       = face;
+    gxvalid->root       = ftvalid;
+    gxvalid->table_data = bsln;
+    gxvalid->face       = face;
 
     FT_TRACE3(( "validating `bsln' table\n" ));
     GXV_INIT;
 
     bsln->defaultBaseline = defaultBaseline;
 
-    fmt_funcs_table[format]( p, limit, valid );
+    fmt_funcs_table[format]( p, limit, gxvalid );
 
     FT_TRACE4(( "\n" ));
   }
index 72efd6f..8e72a72 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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.                      */
 /*                                                                         */
@@ -65,7 +65,7 @@
                                    FT_UShort*     buff,
                                    FT_UInt        nmemb,
                                    FT_UShort      limit,
-                                   GXV_Validator  valid )
+                                   GXV_Validator  gxvalid )
   {
     FT_UInt  i;
 
                                   FT_ULong*      buff,
                                   FT_UInt        nmemb,
                                   FT_ULong       limit,
-                                  GXV_Validator  valid)
+                                  GXV_Validator  gxvalid)
   {
     FT_UInt  i;
 
                             FT_Bytes       limit,
                             FT_Byte*       min,
                             FT_Byte*       max,
-                            GXV_Validator  valid )
+                            GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
       *max = (FT_Byte)FT_MAX( *max, val );
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
   }
 
 
                               FT_Bytes       limit,
                               FT_UShort*     min,
                               FT_UShort*     max,
-                              GXV_Validator  valid )
+                              GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
       *max = (FT_Byte)FT_MAX( *max, val );
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
   }
 
 
 
   static void
   gxv_BinSrchHeader_check_consistency( GXV_BinSrchHeader*  binSrchHeader,
-                                       GXV_Validator       valid )
+                                       GXV_Validator       gxvalid )
   {
     FT_UShort  searchRange;
     FT_UShort  entrySelector;
                               FT_Bytes       limit,
                               FT_UShort*     unitSize_p,
                               FT_UShort*     nUnits_p,
-                              GXV_Validator  valid )
+                              GXV_Validator  gxvalid )
   {
     FT_Bytes           p = table;
     GXV_BinSrchHeader  binSrchHeader;
     binSrchHeader.rangeShift    = FT_NEXT_USHORT( p );
     GXV_TRACE(( "nUnits %d\n", binSrchHeader.nUnits ));
 
-    gxv_BinSrchHeader_check_consistency( &binSrchHeader, valid );
+    gxv_BinSrchHeader_check_consistency( &binSrchHeader, gxvalid );
 
     if ( *unitSize_p == 0 )
       *unitSize_p = binSrchHeader.unitSize;
     if ( *nUnits_p == 0 )
       *nUnits_p = binSrchHeader.nUnits;
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
     GXV_EXIT;
   }
 
   static void
   gxv_LookupTable_fmt0_validate( FT_Bytes       table,
                                  FT_Bytes       limit,
-                                 GXV_Validator  valid )
+                                 GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
     FT_UShort  i;
 
     GXV_NAME_ENTER( "LookupTable format 0" );
 
-    GXV_LIMIT_CHECK( 2 * valid->face->num_glyphs );
+    GXV_LIMIT_CHECK( 2 * gxvalid->face->num_glyphs );
 
-    for ( i = 0; i < valid->face->num_glyphs; i++ )
+    for ( i = 0; i < gxvalid->face->num_glyphs; i++ )
     {
       GXV_LIMIT_CHECK( 2 );
       if ( p + 2 >= limit )     /* some fonts have too-short fmt0 array */
       {
         GXV_TRACE(( "too short, glyphs %d - %d are missing\n",
-                    i, valid->face->num_glyphs ));
+                    i, gxvalid->face->num_glyphs ));
         GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
         break;
       }
 
-      value = GXV_LOOKUP_VALUE_LOAD( p, valid->lookupval_sign );
-      valid->lookupval_func( i, &value, valid );
+      value = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign );
+      gxvalid->lookupval_func( i, &value, gxvalid );
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
     GXV_EXIT;
   }
 
   static void
   gxv_LookupTable_fmt2_skip_endmarkers( FT_Bytes       table,
                                         FT_UShort      unitSize,
-                                        GXV_Validator  valid )
+                                        GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
 
-    while ( ( p + 4 ) < valid->root->limit )
+    while ( ( p + 4 ) < gxvalid->root->limit )
     {
       if ( p[0] != 0xFF || p[1] != 0xFF || /* lastGlyph */
            p[2] != 0xFF || p[3] != 0xFF )  /* firstGlyph */
       p += unitSize;
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
   }
 
 
   static void
   gxv_LookupTable_fmt2_validate( FT_Bytes       table,
                                  FT_Bytes       limit,
-                                 GXV_Validator  valid )
+                                 GXV_Validator  gxvalid )
   {
     FT_Bytes             p = table;
     FT_UShort            gid;
     GXV_NAME_ENTER( "LookupTable format 2" );
 
     unitSize = nUnits = 0;
-    gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, valid );
-    p += valid->subtable_length;
+    gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, gxvalid );
+    p += gxvalid->subtable_length;
 
     GXV_UNITSIZE_VALIDATE( "format2", unitSize, nUnits, 6 );
 
       GXV_LIMIT_CHECK( 2 + 2 + 2 );
       lastGlyph  = FT_NEXT_USHORT( p );
       firstGlyph = FT_NEXT_USHORT( p );
-      value      = GXV_LOOKUP_VALUE_LOAD( p, valid->lookupval_sign );
+      value      = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign );
 
-      gxv_glyphid_validate( firstGlyph, valid );
-      gxv_glyphid_validate( lastGlyph, valid );
+      gxv_glyphid_validate( firstGlyph, gxvalid );
+      gxv_glyphid_validate( lastGlyph, gxvalid );
 
       if ( lastGlyph < gid )
       {
                     unit, lastGlyph, firstGlyph ));
         GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
 
-        if ( valid->root->level == FT_VALIDATE_TIGHT )
+        if ( gxvalid->root->level == FT_VALIDATE_TIGHT )
           continue;     /* ftxvalidator silently skips such an entry */
 
         FT_TRACE4(( "continuing with exchanged values\n" ));
       }
 
       for ( gid = firstGlyph; gid <= lastGlyph; gid++ )
-        valid->lookupval_func( gid, &value, valid );
+        gxvalid->lookupval_func( gid, &value, gxvalid );
     }
 
-    gxv_LookupTable_fmt2_skip_endmarkers( p, unitSize, valid );
-    p += valid->subtable_length;
+    gxv_LookupTable_fmt2_skip_endmarkers( p, unitSize, gxvalid );
+    p += gxvalid->subtable_length;
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
     GXV_EXIT;
   }
 
   static void
   gxv_LookupTable_fmt4_validate( FT_Bytes       table,
                                  FT_Bytes       limit,
-                                 GXV_Validator  valid )
+                                 GXV_Validator  gxvalid )
   {
     FT_Bytes             p = table;
     FT_UShort            unit;
     GXV_NAME_ENTER( "LookupTable format 4" );
 
     unitSize = nUnits = 0;
-    gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, valid );
-    p += valid->subtable_length;
+    gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, gxvalid );
+    p += gxvalid->subtable_length;
 
     GXV_UNITSIZE_VALIDATE( "format4", unitSize, nUnits, 6 );
 
       lastGlyph  = FT_NEXT_USHORT( p );
       firstGlyph = FT_NEXT_USHORT( p );
 
-      gxv_glyphid_validate( firstGlyph, valid );
-      gxv_glyphid_validate( lastGlyph, valid );
+      gxv_glyphid_validate( firstGlyph, gxvalid );
+      gxv_glyphid_validate( lastGlyph, gxvalid );
 
       if ( lastGlyph < gid )
       {
                     unit, lastGlyph, firstGlyph ));
         GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
 
-        if ( valid->root->level == FT_VALIDATE_TIGHT )
+        if ( gxvalid->root->level == FT_VALIDATE_TIGHT )
           continue; /* ftxvalidator silently skips such an entry */
 
         FT_TRACE4(( "continuing with exchanged values\n" ));
 
       for ( gid = firstGlyph; gid <= lastGlyph; gid++ )
       {
-        value = valid->lookupfmt4_trans( (FT_UShort)( gid - firstGlyph ),
+        value = gxvalid->lookupfmt4_trans( (FT_UShort)( gid - firstGlyph ),
                                          &base_value,
                                          limit,
-                                         valid );
+                                         gxvalid );
 
-        valid->lookupval_func( gid, &value, valid );
+        gxvalid->lookupval_func( gid, &value, gxvalid );
       }
     }
 
-    gxv_LookupTable_fmt2_skip_endmarkers( p, unitSize, valid );
-    p += valid->subtable_length;
+    gxv_LookupTable_fmt2_skip_endmarkers( p, unitSize, gxvalid );
+    p += gxvalid->subtable_length;
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
     GXV_EXIT;
   }
 
   static void
   gxv_LookupTable_fmt6_skip_endmarkers( FT_Bytes       table,
                                         FT_UShort      unitSize,
-                                        GXV_Validator  valid )
+                                        GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
 
-    while ( p < valid->root->limit )
+    while ( p < gxvalid->root->limit )
     {
       if ( p[0] != 0xFF || p[1] != 0xFF )
         break;
       p += unitSize;
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
   }
 
 
   static void
   gxv_LookupTable_fmt6_validate( FT_Bytes       table,
                                  FT_Bytes       limit,
-                                 GXV_Validator  valid )
+                                 GXV_Validator  gxvalid )
   {
     FT_Bytes             p = table;
     FT_UShort            unit;
     GXV_NAME_ENTER( "LookupTable format 6" );
 
     unitSize = nUnits = 0;
-    gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, valid );
-    p += valid->subtable_length;
+    gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, gxvalid );
+    p += gxvalid->subtable_length;
 
     GXV_UNITSIZE_VALIDATE( "format6", unitSize, nUnits, 4 );
 
     {
       GXV_LIMIT_CHECK( 2 + 2 );
       glyph = FT_NEXT_USHORT( p );
-      value = GXV_LOOKUP_VALUE_LOAD( p, valid->lookupval_sign );
+      value = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign );
 
-      if ( gxv_glyphid_validate( glyph, valid ) )
+      if ( gxv_glyphid_validate( glyph, gxvalid ) )
         GXV_TRACE(( " endmarker found within defined range"
                     " (entry %d < nUnits=%d)\n",
                     unit, nUnits ));
       }
       prev_glyph = glyph;
 
-      valid->lookupval_func( glyph, &value, valid );
+      gxvalid->lookupval_func( glyph, &value, gxvalid );
     }
 
-    gxv_LookupTable_fmt6_skip_endmarkers( p, unitSize, valid );
-    p += valid->subtable_length;
+    gxv_LookupTable_fmt6_skip_endmarkers( p, unitSize, gxvalid );
+    p += gxvalid->subtable_length;
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
     GXV_EXIT;
   }
 
   static void
   gxv_LookupTable_fmt8_validate( FT_Bytes       table,
                                  FT_Bytes       limit,
-                                 GXV_Validator  valid )
+                                 GXV_Validator  gxvalid )
   {
     FT_Bytes              p = table;
     FT_UShort             i;
     firstGlyph = FT_NEXT_USHORT( p );
     glyphCount = FT_NEXT_USHORT( p );
 
-    gxv_glyphid_validate( firstGlyph, valid );
-    gxv_glyphid_validate( (FT_UShort)( firstGlyph + glyphCount ), valid );
+    gxv_glyphid_validate( firstGlyph, gxvalid );
+    gxv_glyphid_validate( (FT_UShort)( firstGlyph + glyphCount ), gxvalid );
 
     /* valueArray */
     for ( i = 0; i < glyphCount; i++ )
     {
       GXV_LIMIT_CHECK( 2 );
-      value = GXV_LOOKUP_VALUE_LOAD( p, valid->lookupval_sign );
-      valid->lookupval_func( (FT_UShort)( firstGlyph + i ), &value, valid );
+      value = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign );
+      gxvalid->lookupval_func( (FT_UShort)( firstGlyph + i ), &value, gxvalid );
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
     GXV_EXIT;
   }
 
   FT_LOCAL_DEF( void )
   gxv_LookupTable_validate( FT_Bytes       table,
                             FT_Bytes       limit,
-                            GXV_Validator  valid )
+                            GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
     FT_UShort  format;
     GXV_NAME_ENTER( "LookupTable" );
 
     /* lookuptbl_head may be used in fmt4 transit function. */
-    valid->lookuptbl_head = table;
+    gxvalid->lookuptbl_head = table;
 
     /* format */
     GXV_LIMIT_CHECK( 2 );
     if ( func == NULL )
       FT_INVALID_FORMAT;
 
-    func( p, limit, valid );
-    p += valid->subtable_length;
+    func( p, limit, gxvalid );
+    p += gxvalid->subtable_length;
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
 
     GXV_EXIT;
   }
 
   FT_LOCAL_DEF( FT_Int )
   gxv_glyphid_validate( FT_UShort      gid,
-                        GXV_Validator  valid )
+                        GXV_Validator  gxvalid )
   {
     FT_Face  face;
 
       return 1;
     }
 
-    face = valid->face;
+    face = gxvalid->face;
     if ( face->num_glyphs < gid )
     {
       GXV_TRACE(( " gxv_glyphid_check() gid overflow: num_glyphs %d < %d\n",
   FT_LOCAL_DEF( void )
   gxv_ctlPoint_validate( FT_UShort      gid,
                          FT_Short       ctl_point,
-                         GXV_Validator  valid )
+                         GXV_Validator  gxvalid )
   {
     FT_Face       face;
     FT_Error      error;
     short         n_points;
 
 
-    face = valid->face;
+    face = gxvalid->face;
 
     error = FT_Load_Glyph( face,
                            gid,
   gxv_sfntName_validate( FT_UShort      name_index,
                          FT_UShort      min_index,
                          FT_UShort      max_index,
-                         GXV_Validator  valid )
+                         GXV_Validator  gxvalid )
   {
     FT_SfntName  name;
     FT_UInt      i;
     if ( name_index < min_index || max_index < name_index )
       FT_INVALID_FORMAT;
 
-    nnames = FT_Get_Sfnt_Name_Count( valid->face );
+    nnames = FT_Get_Sfnt_Name_Count( gxvalid->face );
     for ( i = 0; i < nnames; i++ )
     {
-      if ( FT_Get_Sfnt_Name( valid->face, i, &name ) != GXV_Err_Ok )
+      if ( FT_Get_Sfnt_Name( gxvalid->face, i, &name ) != FT_Err_Ok )
         continue ;
 
       if ( name.name_id == name_index )
                            FT_UShort*     length_p,
                            FT_UShort      stateSize,
                            FT_Byte*       maxClassID_p,
-                           GXV_Validator  valid )
+                           GXV_Validator  gxvalid )
   {
     FT_Bytes   p     = table;
     FT_Bytes   limit = table + *length_p;
     if ( !nGlyphs )
       goto Out;
 
-    gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs ), valid );
+    gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs ), gxvalid );
 
     {
       FT_Byte    nGlyphInClass[256];
                            FT_UShort      stateSize,
                            FT_Byte*       maxState_p,
                            FT_Byte*       maxEntry_p,
-                           GXV_Validator  valid )
+                           GXV_Validator  gxvalid )
   {
-    FT_Bytes  p = table;
+    FT_Bytes  p     = table;
     FT_Bytes  limit = table + *length_p;
     FT_Byte   clazz;
     FT_Byte   entry;
                            FT_Byte        maxClassID,
                            FT_Bytes       statetable_table,
                            FT_Bytes       statetable_limit,
-                           GXV_Validator  valid )
+                           GXV_Validator  gxvalid )
   {
     FT_Bytes  p     = table;
     FT_Bytes  limit = table + *length_p;
         goto Exit;
       }
 
-      if ( NULL != valid->statetable.entry_validate_func )
-        valid->statetable.entry_validate_func( state,
-                                               flags,
-                                               &glyphOffset,
-                                               statetable_table,
-                                               statetable_limit,
-                                               valid );
+      if ( NULL != gxvalid->statetable.entry_validate_func )
+        gxvalid->statetable.entry_validate_func( state,
+                                                 flags,
+                                                 &glyphOffset,
+                                                 statetable_table,
+                                                 statetable_limit,
+                                                 gxvalid );
     }
 
   Exit:
                                  FT_UShort*     classTable_length_p,
                                  FT_UShort*     stateArray_length_p,
                                  FT_UShort*     entryTable_length_p,
-                                 GXV_Validator  valid )
+                                 GXV_Validator  gxvalid )
   {
     FT_UShort   o[3];
     FT_UShort*  l[3];
     l[1] = stateArray_length_p;
     l[2] = entryTable_length_p;
 
-    gxv_set_length_by_ushort_offset( o, l, buff, 3, table_size, valid );
+    gxv_set_length_by_ushort_offset( o, l, buff, 3, table_size, gxvalid );
   }
 
 
   FT_LOCAL_DEF( void )
   gxv_StateTable_validate( FT_Bytes       table,
                            FT_Bytes       limit,
-                           GXV_Validator  valid )
+                           GXV_Validator  gxvalid )
   {
     FT_UShort   stateSize;
     FT_UShort   classTable;     /* offset to Class(Sub)Table */
     if ( stateSize > 0xFF )
       FT_INVALID_DATA;
 
-    if ( valid->statetable.optdata_load_func != NULL )
-      valid->statetable.optdata_load_func( p, limit, valid );
+    if ( gxvalid->statetable.optdata_load_func != NULL )
+      gxvalid->statetable.optdata_load_func( p, limit, gxvalid );
 
-    if ( valid->statetable.subtable_setup_func != NULL)
-      setup_func = valid->statetable.subtable_setup_func;
+    if ( gxvalid->statetable.subtable_setup_func != NULL)
+      setup_func = gxvalid->statetable.subtable_setup_func;
     else
       setup_func = gxv_StateTable_subtable_setup;
 
                 &classTable_length,
                 &stateArray_length,
                 &entryTable_length,
-                valid );
+                gxvalid );
 
     GXV_TRACE(( "StateTable Subtables\n" ));
 
                                &classTable_length,
                                stateSize,
                                &maxClassID,
-                               valid );
+                               gxvalid );
     else
       maxClassID = (FT_Byte)( stateSize - 1 );
 
                                stateSize,
                                &maxState,
                                &maxEntry,
-                               valid );
+                               gxvalid );
     else
     {
+#if 0
       maxState = 1;     /* 0:start of text, 1:start of line are predefined */
+#endif
       maxEntry = 0;
     }
 
                                maxClassID,
                                table,
                                limit,
-                               valid );
+                               gxvalid );
 
     GXV_EXIT;
   }
                                   FT_ULong*      classTable_length_p,
                                   FT_ULong*      stateArray_length_p,
                                   FT_ULong*      entryTable_length_p,
-                                  GXV_Validator  valid )
+                                  GXV_Validator  gxvalid )
   {
     FT_ULong   o[3];
     FT_ULong*  l[3];
     l[1] = stateArray_length_p;
     l[2] = entryTable_length_p;
 
-    gxv_set_length_by_ulong_offset( o, l, buff, 3, table_size, valid );
+    gxv_set_length_by_ulong_offset( o, l, buff, 3, table_size, gxvalid );
   }
 
 
   static void
   gxv_XClassTable_lookupval_validate( FT_UShort            glyph,
                                       GXV_LookupValueCPtr  value_p,
-                                      GXV_Validator        valid )
+                                      GXV_Validator        gxvalid )
   {
     FT_UNUSED( glyph );
 
-    if ( value_p->u >= valid->xstatetable.nClasses )
+    if ( value_p->u >= gxvalid->xstatetable.nClasses )
       FT_INVALID_DATA;
-    if ( value_p->u > valid->xstatetable.maxClassID )
-      valid->xstatetable.maxClassID = value_p->u;
+    if ( value_p->u > gxvalid->xstatetable.maxClassID )
+      gxvalid->xstatetable.maxClassID = value_p->u;
   }
 
 
   gxv_XClassTable_lookupfmt4_transit( FT_UShort            relative_gindex,
                                       GXV_LookupValueCPtr  base_value_p,
                                       FT_Bytes             lookuptbl_limit,
-                                      GXV_Validator        valid )
+                                      GXV_Validator        gxvalid )
   {
     FT_Bytes             p;
     FT_Bytes             limit;
     offset = (FT_UShort)( base_value_p->u +
                           relative_gindex * sizeof ( FT_UShort ) );
 
-    p     = valid->lookuptbl_head + offset;
+    p     = gxvalid->lookuptbl_head + offset;
     limit = lookuptbl_limit;
 
     GXV_LIMIT_CHECK ( 2 );
                             FT_ULong       stateSize,
                             FT_UShort*     maxState_p,
                             FT_UShort*     maxEntry_p,
-                            GXV_Validator  valid )
+                            GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
     FT_Bytes   limit = table + *length_p;
                             FT_UShort      maxClassID,
                             FT_Bytes       xstatetable_table,
                             FT_Bytes       xstatetable_limit,
-                            GXV_Validator  valid )
+                            GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
     FT_Bytes   limit = table + *length_p;
         goto Exit;
       }
 
-      if ( NULL != valid->xstatetable.entry_validate_func )
-        valid->xstatetable.entry_validate_func( state,
-                                                flags,
-                                                &glyphOffset,
-                                                xstatetable_table,
-                                                xstatetable_limit,
-                                                valid );
+      if ( NULL != gxvalid->xstatetable.entry_validate_func )
+        gxvalid->xstatetable.entry_validate_func( state,
+                                                  flags,
+                                                  &glyphOffset,
+                                                  xstatetable_table,
+                                                  xstatetable_limit,
+                                                  gxvalid );
     }
 
   Exit:
   FT_LOCAL_DEF( void )
   gxv_XStateTable_validate( FT_Bytes       table,
                             FT_Bytes       limit,
-                            GXV_Validator  valid )
+                            GXV_Validator  gxvalid )
   {
     /* StateHeader members */
     FT_ULong   classTable;      /* offset to Class(Sub)Table */
     GXV_TRACE(( "XStateTable header\n" ));
 
     GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 );
-    valid->xstatetable.nClasses = FT_NEXT_ULONG( p );
+    gxvalid->xstatetable.nClasses = FT_NEXT_ULONG( p );
     classTable = FT_NEXT_ULONG( p );
     stateArray = FT_NEXT_ULONG( p );
     entryTable = FT_NEXT_ULONG( p );
 
-    GXV_TRACE(( "nClasses =0x%08x\n", valid->xstatetable.nClasses ));
+    GXV_TRACE(( "nClasses =0x%08x\n", gxvalid->xstatetable.nClasses ));
     GXV_TRACE(( "offset to classTable=0x%08x\n", classTable ));
     GXV_TRACE(( "offset to stateArray=0x%08x\n", stateArray ));
     GXV_TRACE(( "offset to entryTable=0x%08x\n", entryTable ));
 
-    if ( valid->xstatetable.nClasses > 0xFFFFU )
+    if ( gxvalid->xstatetable.nClasses > 0xFFFFU )
       FT_INVALID_DATA;
 
     GXV_TRACE(( "StateTable Subtables\n" ));
 
-    if ( valid->xstatetable.optdata_load_func != NULL )
-      valid->xstatetable.optdata_load_func( p, limit, valid );
+    if ( gxvalid->xstatetable.optdata_load_func != NULL )
+      gxvalid->xstatetable.optdata_load_func( p, limit, gxvalid );
 
-    if ( valid->xstatetable.subtable_setup_func != NULL )
-      setup_func = valid->xstatetable.subtable_setup_func;
+    if ( gxvalid->xstatetable.subtable_setup_func != NULL )
+      setup_func = gxvalid->xstatetable.subtable_setup_func;
     else
       setup_func = gxv_XStateTable_subtable_setup;
 
                 &classTable_length,
                 &stateArray_length,
                 &entryTable_length,
-                valid );
+                gxvalid );
 
     if ( classTable != 0 )
     {
-      valid->xstatetable.maxClassID = 0;
-      valid->lookupval_sign         = GXV_LOOKUPVALUE_UNSIGNED;
-      valid->lookupval_func         = gxv_XClassTable_lookupval_validate;
-      valid->lookupfmt4_trans       = gxv_XClassTable_lookupfmt4_transit;
+      gxvalid->xstatetable.maxClassID = 0;
+      gxvalid->lookupval_sign         = GXV_LOOKUPVALUE_UNSIGNED;
+      gxvalid->lookupval_func         = gxv_XClassTable_lookupval_validate;
+      gxvalid->lookupfmt4_trans       = gxv_XClassTable_lookupfmt4_transit;
       gxv_LookupTable_validate( table + classTable,
                                 table + classTable + classTable_length,
-                                valid );
-      if ( valid->subtable_length < classTable_length )
-        classTable_length = valid->subtable_length;
+                                gxvalid );
+#if 0
+      if ( gxvalid->subtable_length < classTable_length )
+        classTable_length = gxvalid->subtable_length;
+#endif
     }
     else
     {
       /* XXX: check range? */
-      valid->xstatetable.maxClassID =
-        (FT_UShort)( valid->xstatetable.nClasses - 1 );
+      gxvalid->xstatetable.maxClassID =
+        (FT_UShort)( gxvalid->xstatetable.nClasses - 1 );
     }
 
     if ( stateArray != 0 )
       gxv_XStateArray_validate( table + stateArray,
                                 &stateArray_length,
-                                valid->xstatetable.maxClassID,
-                                valid->xstatetable.nClasses,
+                                gxvalid->xstatetable.maxClassID,
+                                gxvalid->xstatetable.nClasses,
                                 &maxState,
                                 &maxEntry,
-                                valid );
+                                gxvalid );
     else
     {
+#if 0
       maxState = 1; /* 0:start of text, 1:start of line are predefined */
+#endif
       maxEntry = 0;
     }
 
                                 &entryTable_length,
                                 maxEntry,
                                 stateArray_length,
-                                valid->xstatetable.maxClassID,
+                                gxvalid->xstatetable.maxClassID,
                                 table,
                                 limit,
-                                valid );
+                                gxvalid );
 
     GXV_EXIT;
   }
 
   FT_LOCAL_DEF( void )
   gxv_odtect_validate( GXV_odtect_Range  odtect,
-                       GXV_Validator     valid )
+                       GXV_Validator     gxvalid )
   {
     FT_UInt  i, j;
 
                                       odtect->range[j].start,
                                       odtect->range[j].length ) )
         {
+#ifdef FT_DEBUG_LEVEL_TRACE
           if ( odtect->range[i].name || odtect->range[j].name )
             GXV_TRACE(( "found overlap between range %d and range %d\n",
                         i, j ));
             GXV_TRACE(( "found overlap between `%s' and `%s\'\n",
                         odtect->range[i].name,
                         odtect->range[j].name ));
+#endif
           FT_INVALID_OFFSET;
         }
 
index 1ff87e4..f114345 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueTypeGX/AAT common tables validation (specification).             */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2012                                             */
+/*  Copyright 2004, 2005, 2012, 2014                                       */
 /*  by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
@@ -62,7 +62,7 @@ FT_BEGIN_HEADER
 
 #undef GXV_LOAD_UNUSED_VARS /* debug purpose */
 
-#define IS_PARANOID_VALIDATION          ( valid->root->level >= FT_VALIDATE_PARANOID )
+#define IS_PARANOID_VALIDATION          ( gxvalid->root->level >= FT_VALIDATE_PARANOID )
 #define GXV_SET_ERR_IF_PARANOID( err )  { if ( IS_PARANOID_VALIDATION ) ( err ); }
 
   /*************************************************************************/
@@ -81,7 +81,7 @@ FT_BEGIN_HEADER
   typedef void
   (*GXV_Validate_Func)( FT_Bytes       table,
                         FT_Bytes       limit,
-                        GXV_Validator  valid );
+                        GXV_Validator  gxvalid );
 
 
   /* ====================== LookupTable Validator ======================== */
@@ -106,13 +106,13 @@ FT_BEGIN_HEADER
   typedef void
   (*GXV_Lookup_Value_Validate_Func)( FT_UShort            glyph,
                                      GXV_LookupValueCPtr  value_p,
-                                     GXV_Validator        valid );
+                                     GXV_Validator        gxvalid );
 
   typedef GXV_LookupValueDesc
   (*GXV_Lookup_Fmt4_Transit_Func)( FT_UShort            relative_gindex,
                                    GXV_LookupValueCPtr  base_value_p,
                                    FT_Bytes             lookuptbl_limit,
-                                   GXV_Validator        valid );
+                                   GXV_Validator        gxvalid );
 
 
   /* ====================== StateTable Validator ========================= */
@@ -131,10 +131,10 @@ FT_BEGIN_HEADER
 
 
 #define GXV_GLYPHOFFSET_FMT( table )           \
-        ( valid->table.entry_glyphoffset_fmt )
+        ( gxvalid->table.entry_glyphoffset_fmt )
 
 #define GXV_GLYPHOFFSET_SIZE( table )              \
-        ( valid->table.entry_glyphoffset_fmt / 2 )
+        ( gxvalid->table.entry_glyphoffset_fmt / 2 )
 
 
   /* ----------------------- 16bit StateTable ---------------------------- */
@@ -160,7 +160,7 @@ FT_BEGIN_HEADER
                                          FT_UShort*     classTable_length_p,
                                          FT_UShort*     stateArray_length_p,
                                          FT_UShort*     entryTable_length_p,
-                                         GXV_Validator  valid );
+                                         GXV_Validator  gxvalid );
 
   typedef void
   (*GXV_StateTable_Entry_Validate_Func)(
@@ -169,12 +169,12 @@ FT_BEGIN_HEADER
      GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,
      FT_Bytes                        statetable_table,
      FT_Bytes                        statetable_limit,
-     GXV_Validator                   valid );
+     GXV_Validator                   gxvalid );
 
   typedef void
   (*GXV_StateTable_OptData_Load_Func)( FT_Bytes       table,
                                        FT_Bytes       limit,
-                                       GXV_Validator  valid );
+                                       GXV_Validator  gxvalid );
 
   typedef struct  GXV_StateTable_ValidatorRec_
   {
@@ -202,7 +202,7 @@ FT_BEGIN_HEADER
                                           FT_ULong*      classTable_length_p,
                                           FT_ULong*      stateArray_length_p,
                                           FT_ULong*      entryTable_length_p,
-                                          GXV_Validator  valid );
+                                          GXV_Validator  gxvalid );
 
   typedef void
   (*GXV_XStateTable_Entry_Validate_Func)(
@@ -211,7 +211,7 @@ FT_BEGIN_HEADER
      GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,
      FT_Bytes                        xstatetable_table,
      FT_Bytes                        xstatetable_limit,
-     GXV_Validator                   valid );
+     GXV_Validator                   gxvalid );
 
 
   typedef GXV_StateTable_OptData_Load_Func  GXV_XStateTable_OptData_Load_Func;
@@ -263,35 +263,35 @@ FT_BEGIN_HEADER
 
 
 #define GXV_TABLE_DATA( tag, field )                           \
-        ( ( (GXV_ ## tag ## _Data)valid->table_data )->field )
+        ( ( (GXV_ ## tag ## _Data)gxvalid->table_data )->field )
 
 #undef  FT_INVALID_
-#define FT_INVALID_( _prefix, _error )                         \
-          ft_validator_error( valid->root, _prefix ## _error )
+#define FT_INVALID_( _error ) \
+          ft_validator_error( gxvalid->root, FT_THROW( _error ) )
 
 #define GXV_LIMIT_CHECK( _count )                                     \
           FT_BEGIN_STMNT                                              \
-            if ( p + _count > ( limit? limit : valid->root->limit ) ) \
+            if ( p + _count > ( limit? limit : gxvalid->root->limit ) ) \
               FT_INVALID_TOO_SHORT;                                   \
           FT_END_STMNT
 
 
 #ifdef FT_DEBUG_LEVEL_TRACE
 
-#define GXV_INIT  valid->debug_indent = 0
+#define GXV_INIT  gxvalid->debug_indent = 0
 
 #define GXV_NAME_ENTER( name )                             \
           FT_BEGIN_STMNT                                   \
-            valid->debug_indent += 2;                      \
-            FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \
+            gxvalid->debug_indent += 2;                      \
+            FT_TRACE4(( "%*.s", gxvalid->debug_indent, 0 )); \
             FT_TRACE4(( "%s table\n", name ));             \
           FT_END_STMNT
 
-#define GXV_EXIT  valid->debug_indent -= 2
+#define GXV_EXIT  gxvalid->debug_indent -= 2
 
 #define GXV_TRACE( s )                                     \
           FT_BEGIN_STMNT                                   \
-            FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \
+            FT_TRACE4(( "%*.s", gxvalid->debug_indent, 0 )); \
             FT_TRACE4( s );                                \
           FT_END_STMNT
 
@@ -318,7 +318,7 @@ FT_BEGIN_HEADER
           FT_BEGIN_STMNT                  \
             {                             \
               if ( (a) & 3 )              \
-                FT_INVALID_OFFSET ;       \
+                FT_INVALID_OFFSET       \
             }                             \
           FT_END_STMNT
 
@@ -349,7 +349,7 @@ FT_BEGIN_HEADER
                                                         \
                                                         \
               for ( b = p; b < (FT_Bytes)p + len; b++ ) \
-                if ( 0x40 < *b && *b < 0x7e )           \
+                if ( 0x40 < *b && *b < 0x7E )           \
                   FT_TRACE1(("%c", *b)) ;               \
                 else                                    \
                   FT_TRACE1(("\\x%02x", *b)) ;          \
@@ -373,12 +373,12 @@ FT_BEGIN_HEADER
                               FT_Bytes       limit,
                               FT_UShort*     unitSize_p,
                               FT_UShort*     nUnits_p,
-                              GXV_Validator  valid );
+                              GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_LookupTable_validate( FT_Bytes       table,
                             FT_Bytes       limit,
-                            GXV_Validator  valid );
+                            GXV_Validator  gxvalid );
 
 
   /*************************************************************************/
@@ -391,7 +391,7 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( FT_Int )
   gxv_glyphid_validate( FT_UShort      gid,
-                        GXV_Validator  valid );
+                        GXV_Validator  gxvalid );
 
 
   /*************************************************************************/
@@ -405,7 +405,7 @@ FT_BEGIN_HEADER
   FT_LOCAL( void )
   gxv_ctlPoint_validate( FT_UShort      gid,
                          FT_Short       ctl_point,
-                         GXV_Validator  valid );
+                         GXV_Validator  gxvalid );
 
 
   /*************************************************************************/
@@ -420,7 +420,7 @@ FT_BEGIN_HEADER
   gxv_sfntName_validate( FT_UShort      name_index,
                          FT_UShort      min_index,
                          FT_UShort      max_index,
-                         GXV_Validator  valid );
+                         GXV_Validator  gxvalid );
 
 
   /*************************************************************************/
@@ -439,7 +439,7 @@ FT_BEGIN_HEADER
                                  FT_UShort*     classTable_length_p,
                                  FT_UShort*     stateArray_length_p,
                                  FT_UShort*     entryTable_length_p,
-                                 GXV_Validator  valid );
+                                 GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_XStateTable_subtable_setup( FT_ULong       table_size,
@@ -449,17 +449,17 @@ FT_BEGIN_HEADER
                                   FT_ULong*      classTable_length_p,
                                   FT_ULong*      stateArray_length_p,
                                   FT_ULong*      entryTable_length_p,
-                                  GXV_Validator  valid );
+                                  GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_StateTable_validate( FT_Bytes       table,
                            FT_Bytes       limit,
-                           GXV_Validator  valid );
+                           GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_XStateTable_validate( FT_Bytes       table,
                             FT_Bytes       limit,
-                            GXV_Validator  valid );
+                            GXV_Validator  gxvalid );
 
 
   /*************************************************************************/
@@ -475,14 +475,14 @@ FT_BEGIN_HEADER
                             FT_Bytes       limit,
                             FT_Byte*       min,
                             FT_Byte*       max,
-                            GXV_Validator  valid );
+                            GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_array_getlimits_ushort( FT_Bytes       table,
                               FT_Bytes       limit,
                               FT_UShort*     min,
                               FT_UShort*     max,
-                              GXV_Validator  valid );
+                              GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_set_length_by_ushort_offset( FT_UShort*     offset,
@@ -490,7 +490,7 @@ FT_BEGIN_HEADER
                                    FT_UShort*     buff,
                                    FT_UInt        nmemb,
                                    FT_UShort      limit,
-                                   GXV_Validator  valid );
+                                   GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_set_length_by_ulong_offset( FT_ULong*      offset,
@@ -498,19 +498,19 @@ FT_BEGIN_HEADER
                                   FT_ULong*      buff,
                                   FT_UInt        nmemb,
                                   FT_ULong       limit,
-                                  GXV_Validator  valid);
+                                  GXV_Validator  gxvalid);
 
 
 #define GXV_SUBTABLE_OFFSET_CHECK( _offset )          \
           FT_BEGIN_STMNT                              \
-            if ( (_offset) > valid->subtable_length ) \
+            if ( (_offset) > gxvalid->subtable_length ) \
               FT_INVALID_OFFSET;                      \
           FT_END_STMNT
 
 #define GXV_SUBTABLE_LIMIT_CHECK( _count )                  \
           FT_BEGIN_STMNT                                    \
-            if ( ( p + (_count) - valid->subtable_start ) > \
-                   valid->subtable_length )                 \
+            if ( ( p + (_count) - gxvalid->subtable_start ) > \
+                   gxvalid->subtable_length )                 \
               FT_INVALID_TOO_SHORT;                         \
           FT_END_STMNT
 
@@ -556,7 +556,7 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   gxv_odtect_validate( GXV_odtect_Range  odtect,
-                       GXV_Validator     valid );
+                       GXV_Validator     gxvalid );
 
 
 #define GXV_ODTECT( n, odtect )                              \
index 7d2ef78..c573b72 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueTypeGX/AAT validation module error codes (specification only).   */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2012                                             */
+/*  Copyright 2004, 2005, 2012-2013                                        */
 /*    by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
@@ -41,9 +41,7 @@
 
 #undef  FT_ERR_PREFIX
 #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
 
index 6f75650..69298b2 100644 (file)
@@ -82,7 +82,7 @@
   gxv_feat_registry_validate( FT_UShort      feature,
                               FT_UShort      nSettings,
                               FT_Bool        exclusive,
-                              GXV_Validator  valid )
+                              GXV_Validator  gxvalid )
   {
     GXV_NAME_ENTER( "feature in registry" );
 
     {
       /* Don't use here. Apple is reserved. */
       GXV_TRACE(( "feature number %d is reserved by Apple\n", feature ));
-      if ( valid->root->level >= FT_VALIDATE_TIGHT )
+      if ( gxvalid->root->level >= FT_VALIDATE_TIGHT )
         FT_INVALID_DATA;
     }
 
       GXV_TRACE(( "feature %d: nSettings %d != defined nSettings %d\n",
                   feature, nSettings,
                   gxv_feat_registry[feature].nSettings ));
-      if ( valid->root->level >= FT_VALIDATE_TIGHT )
+      if ( gxvalid->root->level >= FT_VALIDATE_TIGHT )
         FT_INVALID_DATA;
     }
 
     {
       GXV_TRACE(( "exclusive flag %d differs from predefined value\n",
                   exclusive ));
-      if ( valid->root->level >= FT_VALIDATE_TIGHT )
+      if ( gxvalid->root->level >= FT_VALIDATE_TIGHT )
         FT_INVALID_DATA;
     }
 
   static void
   gxv_feat_name_index_validate( FT_Bytes       table,
                                 FT_Bytes       limit,
-                                GXV_Validator  valid )
+                                GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
     gxv_sfntName_validate( (FT_UShort)nameIndex,
                            255,
                            32768U,
-                           valid );
+                           gxvalid );
 
     GXV_EXIT;
   }
   gxv_feat_setting_validate( FT_Bytes       table,
                              FT_Bytes       limit,
                              FT_Bool        exclusive,
-                             GXV_Validator  valid )
+                             GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
     FT_UShort  setting;
     if ( exclusive && ( setting & 1 ) == 0 )
       FT_INVALID_DATA;
 
-    gxv_feat_name_index_validate( p, limit, valid );
+    gxv_feat_name_index_validate( p, limit, gxvalid );
 
     GXV_FEAT_DATA( setting ) = setting;
 
   static void
   gxv_feat_name_validate( FT_Bytes       table,
                           FT_Bytes       limit,
-                          GXV_Validator  valid )
+                          GXV_Validator  gxvalid )
   {
     FT_Bytes   p             = table;
     FT_UInt    reserved_size = GXV_FEAT_DATA( reserved_size );
         FT_INVALID_FORMAT;
     }
 
-    gxv_feat_registry_validate( feature, nSettings, exclusive, valid );
+    gxv_feat_registry_validate( feature, nSettings, exclusive, gxvalid );
 
-    gxv_feat_name_index_validate( p, limit, valid );
+    gxv_feat_name_index_validate( p, limit, gxvalid );
 
-    p = valid->root->base + settingTable;
+    p = gxvalid->root->base + settingTable;
     for ( last_setting = -1, i = 0; i < nSettings; i++ )
     {
-      gxv_feat_setting_validate( p, limit, exclusive, valid );
+      gxv_feat_setting_validate( p, limit, exclusive, gxvalid );
 
       if ( (FT_Int)GXV_FEAT_DATA( setting ) <= last_setting )
         GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );
                      FT_Face       face,
                      FT_Validator  ftvalid )
   {
-    GXV_ValidatorRec  validrec;
-    GXV_Validator     valid = &validrec;
+    GXV_ValidatorRec  gxvalidrec;
+    GXV_Validator     gxvalid = &gxvalidrec;
 
     GXV_feat_DataRec  featrec;
     GXV_feat_Data     feat = &featrec;
     FT_Int            last_feature;
 
 
-    valid->root       = ftvalid;
-    valid->table_data = feat;
-    valid->face       = face;
+    gxvalid->root       = ftvalid;
+    gxvalid->table_data = feat;
+    gxvalid->face       = face;
 
     FT_TRACE3(( "validating `feat' table\n" ));
     GXV_INIT;
 
     for ( last_feature = -1, i = 0; i < featureNameCount; i++ )
     {
-      gxv_feat_name_validate( p, limit, valid );
+      gxv_feat_name_validate( p, limit, gxvalid );
 
       if ( (FT_Int)GXV_FEAT_DATA( feature ) <= last_feature )
         GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );
index 7816e0b..24c26a5 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueTypeGX/AAT just table validation (body).                         */
 /*                                                                         */
-/*  Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,       */
+/*  Copyright 2005, 2014 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,       */
   static void
   gxv_just_check_max_gid( FT_UShort         gid,
                           const FT_String*  msg_tag,
-                          GXV_Validator     valid )
+                          GXV_Validator     gxvalid )
   {
-    if ( gid < valid->face->num_glyphs )
+    if ( gid < gxvalid->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 ));
+                msg_tag, gid, gxvalid->face->num_glyphs ));
     GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
   }
 
@@ -84,7 +84,7 @@
   static void
   gxv_just_wdp_entry_validate( FT_Bytes       table,
                                FT_Bytes       limit,
-                               GXV_Validator  valid )
+                               GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
     FT_ULong   justClass;
 #endif
 
     /* According to Apple spec, only 7bits in justClass is used */
-    if ( ( justClass & 0xFFFFFF80 ) != 0 )
+    if ( ( justClass & 0xFFFFFF80UL ) != 0 )
     {
       GXV_TRACE(( "just table includes non-zero value"
                   " in unused justClass higher bits"
       GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
   }
 
 
   static void
   gxv_just_wdc_entry_validate( FT_Bytes       table,
                                FT_Bytes       limit,
-                               GXV_Validator  valid )
+                               GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
     FT_ULong  count, i;
     for ( i = 0; i < count; i++ )
     {
       GXV_TRACE(( "validating wdc pair %d/%d\n", i + 1, count ));
-      gxv_just_wdp_entry_validate( p, limit, valid );
-      p += valid->subtable_length;
+      gxv_just_wdp_entry_validate( p, limit, gxvalid );
+      p += gxvalid->subtable_length;
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
   }
 
 
   static void
   gxv_just_widthDeltaClusters_validate( FT_Bytes       table,
                                         FT_Bytes       limit,
-                                        GXV_Validator  valid )
+                                        GXV_Validator  gxvalid )
   {
     FT_Bytes  p         = table ;
     FT_Bytes  wdc_end   = table + GXV_JUST_DATA( wdc_offset_max );
 
     for ( i = 0; p <= wdc_end; i++ )
     {
-      gxv_just_wdc_entry_validate( p, limit, valid );
-      p += valid->subtable_length;
+      gxv_just_wdc_entry_validate( p, limit, gxvalid );
+      p += gxvalid->subtable_length;
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
 
     GXV_EXIT;
   }
   static void
   gxv_just_actSubrecord_type0_validate( FT_Bytes       table,
                                         FT_Bytes       limit,
-                                        GXV_Validator  valid )
+                                        GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
 
 
       GXV_LIMIT_CHECK( 2 );
       glyphs = FT_NEXT_USHORT( p );
-      gxv_just_check_max_gid( glyphs, "type0:glyphs", valid );
+      gxv_just_check_max_gid( glyphs, "type0:glyphs", gxvalid );
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
   }
 
 
   static void
   gxv_just_actSubrecord_type1_validate( FT_Bytes       table,
                                         FT_Bytes       limit,
-                                        GXV_Validator  valid )
+                                        GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
     FT_UShort  addGlyph;
     GXV_LIMIT_CHECK( 2 );
     addGlyph = FT_NEXT_USHORT( p );
 
-    gxv_just_check_max_gid( addGlyph, "type1:addGlyph", valid );
+    gxv_just_check_max_gid( addGlyph, "type1:addGlyph", gxvalid );
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
   }
 
 
   static void
   gxv_just_actSubrecord_type2_validate( FT_Bytes       table,
                                         FT_Bytes       limit,
-                                        GXV_Validator  valid )
+                                        GXV_Validator  gxvalid )
   {
     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;
     substGlyph      = FT_NEXT_USHORT( p );
 
     if ( addGlyph != 0xFFFF )
-      gxv_just_check_max_gid( addGlyph, "type2:addGlyph", valid );
+      gxv_just_check_max_gid( addGlyph, "type2:addGlyph", gxvalid );
 
-    gxv_just_check_max_gid( substGlyph, "type2:substGlyph", valid );
+    gxv_just_check_max_gid( substGlyph, "type2:substGlyph", gxvalid );
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
   }
 
 
   static void
   gxv_just_actSubrecord_type4_validate( FT_Bytes       table,
                                         FT_Bytes       limit,
-                                        GXV_Validator  valid )
+                                        GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
     FT_ULong  variantsAxis;
     noStretchValue = FT_NEXT_ULONG( p );
     maximumLimit   = FT_NEXT_ULONG( p );
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
 
-    if ( variantsAxis != 0x64756374 ) /* 'duct' */
+    if ( variantsAxis != 0x64756374L ) /* 'duct' */
       GXV_TRACE(( "variantsAxis 0x%08x is non default value",
                    variantsAxis ));
 
   static void
   gxv_just_actSubrecord_type5_validate( FT_Bytes       table,
                                         FT_Bytes       limit,
-                                        GXV_Validator  valid )
+                                        GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
     FT_UShort  flags;
     if ( flags )
       GXV_TRACE(( "type5: nonzero value 0x%04x in unused flags\n",
                    flags ));
-    gxv_just_check_max_gid( glyph, "type5:glyph", valid );
+    gxv_just_check_max_gid( glyph, "type5:glyph", gxvalid );
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
   }
 
 
   static void
   gxv_just_actSubrecord_validate( FT_Bytes       table,
                                   FT_Bytes       limit,
-                                  GXV_Validator  valid )
+                                  GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
     FT_UShort  actionClass;
       GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
 
     if ( actionType == 0 )
-      gxv_just_actSubrecord_type0_validate( p, limit, valid );
+      gxv_just_actSubrecord_type0_validate( p, limit, gxvalid );
     else if ( actionType == 1 )
-      gxv_just_actSubrecord_type1_validate( p, limit, valid );
+      gxv_just_actSubrecord_type1_validate( p, limit, gxvalid );
     else if ( actionType == 2 )
-      gxv_just_actSubrecord_type2_validate( p, limit, valid );
+      gxv_just_actSubrecord_type2_validate( p, limit, gxvalid );
     else if ( actionType == 3 )
       ;                         /* Stretch glyph action: no actionData */
     else if ( actionType == 4 )
-      gxv_just_actSubrecord_type4_validate( p, limit, valid );
+      gxv_just_actSubrecord_type4_validate( p, limit, gxvalid );
     else if ( actionType == 5 )
-      gxv_just_actSubrecord_type5_validate( p, limit, valid );
+      gxv_just_actSubrecord_type5_validate( p, limit, gxvalid );
     else
       FT_INVALID_DATA;
 
-    valid->subtable_length = actionLength;
+    gxvalid->subtable_length = actionLength;
 
     GXV_EXIT;
   }
   static void
   gxv_just_pcActionRecord_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid )
+                                    GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
     FT_ULong  actionCount;
 
     for ( i = 0; i < actionCount; i++ )
     {
-      gxv_just_actSubrecord_validate( p, limit, valid );
-      p += valid->subtable_length;
+      gxv_just_actSubrecord_validate( p, limit, gxvalid );
+      p += gxvalid->subtable_length;
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
 
     GXV_EXIT;
   }
   static void
   gxv_just_pcTable_LookupValue_entry_validate( FT_UShort            glyph,
                                                GXV_LookupValueCPtr  value_p,
-                                               GXV_Validator        valid )
+                                               GXV_Validator        gxvalid )
   {
     FT_UNUSED( glyph );
 
   static void
   gxv_just_pcLookupTable_validate( FT_Bytes       table,
                                    FT_Bytes       limit,
-                                   GXV_Validator  valid )
+                                   GXV_Validator  gxvalid )
   {
-    FT_Bytes p = table;
+    FT_Bytes  p = table;
 
 
     GXV_NAME_ENTER( "just pcLookupTable" );
     GXV_JUST_DATA( pc_offset_max ) = 0x0000;
     GXV_JUST_DATA( pc_offset_min ) = 0xFFFFU;
 
-    valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
-    valid->lookupval_func = gxv_just_pcTable_LookupValue_entry_validate;
+    gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
+    gxvalid->lookupval_func = gxv_just_pcTable_LookupValue_entry_validate;
 
-    gxv_LookupTable_validate( p, limit, valid );
+    gxv_LookupTable_validate( p, limit, gxvalid );
 
     /* subtable_length is set by gxv_LookupTable_validate() */
 
   static void
   gxv_just_postcompTable_validate( FT_Bytes       table,
                                    FT_Bytes       limit,
-                                   GXV_Validator  valid )
+                                   GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
 
     GXV_NAME_ENTER( "just postcompTable" );
 
-    gxv_just_pcLookupTable_validate( p, limit, valid );
-    p += valid->subtable_length;
+    gxv_just_pcLookupTable_validate( p, limit, gxvalid );
+    p += gxvalid->subtable_length;
 
-    gxv_just_pcActionRecord_validate( p, limit, valid );
-    p += valid->subtable_length;
+    gxv_just_pcActionRecord_validate( p, limit, gxvalid );
+    p += gxvalid->subtable_length;
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
 
     GXV_EXIT;
   }
     GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,
     FT_Bytes                        table,
     FT_Bytes                        limit,
-    GXV_Validator                   valid )
+    GXV_Validator                   gxvalid )
   {
 #ifdef GXV_LOAD_UNUSED_VARS
     /* TODO: validate markClass & currentClass */
     FT_UNUSED( glyphOffset_p );
     FT_UNUSED( table );
     FT_UNUSED( limit );
-    FT_UNUSED( valid );
+    FT_UNUSED( gxvalid );
 
 #ifndef GXV_LOAD_UNUSED_VARS
     FT_UNUSED( flags );
   static void
   gxv_just_justClassTable_validate ( FT_Bytes       table,
                                      FT_Bytes       limit,
-                                     GXV_Validator  valid )
+                                     GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
     FT_UShort  length;
       GXV_TRACE(( "  justClassTable: nonzero value (0x%08x)"
                   " in unused subFeatureFlags\n", subFeatureFlags ));
 
-    valid->statetable.optdata               = NULL;
-    valid->statetable.optdata_load_func     = NULL;
-    valid->statetable.subtable_setup_func   = NULL;
-    valid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;
-    valid->statetable.entry_validate_func   =
+    gxvalid->statetable.optdata               = NULL;
+    gxvalid->statetable.optdata_load_func     = NULL;
+    gxvalid->statetable.subtable_setup_func   = NULL;
+    gxvalid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;
+    gxvalid->statetable.entry_validate_func   =
       gxv_just_classTable_entry_validate;
 
-    gxv_StateTable_validate( p, table + length, valid );
+    gxv_StateTable_validate( p, table + length, gxvalid );
 
     /* subtable_length is set by gxv_LookupTable_validate() */
 
   static void
   gxv_just_wdcTable_LookupValue_validate( FT_UShort            glyph,
                                           GXV_LookupValueCPtr  value_p,
-                                          GXV_Validator        valid )
+                                          GXV_Validator        gxvalid )
   {
     FT_UNUSED( glyph );
 
   static void
   gxv_just_justData_lookuptable_validate( FT_Bytes       table,
                                           FT_Bytes       limit,
-                                          GXV_Validator  valid )
+                                          GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
     GXV_JUST_DATA( wdc_offset_max ) = 0x0000;
     GXV_JUST_DATA( wdc_offset_min ) = 0xFFFFU;
 
-    valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
-    valid->lookupval_func = gxv_just_wdcTable_LookupValue_validate;
+    gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
+    gxvalid->lookupval_func = gxv_just_wdcTable_LookupValue_validate;
 
-    gxv_LookupTable_validate( p, limit, valid );
+    gxv_LookupTable_validate( p, limit, gxvalid );
 
     /* subtable_length is set by gxv_LookupTable_validate() */
 
   static void
   gxv_just_justData_validate( FT_Bytes       table,
                               FT_Bytes       limit,
-                              GXV_Validator  valid )
+                              GXV_Validator  gxvalid )
   {
     /*
      * following 3 offsets are measured from the start of `just'
     GXV_TRACE(( " (wdcTableOffset = 0x%04x)\n", wdcTableOffset ));
     GXV_TRACE(( " (pcTableOffset = 0x%04x)\n", pcTableOffset ));
 
-    gxv_just_justData_lookuptable_validate( p, limit, valid );
-    gxv_odtect_add_range( p, valid->subtable_length,
+    gxv_just_justData_lookuptable_validate( p, limit, gxvalid );
+    gxv_odtect_add_range( p, gxvalid->subtable_length,
                           "just_LookupTable", odtect );
 
     if ( wdcTableOffset )
     {
       gxv_just_widthDeltaClusters_validate(
-        valid->root->base + wdcTableOffset, limit, valid );
-      gxv_odtect_add_range( valid->root->base + wdcTableOffset,
-                            valid->subtable_length, "just_wdcTable", odtect );
+        gxvalid->root->base + wdcTableOffset, limit, gxvalid );
+      gxv_odtect_add_range( gxvalid->root->base + wdcTableOffset,
+                            gxvalid->subtable_length, "just_wdcTable", odtect );
     }
 
     if ( pcTableOffset )
     {
-      gxv_just_postcompTable_validate( valid->root->base + pcTableOffset,
-                                       limit, valid );
-      gxv_odtect_add_range( valid->root->base + pcTableOffset,
-                            valid->subtable_length, "just_pcTable", odtect );
+      gxv_just_postcompTable_validate( gxvalid->root->base + pcTableOffset,
+                                       limit, gxvalid );
+      gxv_odtect_add_range( gxvalid->root->base + pcTableOffset,
+                            gxvalid->subtable_length, "just_pcTable", odtect );
     }
 
     if ( justClassTableOffset )
     {
       gxv_just_justClassTable_validate(
-        valid->root->base + justClassTableOffset, limit, valid );
-      gxv_odtect_add_range( valid->root->base + justClassTableOffset,
-                            valid->subtable_length, "just_justClassTable",
+        gxvalid->root->base + justClassTableOffset, limit, gxvalid );
+      gxv_odtect_add_range( gxvalid->root->base + justClassTableOffset,
+                            gxvalid->subtable_length, "just_justClassTable",
                             odtect );
     }
 
-    gxv_odtect_validate( odtect, valid );
+    gxv_odtect_validate( odtect, gxvalid );
 
     GXV_EXIT;
   }
     FT_Bytes           p     = table;
     FT_Bytes           limit = 0;
 
-    GXV_ValidatorRec   validrec;
-    GXV_Validator      valid = &validrec;
+    GXV_ValidatorRec   gxvalidrec;
+    GXV_Validator      gxvalid = &gxvalidrec;
     GXV_just_DataRec   justrec;
     GXV_just_Data      just = &justrec;
 
 
     GXV_ODTECT_INIT( odtect );
 
-    valid->root       = ftvalid;
-    valid->table_data = just;
-    valid->face       = face;
+    gxvalid->root       = ftvalid;
+    gxvalid->table_data = just;
+    gxvalid->face       = face;
 
     FT_TRACE3(( "validating `just' table\n" ));
     GXV_INIT;
 
-    limit      = valid->root->limit;
+    limit      = gxvalid->root->limit;
 
     GXV_LIMIT_CHECK( 4 + 2 + 2 + 2 );
     version     = FT_NEXT_ULONG( p );
     /* validate justData */
     if ( 0 < horizOffset )
     {
-      gxv_just_justData_validate( table + horizOffset, limit, valid );
-      gxv_odtect_add_range( table + horizOffset, valid->subtable_length,
+      gxv_just_justData_validate( table + horizOffset, limit, gxvalid );
+      gxv_odtect_add_range( table + horizOffset, gxvalid->subtable_length,
                             "horizJustData", odtect );
     }
 
     if ( 0 < vertOffset )
     {
-      gxv_just_justData_validate( table + vertOffset, limit, valid );
-      gxv_odtect_add_range( table + vertOffset, valid->subtable_length,
+      gxv_just_justData_validate( table + vertOffset, limit, gxvalid );
+      gxv_odtect_add_range( table + vertOffset, gxvalid->subtable_length,
                             "vertJustData", odtect );
     }
 
-    gxv_odtect_validate( odtect, valid );
+    gxv_odtect_validate( odtect, gxvalid );
 
     FT_TRACE4(( "\n" ));
   }
index 0ec978f..787e3db 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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.                      */
 /*                                                                         */
 
 #define GXV_KERN_DATA( field )  GXV_TABLE_DATA( kern, field )
 
-#define KERN_IS_CLASSIC( valid )                               \
+#define KERN_IS_CLASSIC( gxvalid )                               \
           ( KERN_VERSION_CLASSIC == GXV_KERN_DATA( version ) )
-#define KERN_IS_NEW( valid )                                   \
+#define KERN_IS_NEW( gxvalid )                                   \
           ( KERN_VERSION_NEW     == GXV_KERN_DATA( version ) )
 
-#define KERN_DIALECT( valid )              \
+#define KERN_DIALECT( gxvalid )              \
           GXV_KERN_DATA( dialect_request )
-#define KERN_ALLOWS_MS( valid )                       \
-          ( KERN_DIALECT( valid ) & KERN_DIALECT_MS )
-#define KERN_ALLOWS_APPLE( valid )                       \
-          ( KERN_DIALECT( valid ) & KERN_DIALECT_APPLE )
+#define KERN_ALLOWS_MS( gxvalid )                       \
+          ( KERN_DIALECT( gxvalid ) & KERN_DIALECT_MS )
+#define KERN_ALLOWS_APPLE( gxvalid )                       \
+          ( KERN_DIALECT( gxvalid ) & KERN_DIALECT_APPLE )
 
-#define GXV_KERN_HEADER_SIZE           ( KERN_IS_NEW( valid ) ? 8 : 4 )
-#define GXV_KERN_SUBTABLE_HEADER_SIZE  ( KERN_IS_NEW( valid ) ? 8 : 6 )
+#define GXV_KERN_HEADER_SIZE           ( KERN_IS_NEW( gxvalid ) ? 8 : 4 )
+#define GXV_KERN_SUBTABLE_HEADER_SIZE  ( KERN_IS_NEW( gxvalid ) ? 8 : 6 )
 
 
   /*************************************************************************/
   gxv_kern_subtable_fmt0_pairs_validate( FT_Bytes       table,
                                          FT_Bytes       limit,
                                          FT_UShort      nPairs,
-                                         GXV_Validator  valid )
+                                         GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
     FT_UShort  i;
 
       /* left */
       gid_left  = FT_NEXT_USHORT( p );
-      gxv_glyphid_validate( gid_left, valid );
+      gxv_glyphid_validate( gid_left, gxvalid );
 
       /* right */
       gid_right = FT_NEXT_USHORT( p );
-      gxv_glyphid_validate( gid_right, valid );
+      gxv_glyphid_validate( gid_right, gxvalid );
 
       /* Pairs of left and right GIDs must be unique and sorted. */
       GXV_TRACE(( "left gid = %u, right gid = %u\n", gid_left, gid_right ));
   static void
   gxv_kern_subtable_fmt0_validate( FT_Bytes       table,
                                    FT_Bytes       limit,
-                                   GXV_Validator  valid )
+                                   GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table + GXV_KERN_SUBTABLE_HEADER_SIZE;
 
 
     /* nPairs, searchRange, entrySelector, rangeShift */
     GXV_LIMIT_CHECK( 2 + 2 + 2 + 2 );
-    gxv_BinSrchHeader_validate( p, limit, &unitSize, &nPairs, valid );
+    gxv_BinSrchHeader_validate( p, limit, &unitSize, &nPairs, gxvalid );
     p += 2 + 2 + 2 + 2;
 
-    gxv_kern_subtable_fmt0_pairs_validate( p, limit, nPairs, valid );
+    gxv_kern_subtable_fmt0_pairs_validate( p, limit, nPairs, gxvalid );
 
     GXV_EXIT;
   }
   static void
   gxv_kern_subtable_fmt1_valueTable_load( FT_Bytes       table,
                                           FT_Bytes       limit,
-                                          GXV_Validator  valid )
+                                          GXV_Validator  gxvalid )
   {
     FT_Bytes                       p = table;
     GXV_kern_fmt1_StateOptRecData  optdata =
-      (GXV_kern_fmt1_StateOptRecData)valid->statetable.optdata;
+      (GXV_kern_fmt1_StateOptRecData)gxvalid->statetable.optdata;
 
 
     GXV_LIMIT_CHECK( 2 );
                                          FT_UShort*     classTable_length_p,
                                          FT_UShort*     stateArray_length_p,
                                          FT_UShort*     entryTable_length_p,
-                                         GXV_Validator  valid )
+                                         GXV_Validator  gxvalid )
   {
     FT_UShort  o[4];
     FT_UShort  *l[4];
     FT_UShort  buff[5];
 
     GXV_kern_fmt1_StateOptRecData  optdata =
-      (GXV_kern_fmt1_StateOptRecData)valid->statetable.optdata;
+      (GXV_kern_fmt1_StateOptRecData)gxvalid->statetable.optdata;
 
 
     o[0] = classTable;
     l[2] = entryTable_length_p;
     l[3] = &(optdata->valueTable_length);
 
-    gxv_set_length_by_ushort_offset( o, l, buff, 4, table_size, valid );
+    gxv_set_length_by_ushort_offset( o, l, buff, 4, table_size, gxvalid );
   }
 
 
     GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,
     FT_Bytes                        table,
     FT_Bytes                        limit,
-    GXV_Validator                   valid )
+    GXV_Validator                   gxvalid )
   {
 #ifdef GXV_LOAD_UNUSED_VARS
     FT_UShort  push;
 
     {
       GXV_kern_fmt1_StateOptRecData  vt_rec =
-        (GXV_kern_fmt1_StateOptRecData)valid->statetable.optdata;
+        (GXV_kern_fmt1_StateOptRecData)gxvalid->statetable.optdata;
       FT_Bytes  p;
 
 
 #ifdef GXV_LOAD_UNUSED_VARS
       kernAction = FT_NEXT_USHORT( p );
       kernValue  = FT_NEXT_USHORT( p );
-#else
-      p += 4;
 #endif
     }
   }
   static void
   gxv_kern_subtable_fmt1_validate( FT_Bytes       table,
                                    FT_Bytes       limit,
-                                   GXV_Validator  valid )
+                                   GXV_Validator  gxvalid )
   {
     FT_Bytes                   p = table;
     GXV_kern_fmt1_StateOptRec  vt_rec;
 
     GXV_NAME_ENTER( "kern subtable format 1" );
 
-    valid->statetable.optdata =
+    gxvalid->statetable.optdata =
       &vt_rec;
-    valid->statetable.optdata_load_func =
+    gxvalid->statetable.optdata_load_func =
       gxv_kern_subtable_fmt1_valueTable_load;
-    valid->statetable.subtable_setup_func =
+    gxvalid->statetable.subtable_setup_func =
       gxv_kern_subtable_fmt1_subtable_setup;
-    valid->statetable.entry_glyphoffset_fmt =
+    gxvalid->statetable.entry_glyphoffset_fmt =
       GXV_GLYPHOFFSET_NONE;
-    valid->statetable.entry_validate_func =
+    gxvalid->statetable.entry_validate_func =
       gxv_kern_subtable_fmt1_entry_validate;
 
-    gxv_StateTable_validate( p, limit, valid );
+    gxv_StateTable_validate( p, limit, gxvalid );
 
     GXV_EXIT;
   }
   gxv_kern_subtable_fmt2_clstbl_validate( FT_Bytes            table,
                                           FT_Bytes            limit,
                                           GXV_kern_ClassSpec  spec,
-                                          GXV_Validator       valid )
+                                          GXV_Validator       gxvalid )
   {
     const FT_String*  tag    = GXV_KERN_FMT2_DATA( class_tag[spec] );
     GXV_odtect_Range  odtect = GXV_KERN_FMT2_DATA( odtect );
     GXV_TRACE(( " %s firstGlyph=%d, nGlyphs=%d\n",
                 tag, firstGlyph, nGlyphs ));
 
-    gxv_glyphid_validate( firstGlyph, valid );
-    gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs - 1 ), valid );
+    gxv_glyphid_validate( firstGlyph, gxvalid );
+    gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs - 1 ), gxvalid );
 
     gxv_array_getlimits_ushort( p, p + ( 2 * nGlyphs ),
                                 &( GXV_KERN_FMT2_DATA( offset_min[spec] ) ),
                                 &( GXV_KERN_FMT2_DATA( offset_max[spec] ) ),
-                                valid );
+                                gxvalid );
 
     gxv_odtect_add_range( table, 2 * nGlyphs, tag, odtect );
 
   static void
   gxv_kern_subtable_fmt2_validate( FT_Bytes       table,
                                    FT_Bytes       limit,
-                                   GXV_Validator  valid )
+                                   GXV_Validator  gxvalid )
   {
     GXV_ODTECT( 3, odtect );
     GXV_kern_subtable_fmt2_DataRec  fmt2_rec =
     GXV_LIMIT_CHECK( GXV_KERN_FMT2_DATA( array ) );
 
     gxv_kern_subtable_fmt2_clstbl_validate( table + leftOffsetTable, limit,
-                                            GXV_KERN_CLS_L, valid );
+                                            GXV_KERN_CLS_L, gxvalid );
 
     gxv_kern_subtable_fmt2_clstbl_validate( table + rightOffsetTable, limit,
-                                            GXV_KERN_CLS_R, valid );
+                                            GXV_KERN_CLS_R, gxvalid );
 
     if ( GXV_KERN_FMT2_DATA( offset_min[GXV_KERN_CLS_L] ) +
            GXV_KERN_FMT2_DATA( offset_min[GXV_KERN_CLS_R] )
                             - GXV_KERN_FMT2_DATA( array ),
                           "array", odtect );
 
-    gxv_odtect_validate( odtect, valid );
+    gxv_odtect_validate( odtect, gxvalid );
 
     GXV_EXIT;
   }
   static void
   gxv_kern_subtable_fmt3_validate( FT_Bytes       table,
                                    FT_Bytes       limit,
-                                   GXV_Validator  valid )
+                                   GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table + GXV_KERN_SUBTABLE_HEADER_SIZE;
     FT_UShort  glyphCount;
     rightClassCount = FT_NEXT_BYTE( p );
     flags           = FT_NEXT_BYTE( p );
 
-    if ( valid->face->num_glyphs != glyphCount )
+    if ( gxvalid->face->num_glyphs != glyphCount )
     {
       GXV_TRACE(( "maxGID=%d, but glyphCount=%d\n",
-                  valid->face->num_glyphs, glyphCount ));
+                  gxvalid->face->num_glyphs, glyphCount ));
       GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
     }
 
 
 
       GXV_LIMIT_CHECK( glyphCount );
-      gxv_array_getlimits_byte( p, p + glyphCount, &min, &max, valid );
-      p += valid->subtable_length;
+      gxv_array_getlimits_byte( p, p + glyphCount, &min, &max, gxvalid );
+      p += gxvalid->subtable_length;
 
       if ( leftClassCount < max )
         FT_INVALID_DATA;
 
 
       GXV_LIMIT_CHECK( glyphCount );
-      gxv_array_getlimits_byte( p, p + glyphCount, &min, &max, valid );
-      p += valid->subtable_length;
+      gxv_array_getlimits_byte( p, p + glyphCount, &min, &max, gxvalid );
+      p += gxvalid->subtable_length;
 
       if ( rightClassCount < max )
         FT_INVALID_DATA;
       }
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
 
     GXV_EXIT;
   }
   static FT_Bool
   gxv_kern_coverage_new_apple_validate( FT_UShort      coverage,
                                         FT_UShort*     format,
-                                        GXV_Validator  valid )
+                                        GXV_Validator  gxvalid )
   {
     /* new Apple-dialect */
 #ifdef GXV_LOAD_TRACE_VARS
     FT_Bool  kernVariation;
 #endif
 
-    FT_UNUSED( valid );
+    FT_UNUSED( gxvalid );
 
 
     /* reserved bits = 0 */
   static FT_Bool
   gxv_kern_coverage_classic_apple_validate( FT_UShort      coverage,
                                             FT_UShort*     format,
-                                            GXV_Validator  valid )
+                                            GXV_Validator  gxvalid )
   {
     /* classic Apple-dialect */
 #ifdef GXV_LOAD_TRACE_VARS
 
 
     /* check expected flags, but don't check if MS-dialect is impossible */
-    if ( !( coverage & 0xFD00 ) && KERN_ALLOWS_MS( valid ) )
+    if ( !( coverage & 0xFD00 ) && KERN_ALLOWS_MS( gxvalid ) )
       return FALSE;
 
     /* reserved bits = 0 */
   static FT_Bool
   gxv_kern_coverage_classic_microsoft_validate( FT_UShort      coverage,
                                                 FT_UShort*     format,
-                                                GXV_Validator  valid )
+                                                GXV_Validator  gxvalid )
   {
     /* classic Microsoft-dialect */
 #ifdef GXV_LOAD_TRACE_VARS
     FT_Bool  override;
 #endif
 
-    FT_UNUSED( valid );
+    FT_UNUSED( gxvalid );
 
 
     /* reserved bits = 0 */
   static GXV_kern_Dialect
   gxv_kern_coverage_validate( FT_UShort      coverage,
                               FT_UShort*     format,
-                              GXV_Validator  valid )
+                              GXV_Validator  gxvalid )
   {
     GXV_kern_Dialect  result = KERN_DIALECT_UNKNOWN;
 
 
     GXV_TRACE(( "interprete coverage 0x%04x by Apple style\n", coverage ));
 
-    if ( KERN_IS_NEW( valid ) )
+    if ( KERN_IS_NEW( gxvalid ) )
     {
       if ( gxv_kern_coverage_new_apple_validate( coverage,
                                                  format,
-                                                 valid ) )
+                                                 gxvalid ) )
       {
         result = KERN_DIALECT_APPLE;
         goto Exit;
       }
     }
 
-    if ( KERN_IS_CLASSIC( valid ) && KERN_ALLOWS_APPLE( valid ) )
+    if ( KERN_IS_CLASSIC( gxvalid ) && KERN_ALLOWS_APPLE( gxvalid ) )
     {
       if ( gxv_kern_coverage_classic_apple_validate( coverage,
                                                      format,
-                                                     valid ) )
+                                                     gxvalid ) )
       {
         result = KERN_DIALECT_APPLE;
         goto Exit;
       }
     }
 
-    if ( KERN_IS_CLASSIC( valid ) && KERN_ALLOWS_MS( valid ) )
+    if ( KERN_IS_CLASSIC( gxvalid ) && KERN_ALLOWS_MS( gxvalid ) )
     {
       if ( gxv_kern_coverage_classic_microsoft_validate( coverage,
                                                          format,
-                                                         valid ) )
+                                                         gxvalid ) )
       {
         result = KERN_DIALECT_MS;
         goto Exit;
   static void
   gxv_kern_subtable_validate( FT_Bytes       table,
                               FT_Bytes       limit,
-                              GXV_Validator  valid )
+                              GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
 #ifdef GXV_LOAD_TRACE_VARS
     u16[1]   = FT_NEXT_USHORT( p ); /* Apple: length_lo MS: length */
     coverage = FT_NEXT_USHORT( p );
 
-    switch ( gxv_kern_coverage_validate( coverage, &format, valid ) )
+    switch ( gxv_kern_coverage_validate( coverage, &format, gxvalid ) )
     {
     case KERN_DIALECT_MS:
 #ifdef GXV_LOAD_TRACE_VARS
 #endif
       GXV_TRACE(( "Subtable length = %d\n", length ));
 
-      if ( KERN_IS_NEW( valid ) )
+      if ( KERN_IS_NEW( gxvalid ) )
       {
         GXV_LIMIT_CHECK( 2 );
 #ifdef GXV_LOAD_TRACE_VARS
 
     /* formats 1, 2, 3 require the position of the start of this subtable */
     if ( format == 0 )
-      gxv_kern_subtable_fmt0_validate( table, table + length, valid );
+      gxv_kern_subtable_fmt0_validate( table, table + length, gxvalid );
     else if ( format == 1 )
-      gxv_kern_subtable_fmt1_validate( table, table + length, valid );
+      gxv_kern_subtable_fmt1_validate( table, table + length, gxvalid );
     else if ( format == 2 )
-      gxv_kern_subtable_fmt2_validate( table, table + length, valid );
+      gxv_kern_subtable_fmt2_validate( table, table + length, gxvalid );
     else if ( format == 3 )
-      gxv_kern_subtable_fmt3_validate( table, table + length, valid );
+      gxv_kern_subtable_fmt3_validate( table, table + length, gxvalid );
     else
       FT_INVALID_DATA;
 
   Exit:
-    valid->subtable_length = length;
+    gxvalid->subtable_length = length;
     GXV_EXIT;
   }
 
                              GXV_kern_Dialect  dialect_request,
                              FT_Validator      ftvalid )
   {
-    GXV_ValidatorRec   validrec;
-    GXV_Validator      valid = &validrec;
+    GXV_ValidatorRec   gxvalidrec;
+    GXV_Validator      gxvalid = &gxvalidrec;
 
     GXV_kern_DataRec   kernrec;
     GXV_kern_Data      kern = &kernrec;
     FT_UInt            i;
 
 
-    valid->root       = ftvalid;
-    valid->table_data = kern;
-    valid->face       = face;
+    gxvalid->root       = ftvalid;
+    gxvalid->table_data = kern;
+    gxvalid->face       = face;
 
     FT_TRACE3(( "validating `kern' table\n" ));
     GXV_INIT;
-    KERN_DIALECT( valid ) = dialect_request;
+    KERN_DIALECT( gxvalid ) = dialect_request;
 
     GXV_LIMIT_CHECK( 2 );
     GXV_KERN_DATA( version ) = (GXV_kern_Version)FT_NEXT_USHORT( p );
 
     if ( 0x0001 < GXV_KERN_DATA( version ) )
       FT_INVALID_FORMAT;
-    else if ( KERN_IS_CLASSIC( valid ) )
+    else if ( KERN_IS_CLASSIC( gxvalid ) )
     {
       GXV_LIMIT_CHECK( 2 );
       nTables = FT_NEXT_USHORT( p );
     }
-    else if ( KERN_IS_NEW( valid ) )
+    else if ( KERN_IS_NEW( gxvalid ) )
     {
       if ( classic_only )
         FT_INVALID_FORMAT;
     {
       GXV_TRACE(( "validating subtable %d/%d\n", i, nTables ));
       /* p should be 32bit-aligned? */
-      gxv_kern_subtable_validate( p, 0, valid );
-      p += valid->subtable_length;
+      gxv_kern_subtable_validate( p, 0, gxvalid );
+      p += gxvalid->subtable_length;
     }
 
     FT_TRACE4(( "\n" ));
index f14fa5b..48308b0 100644 (file)
   static void
   gxv_lcar_partial_validate( FT_UShort      partial,
                              FT_UShort      glyph,
-                             GXV_Validator  valid )
+                             GXV_Validator  gxvalid )
   {
     GXV_NAME_ENTER( "partial" );
 
     if ( GXV_LCAR_DATA( format ) != 1 )
       goto Exit;
 
-    gxv_ctlPoint_validate( glyph, partial, valid );
+    gxv_ctlPoint_validate( glyph, partial, gxvalid );
 
   Exit:
     GXV_EXIT;
   static void
   gxv_lcar_LookupValue_validate( FT_UShort            glyph,
                                  GXV_LookupValueCPtr  value_p,
-                                 GXV_Validator        valid )
+                                 GXV_Validator        gxvalid )
   {
-    FT_Bytes   p     = valid->root->base + value_p->u;
-    FT_Bytes   limit = valid->root->limit;
+    FT_Bytes   p     = gxvalid->root->base + value_p->u;
+    FT_Bytes   limit = gxvalid->root->limit;
     FT_UShort  count;
     FT_Short   partial;
     FT_UShort  i;
     for ( i = 0; i < count; i++ )
     {
       partial = FT_NEXT_SHORT( p );
-      gxv_lcar_partial_validate( partial, glyph, valid );
+      gxv_lcar_partial_validate( partial, glyph, gxvalid );
     }
 
     GXV_EXIT;
   gxv_lcar_LookupFmt4_transit( FT_UShort            relative_gindex,
                                GXV_LookupValueCPtr  base_value_p,
                                FT_Bytes             lookuptbl_limit,
-                               GXV_Validator        valid )
+                               GXV_Validator        gxvalid )
   {
     FT_Bytes             p;
     FT_Bytes             limit;
     /* XXX: check range? */
     offset = (FT_UShort)( base_value_p->u +
                           relative_gindex * sizeof ( FT_UShort ) );
-    p      = valid->root->base + offset;
-    limit  = valid->root->limit;
+    p      = gxvalid->root->base + offset;
+    limit  = gxvalid->root->limit;
 
     GXV_LIMIT_CHECK ( 2 );
     value.u = FT_NEXT_USHORT( p );
   {
     FT_Bytes          p     = table;
     FT_Bytes          limit = 0;
-    GXV_ValidatorRec  validrec;
-    GXV_Validator     valid = &validrec;
+    GXV_ValidatorRec  gxvalidrec;
+    GXV_Validator     gxvalid = &gxvalidrec;
 
     GXV_lcar_DataRec  lcarrec;
     GXV_lcar_Data     lcar = &lcarrec;
     FT_Fixed          version;
 
 
-    valid->root       = ftvalid;
-    valid->table_data = lcar;
-    valid->face       = face;
+    gxvalid->root       = ftvalid;
+    gxvalid->table_data = lcar;
+    gxvalid->face       = face;
 
     FT_TRACE3(( "validating `lcar' table\n" ));
     GXV_INIT;
     if ( GXV_LCAR_DATA( format ) > 1 )
       FT_INVALID_FORMAT;
 
-    valid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
-    valid->lookupval_func   = gxv_lcar_LookupValue_validate;
-    valid->lookupfmt4_trans = gxv_lcar_LookupFmt4_transit;
-    gxv_LookupTable_validate( p, limit, valid );
+    gxvalid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
+    gxvalid->lookupval_func   = gxv_lcar_LookupValue_validate;
+    gxvalid->lookupfmt4_trans = gxv_lcar_LookupFmt4_transit;
+    gxv_LookupTable_validate( p, limit, gxvalid );
 
     FT_TRACE4(( "\n" ));
   }
index 502fe5d..278d476 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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.                      */
 /*                                                                         */
@@ -58,8 +58,8 @@
 
 
     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;
 
   {
     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;
     /* 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;
 
 
index 465462a..55ff5a8 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -40,7 +40,7 @@
 
   static void
   gxv_mort_feature_validate( GXV_mort_feature  f,
-                             GXV_Validator     valid )
+                             GXV_Validator     gxvalid )
   {
     if ( f->featureType >= gxv_feat_registry_length )
     {
@@ -89,7 +89,7 @@
   gxv_mort_featurearray_validate( FT_Bytes       table,
                                   FT_Bytes       limit,
                                   FT_ULong       nFeatureFlags,
-                                  GXV_Validator  valid )
+                                  GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
     FT_ULong  i;
       f.enableFlags    = FT_NEXT_ULONG( p );
       f.disableFlags   = FT_NEXT_ULONG( p );
 
-      gxv_mort_feature_validate( &f, valid );
+      gxv_mort_feature_validate( &f, gxvalid );
     }
 
     if ( !IS_GXV_MORT_FEATURE_OFF( f ) )
       FT_INVALID_DATA;
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
     GXV_EXIT;
   }
 
 
   FT_LOCAL_DEF( void )
   gxv_mort_coverage_validate( FT_UShort      coverage,
-                              GXV_Validator  valid )
+                              GXV_Validator  gxvalid )
   {
-    FT_UNUSED( valid );
+    FT_UNUSED( gxvalid );
 
+#ifdef FT_DEBUG_LEVEL_TRACE
     if ( coverage & 0x8000U )
       GXV_TRACE(( " this subtable is for vertical text only\n" ));
     else
 
     if ( coverage & 0x1FF8 )
       GXV_TRACE(( " coverage has non-zero bits in reserved area\n" ));
+#endif
   }
 
 
   gxv_mort_subtables_validate( FT_Bytes       table,
                                FT_Bytes       limit,
                                FT_UShort      nSubtables,
-                               GXV_Validator  valid )
+                               GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
 
     };
 
-    GXV_Validate_Func  func;
-    FT_UShort          i;
+    FT_UShort  i;
 
 
     GXV_NAME_ENTER( "subtables in a chain" );
 
     for ( i = 0; i < nSubtables; i++ )
     {
+      GXV_Validate_Func  func;
+
       FT_UShort  length;
       FT_UShort  coverage;
 #ifdef GXV_LOAD_UNUSED_VARS
       rest = length - ( 2 + 2 + 4 );
 
       GXV_LIMIT_CHECK( rest );
-      gxv_mort_coverage_validate( coverage, valid );
+      gxv_mort_coverage_validate( coverage, gxvalid );
 
       if ( type > 5 )
         FT_INVALID_FORMAT;
       if ( func == NULL )
         GXV_TRACE(( "morx type %d is reserved\n", type ));
 
-      func( p, p + rest, valid );
+      func( p, p + rest, gxvalid );
 
       p += rest;
       /* TODO: validate subFeatureFlags */
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
 
     GXV_EXIT;
   }
   static void
   gxv_mort_chain_validate( FT_Bytes       table,
                            FT_Bytes       limit,
-                           GXV_Validator  valid )
+                           GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
 #ifdef GXV_LOAD_UNUSED_VARS
     nSubtables    = FT_NEXT_USHORT( p );
 
     gxv_mort_featurearray_validate( p, table + chainLength,
-                                    nFeatureFlags, valid );
-    p += valid->subtable_length;
-    gxv_mort_subtables_validate( p, table + chainLength, nSubtables, valid );
-    valid->subtable_length = chainLength;
+                                    nFeatureFlags, gxvalid );
+    p += gxvalid->subtable_length;
+    gxv_mort_subtables_validate( p, table + chainLength, nSubtables, gxvalid );
+    gxvalid->subtable_length = chainLength;
 
     /* TODO: validate defaultFlags */
     GXV_EXIT;
                      FT_Face       face,
                      FT_Validator  ftvalid )
   {
-    GXV_ValidatorRec  validrec;
-    GXV_Validator     valid = &validrec;
+    GXV_ValidatorRec  gxvalidrec;
+    GXV_Validator     gxvalid = &gxvalidrec;
     FT_Bytes          p     = table;
     FT_Bytes          limit = 0;
     FT_ULong          version;
     FT_ULong          i;
 
 
-    valid->root = ftvalid;
-    valid->face = face;
-    limit       valid->root->limit;
+    gxvalid->root = ftvalid;
+    gxvalid->face = face;
+    limit         = gxvalid->root->limit;
 
     FT_TRACE3(( "validating `mort' table\n" ));
     GXV_INIT;
     {
       GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains ));
       GXV_32BIT_ALIGNMENT_VALIDATE( p - table );
-      gxv_mort_chain_validate( p, limit, valid );
-      p += valid->subtable_length;
+      gxv_mort_chain_validate( p, limit, gxvalid );
+      p += gxvalid->subtable_length;
     }
 
     FT_TRACE4(( "\n" ));
index 1e5a1f5..8e62e52 100644 (file)
   gxv_mort_featurearray_validate( FT_Bytes       table,
                                   FT_Bytes       limit,
                                   FT_ULong       nFeatureFlags,
-                                  GXV_Validator  valid );
+                                  GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_mort_coverage_validate( FT_UShort      coverage,
-                              GXV_Validator  valid );
+                              GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_mort_subtable_type0_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid );
+                                    GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_mort_subtable_type1_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid );
+                                    GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_mort_subtable_type2_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid );
+                                    GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_mort_subtable_type4_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid );
+                                    GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_mort_subtable_type5_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid );
+                                    GXV_Validator  gxvalid );
 
 
 #endif /* __GXVMORT_H__ */
index b136ced..f19016e 100644 (file)
@@ -67,7 +67,7 @@
     GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,
     FT_Bytes                        table,
     FT_Bytes                        limit,
-    GXV_Validator                   valid )
+    GXV_Validator                   gxvalid )
   {
     FT_UShort  markFirst;
     FT_UShort  dontAdvance;
   FT_LOCAL_DEF( void )
   gxv_mort_subtable_type0_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid )
+                                    GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
 
     GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE );
 
-    valid->statetable.optdata               = NULL;
-    valid->statetable.optdata_load_func     = NULL;
-    valid->statetable.subtable_setup_func   = NULL;
-    valid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;
-    valid->statetable.entry_validate_func =
+    gxvalid->statetable.optdata               = NULL;
+    gxvalid->statetable.optdata_load_func     = NULL;
+    gxvalid->statetable.subtable_setup_func   = NULL;
+    gxvalid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;
+    gxvalid->statetable.entry_validate_func =
       gxv_mort_subtable_type0_entry_validate;
 
-    gxv_StateTable_validate( p, limit, valid );
+    gxv_StateTable_validate( p, limit, gxvalid );
 
     GXV_EXIT;
   }
index 1c17a5d..0189504 100644 (file)
   static void
   gxv_mort_subtable_type1_substitutionTable_load( FT_Bytes       table,
                                                   FT_Bytes       limit,
-                                                  GXV_Validator  valid )
+                                                  GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
     GXV_mort_subtable_type1_StateOptRecData  optdata =
-      (GXV_mort_subtable_type1_StateOptRecData)valid->statetable.optdata;
+      (GXV_mort_subtable_type1_StateOptRecData)gxvalid->statetable.optdata;
 
 
     GXV_LIMIT_CHECK( 2 );
                                           FT_UShort*     classTable_length_p,
                                           FT_UShort*     stateArray_length_p,
                                           FT_UShort*     entryTable_length_p,
-                                          GXV_Validator  valid )
+                                          GXV_Validator  gxvalid )
   {
     FT_UShort  o[4];
     FT_UShort  *l[4];
     FT_UShort  buff[5];
 
     GXV_mort_subtable_type1_StateOptRecData  optdata =
-      (GXV_mort_subtable_type1_StateOptRecData)valid->statetable.optdata;
+      (GXV_mort_subtable_type1_StateOptRecData)gxvalid->statetable.optdata;
 
 
     o[0] = classTable;
@@ -93,7 +93,7 @@
     l[2] = entryTable_length_p;
     l[3] = &( optdata->substitutionTable_length );
 
-    gxv_set_length_by_ushort_offset( o, l, buff, 4, table_size, valid );
+    gxv_set_length_by_ushort_offset( o, l, buff, 4, table_size, gxvalid );
   }
 
 
     FT_Short          wordOffset,
     const FT_String*  tag,
     FT_Byte           state,
-    GXV_Validator     valid )
+    GXV_Validator     gxvalid )
   {
     FT_UShort  substTable;
     FT_UShort  substTable_limit;
 
     substTable =
       ((GXV_mort_subtable_type1_StateOptRec *)
-       (valid->statetable.optdata))->substitutionTable;
+       (gxvalid->statetable.optdata))->substitutionTable;
     substTable_limit =
       (FT_UShort)( substTable +
                    ((GXV_mort_subtable_type1_StateOptRec *)
-                    (valid->statetable.optdata))->substitutionTable_length );
+                    (gxvalid->statetable.optdata))->substitutionTable_length );
 
-    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 ) );
+    gxvalid->min_gid = (FT_UShort)( ( substTable       - wordOffset * 2 ) / 2 );
+    gxvalid->max_gid = (FT_UShort)( ( substTable_limit - wordOffset * 2 ) / 2 );
+    gxvalid->max_gid = (FT_UShort)( FT_MAX( gxvalid->max_gid,
+                                            gxvalid->face->num_glyphs ) );
 
     /* XXX: check range? */
 
     GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,
     FT_Bytes                        table,
     FT_Bytes                        limit,
-    GXV_Validator                   valid )
+    GXV_Validator                   gxvalid )
   {
 #ifdef GXV_LOAD_UNUSED_VARS
     FT_UShort  setMark;
     gxv_mort_subtable_type1_offset_to_subst_validate( markOffset,
                                                       "markOffset",
                                                       state,
-                                                      valid );
+                                                      gxvalid );
 
     gxv_mort_subtable_type1_offset_to_subst_validate( currentOffset,
                                                       "currentOffset",
                                                       state,
-                                                      valid );
+                                                      gxvalid );
   }
 
 
   static void
   gxv_mort_subtable_type1_substTable_validate( FT_Bytes       table,
                                                FT_Bytes       limit,
-                                               GXV_Validator  valid )
+                                               GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
     FT_UShort  num_gids = (FT_UShort)(
                  ((GXV_mort_subtable_type1_StateOptRec *)
-                  (valid->statetable.optdata))->substitutionTable_length / 2 );
+                  (gxvalid->statetable.optdata))->substitutionTable_length / 2 );
     FT_UShort  i;
 
 
       if ( dst_gid >= 0xFFFFU )
         continue;
 
-      if ( dst_gid < valid->min_gid || valid->max_gid < dst_gid )
+      if ( dst_gid < gxvalid->min_gid || gxvalid->max_gid < dst_gid )
       {
         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 ));
+                    i, dst_gid, gxvalid->min_gid, gxvalid->max_gid ));
         GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
       }
     }
   FT_LOCAL_DEF( void )
   gxv_mort_subtable_type1_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid )
+                                    GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
 
     GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE );
 
-    valid->statetable.optdata =
+    gxvalid->statetable.optdata =
       &st_rec;
-    valid->statetable.optdata_load_func =
+    gxvalid->statetable.optdata_load_func =
       gxv_mort_subtable_type1_substitutionTable_load;
-    valid->statetable.subtable_setup_func =
+    gxvalid->statetable.subtable_setup_func =
       gxv_mort_subtable_type1_subtable_setup;
-    valid->statetable.entry_glyphoffset_fmt =
+    gxvalid->statetable.entry_glyphoffset_fmt =
       GXV_GLYPHOFFSET_ULONG;
-    valid->statetable.entry_validate_func =
+    gxvalid->statetable.entry_validate_func =
 
       gxv_mort_subtable_type1_entry_validate;
-    gxv_StateTable_validate( p, limit, valid );
+    gxv_StateTable_validate( p, limit, gxvalid );
 
     gxv_mort_subtable_type1_substTable_validate(
       table + st_rec.substitutionTable,
       table + st_rec.substitutionTable + st_rec.substitutionTable_length,
-      valid );
+      gxvalid );
 
     GXV_EXIT;
   }
index 9e08fb7..099ffd4 100644 (file)
   static void
   gxv_mort_subtable_type2_opttable_load( FT_Bytes       table,
                                          FT_Bytes       limit,
-                                         GXV_Validator  valid )
+                                         GXV_Validator  gxvalid )
   {
-    FT_Bytes p = table;
+    FT_Bytes  p = table;
     GXV_mort_subtable_type2_StateOptRecData  optdata =
-      (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata;
+      (GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata;
 
 
     GXV_LIMIT_CHECK( 2 + 2 + 2 );
                                           FT_UShort      *classTable_length_p,
                                           FT_UShort      *stateArray_length_p,
                                           FT_UShort      *entryTable_length_p,
-                                          GXV_Validator  valid )
+                                          GXV_Validator  gxvalid )
   {
     FT_UShort  o[6];
     FT_UShort  *l[6];
     FT_UShort  buff[7];
 
     GXV_mort_subtable_type2_StateOptRecData  optdata =
-      (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata;
+      (GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata;
 
 
     GXV_NAME_ENTER( "subtable boundaries setup" );
     l[4] = &(optdata->componentTable_length);
     l[5] = &(optdata->ligatureTable_length);
 
-    gxv_set_length_by_ushort_offset( o, l, buff, 6, table_size, valid );
+    gxv_set_length_by_ushort_offset( o, l, buff, 6, table_size, gxvalid );
 
     GXV_TRACE(( "classTable: offset=0x%04x length=0x%04x\n",
                 classTable, *classTable_length_p ));
   gxv_mort_subtable_type2_ligActionOffset_validate(
     FT_Bytes       table,
     FT_UShort      ligActionOffset,
-    GXV_Validator  valid )
+    GXV_Validator  gxvalid )
   {
     /* access ligActionTable */
     GXV_mort_subtable_type2_StateOptRecData  optdata =
-      (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata;
+      (GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata;
 
     FT_Bytes lat_base  = table + optdata->ligActionTable;
     FT_Bytes p         = table + ligActionOffset;
     GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,
     FT_Bytes                        table,
     FT_Bytes                        limit,
-    GXV_Validator                   valid )
+    GXV_Validator                   gxvalid )
   {
 #ifdef GXV_LOAD_UNUSED_VARS
     FT_UShort setComponent;
 
     if ( 0 < offset )
       gxv_mort_subtable_type2_ligActionOffset_validate( table, offset,
-                                                        valid );
+                                                        gxvalid );
   }
 
 
   static void
   gxv_mort_subtable_type2_ligatureTable_validate( FT_Bytes       table,
-                                                  GXV_Validator  valid )
+                                                  GXV_Validator  gxvalid )
   {
     GXV_mort_subtable_type2_StateOptRecData  optdata =
-      (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata;
+      (GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata;
 
     FT_Bytes p     = table + optdata->ligatureTable;
     FT_Bytes limit = table + optdata->ligatureTable
         GXV_LIMIT_CHECK( 2 );
         lig_gid = FT_NEXT_USHORT( p );
 
-        if ( valid->face->num_glyphs < lig_gid )
+        if ( gxvalid->face->num_glyphs < lig_gid )
           GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
       }
     }
   FT_LOCAL_DEF( void )
   gxv_mort_subtable_type2_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid )
+                                    GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
 
     GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE2_HEADER_SIZE );
 
-    valid->statetable.optdata =
+    gxvalid->statetable.optdata =
       &lig_rec;
-    valid->statetable.optdata_load_func =
+    gxvalid->statetable.optdata_load_func =
       gxv_mort_subtable_type2_opttable_load;
-    valid->statetable.subtable_setup_func =
+    gxvalid->statetable.subtable_setup_func =
       gxv_mort_subtable_type2_subtable_setup;
-    valid->statetable.entry_glyphoffset_fmt =
+    gxvalid->statetable.entry_glyphoffset_fmt =
       GXV_GLYPHOFFSET_NONE;
-    valid->statetable.entry_validate_func =
+    gxvalid->statetable.entry_validate_func =
       gxv_mort_subtable_type2_entry_validate;
 
-    gxv_StateTable_validate( p, limit, valid );
+    gxv_StateTable_validate( p, limit, gxvalid );
 
-    p += valid->subtable_length;
-    gxv_mort_subtable_type2_ligatureTable_validate( table, valid );
+    p += gxvalid->subtable_length;
+    gxv_mort_subtable_type2_ligatureTable_validate( table, gxvalid );
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
 
     GXV_EXIT;
   }
index 8347098..9e86af4 100644 (file)
   static void
   gxv_mort_subtable_type4_lookupval_validate( FT_UShort            glyph,
                                               GXV_LookupValueCPtr  value_p,
-                                              GXV_Validator        valid )
+                                              GXV_Validator        gxvalid )
   {
     FT_UNUSED( glyph );
 
-    gxv_glyphid_validate( value_p->u, valid );
+    gxv_glyphid_validate( value_p->u, gxvalid );
   }
 
   /*
@@ -80,7 +80,7 @@
     FT_UShort            relative_gindex,
     GXV_LookupValueCPtr  base_value_p,
     FT_Bytes             lookuptbl_limit,
-    GXV_Validator        valid )
+    GXV_Validator        gxvalid )
   {
     FT_Bytes             p;
     FT_Bytes             limit;
@@ -91,7 +91,7 @@
     offset = (FT_UShort)( base_value_p->u +
                           relative_gindex * sizeof ( FT_UShort ) );
 
-    p     = valid->lookuptbl_head + offset;
+    p     = gxvalid->lookuptbl_head + offset;
     limit = lookuptbl_limit;
 
     GXV_LIMIT_CHECK( 2 );
   FT_LOCAL_DEF( void )
   gxv_mort_subtable_type4_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid )
+                                    GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
     GXV_NAME_ENTER( "mort chain subtable type4 "
                     "(Non-Contextual Glyph Substitution)" );
 
-    valid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
-    valid->lookupval_func   = gxv_mort_subtable_type4_lookupval_validate;
-    valid->lookupfmt4_trans = gxv_mort_subtable_type4_lookupfmt4_transit;
+    gxvalid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
+    gxvalid->lookupval_func   = gxv_mort_subtable_type4_lookupval_validate;
+    gxvalid->lookupfmt4_trans = gxv_mort_subtable_type4_lookupfmt4_transit;
 
-    gxv_LookupTable_validate( p, limit, valid );
+    gxv_LookupTable_validate( p, limit, gxvalid );
 
     GXV_EXIT;
   }
index 32cfb03..9498b10 100644 (file)
                                           FT_UShort*     classTable_length_p,
                                           FT_UShort*     stateArray_length_p,
                                           FT_UShort*     entryTable_length_p,
-                                          GXV_Validator  valid )
+                                          GXV_Validator  gxvalid )
   {
     GXV_mort_subtable_type5_StateOptRecData  optdata =
-      (GXV_mort_subtable_type5_StateOptRecData)valid->statetable.optdata;
+      (GXV_mort_subtable_type5_StateOptRecData)gxvalid->statetable.optdata;
 
 
     gxv_StateTable_subtable_setup( table_size,
@@ -83,7 +83,7 @@
                                    classTable_length_p,
                                    stateArray_length_p,
                                    entryTable_length_p,
-                                   valid );
+                                   gxvalid );
 
     optdata->classTable = classTable;
     optdata->stateArray = stateArray;
                                                FT_UShort      count,
                                                FT_Bytes       table,
                                                FT_Bytes       limit,
-                                               GXV_Validator  valid )
+                                               GXV_Validator  gxvalid )
   {
     /*
      * We don't know the range of insertion-glyph-list.
     FT_Bytes  p = table + offset;
 
     GXV_mort_subtable_type5_StateOptRecData  optdata =
-      (GXV_mort_subtable_type5_StateOptRecData)valid->statetable.optdata;
+      (GXV_mort_subtable_type5_StateOptRecData)gxvalid->statetable.optdata;
 
     if ( optdata->classTable < offset                                   &&
          offset < optdata->classTable + *(optdata->classTable_length_p) )
     GXV_StateTable_GlyphOffsetCPtr  glyphOffset,
     FT_Bytes                        table,
     FT_Bytes                        limit,
-    GXV_Validator                   valid )
+    GXV_Validator                   gxvalid )
   {
 #ifdef GXV_LOAD_UNUSED_VARS
     FT_Bool    setMark;
                                                    currentInsertCount,
                                                    table,
                                                    limit,
-                                                   valid );
+                                                   gxvalid );
     }
 
     if ( 0 != markedInsertList && 0 != markedInsertCount )
                                                    markedInsertCount,
                                                    table,
                                                    limit,
-                                                   valid );
+                                                   gxvalid );
     }
   }
 
   FT_LOCAL_DEF( void )
   gxv_mort_subtable_type5_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid )
+                                    GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
 
     GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE5_HEADER_SIZE );
 
-    valid->statetable.optdata =
+    gxvalid->statetable.optdata =
       et;
-    valid->statetable.optdata_load_func =
+    gxvalid->statetable.optdata_load_func =
       NULL;
-    valid->statetable.subtable_setup_func =
+    gxvalid->statetable.subtable_setup_func =
       gxv_mort_subtable_type5_subtable_setup;
-    valid->statetable.entry_glyphoffset_fmt =
+    gxvalid->statetable.entry_glyphoffset_fmt =
       GXV_GLYPHOFFSET_ULONG;
-    valid->statetable.entry_validate_func =
+    gxvalid->statetable.entry_validate_func =
       gxv_mort_subtable_type5_entry_validate;
 
-    gxv_StateTable_validate( p, limit, valid );
+    gxv_StateTable_validate( p, limit, gxvalid );
 
     GXV_EXIT;
   }
index 4b1dd00..96dba63 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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.                      */
 /*                                                                         */
@@ -42,7 +42,7 @@
   gxv_morx_subtables_validate( FT_Bytes       table,
                                FT_Bytes       limit,
                                FT_UShort      nSubtables,
-                               GXV_Validator  valid )
+                               GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
@@ -57,8 +57,6 @@
 
     };
 
-    GXV_Validate_Func  func;
-
     FT_UShort  i;
 
 
@@ -66,6 +64,8 @@
 
     for ( i = 0; i < nSubtables; i++ )
     {
+      GXV_Validate_Func  func;
+
       FT_ULong  length;
       FT_ULong  coverage;
 #ifdef GXV_LOAD_UNUSED_VARS
@@ -93,7 +93,7 @@
 
       /* morx coverage consists of mort_coverage & 16bit padding */
       gxv_mort_coverage_validate( (FT_UShort)( ( coverage >> 16 ) | coverage ),
-                                  valid );
+                                  gxvalid );
       if ( type > 5 )
         FT_INVALID_FORMAT;
 
       if ( func == NULL )
         GXV_TRACE(( "morx type %d is reserved\n", type ));
 
-      func( p, p + rest, valid );
+      func( p, p + rest, gxvalid );
 
       /* TODO: subFeatureFlags should be unique in a table? */
       p += rest;
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
 
     GXV_EXIT;
   }
   static void
   gxv_morx_chain_validate( FT_Bytes       table,
                            FT_Bytes       limit,
-                           GXV_Validator  valid )
+                           GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 #ifdef GXV_LOAD_UNUSED_VARS
     nSubtables    = FT_NEXT_ULONG( p );
 
     /* feature-array of morx is same with that of mort */
-    gxv_mort_featurearray_validate( p, limit, nFeatureFlags, valid );
-    p += valid->subtable_length;
+    gxv_mort_featurearray_validate( p, limit, nFeatureFlags, gxvalid );
+    p += gxvalid->subtable_length;
 
     if ( nSubtables >= 0x10000L )
       FT_INVALID_DATA;
 
     gxv_morx_subtables_validate( p, table + chainLength,
-                                 (FT_UShort)nSubtables, valid );
+                                 (FT_UShort)nSubtables, gxvalid );
 
-    valid->subtable_length = chainLength;
+    gxvalid->subtable_length = chainLength;
 
     /* TODO: defaultFlags should be compared with the flags in tables */
 
                      FT_Face       face,
                      FT_Validator  ftvalid )
   {
-    GXV_ValidatorRec  validrec;
-    GXV_Validator     valid = &validrec;
+    GXV_ValidatorRec  gxvalidrec;
+    GXV_Validator     gxvalid = &gxvalidrec;
     FT_Bytes          p     = table;
     FT_Bytes          limit = 0;
     FT_ULong          version;
     FT_ULong          i;
 
 
-    valid->root = ftvalid;
-    valid->face = face;
+    gxvalid->root = ftvalid;
+    gxvalid->face = face;
 
     FT_TRACE3(( "validating `morx' table\n" ));
     GXV_INIT;
     {
       GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains ));
       GXV_32BIT_ALIGNMENT_VALIDATE( p - table );
-      gxv_morx_chain_validate( p, limit, valid );
-      p += valid->subtable_length;
+      gxv_morx_chain_validate( p, limit, gxvalid );
+      p += gxvalid->subtable_length;
     }
 
     FT_TRACE4(( "\n" ));
index 28c1a44..9ed907a 100644 (file)
   FT_LOCAL( void )
   gxv_morx_subtable_type0_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid );
+                                    GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_morx_subtable_type1_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid );
+                                    GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_morx_subtable_type2_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid );
+                                    GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_morx_subtable_type4_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid );
+                                    GXV_Validator  gxvalid );
 
   FT_LOCAL( void )
   gxv_morx_subtable_type5_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid );
+                                    GXV_Validator  gxvalid );
 
 
 #endif /* __GXVMORX_H__ */
index 6a736c1..db165f4 100644 (file)
@@ -45,7 +45,7 @@
     GXV_XStateTable_GlyphOffsetCPtr  glyphOffset_p,
     FT_Bytes                         table,
     FT_Bytes                         limit,
-    GXV_Validator                    valid )
+    GXV_Validator                    gxvalid )
   {
 #ifdef GXV_LOAD_UNUSED_VARS
     FT_UShort  markFirst;
@@ -85,7 +85,7 @@
   FT_LOCAL_DEF( void )
   gxv_morx_subtable_type0_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid )
+                                    GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
 
     GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE );
 
-    valid->xstatetable.optdata               = NULL;
-    valid->xstatetable.optdata_load_func     = NULL;
-    valid->xstatetable.subtable_setup_func   = NULL;
-    valid->xstatetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;
-    valid->xstatetable.entry_validate_func =
+    gxvalid->xstatetable.optdata               = NULL;
+    gxvalid->xstatetable.optdata_load_func     = NULL;
+    gxvalid->xstatetable.subtable_setup_func   = NULL;
+    gxvalid->xstatetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;
+    gxvalid->xstatetable.entry_validate_func =
       gxv_morx_subtable_type0_entry_validate;
 
-    gxv_XStateTable_validate( p, limit, valid );
+    gxv_XStateTable_validate( p, limit, gxvalid );
 
     GXV_EXIT;
   }
index ce0009a..49f53d1 100644 (file)
   static void
   gxv_morx_subtable_type1_substitutionTable_load( FT_Bytes       table,
                                                   FT_Bytes       limit,
-                                                  GXV_Validator  valid )
+                                                  GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
     GXV_morx_subtable_type1_StateOptRecData  optdata =
-      (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata;
+      (GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata;
 
 
     GXV_LIMIT_CHECK( 2 );
                                           FT_ULong*      classTable_length_p,
                                           FT_ULong*      stateArray_length_p,
                                           FT_ULong*      entryTable_length_p,
-                                          GXV_Validator  valid )
+                                          GXV_Validator  gxvalid )
   {
     FT_ULong  o[4];
     FT_ULong  *l[4];
     FT_ULong  buff[5];
 
     GXV_morx_subtable_type1_StateOptRecData  optdata =
-      (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata;
+      (GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata;
 
 
     o[0] = classTable;
@@ -95,7 +95,7 @@
     l[2] = entryTable_length_p;
     l[3] = &(optdata->substitutionTable_length);
 
-    gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, valid );
+    gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, gxvalid );
   }
 
 
     GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,
     FT_Bytes                        table,
     FT_Bytes                        limit,
-    GXV_Validator                   valid )
+    GXV_Validator                   gxvalid )
   {
 #ifdef GXV_LOAD_TRACE_VARS
     FT_UShort  setMark;
     FT_Short   currentIndex;
 
     GXV_morx_subtable_type1_StateOptRecData  optdata =
-      (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata;
+      (GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata;
 
     FT_UNUSED( state );
     FT_UNUSED( table );
   static void
   gxv_morx_subtable_type1_LookupValue_validate( FT_UShort            glyph,
                                                 GXV_LookupValueCPtr  value_p,
-                                                GXV_Validator        valid )
+                                                GXV_Validator        gxvalid )
   {
     FT_UNUSED( glyph ); /* for the non-debugging case */
 
     GXV_TRACE(( "morx subtable type1 subst.: %d -> %d\n", glyph, value_p->u ));
 
-    if ( value_p->u > valid->face->num_glyphs )
+    if ( value_p->u > gxvalid->face->num_glyphs )
       FT_INVALID_GLYPH_ID;
   }
 
     FT_UShort            relative_gindex,
     GXV_LookupValueCPtr  base_value_p,
     FT_Bytes             lookuptbl_limit,
-    GXV_Validator        valid )
+    GXV_Validator        gxvalid )
   {
     FT_Bytes             p;
     FT_Bytes             limit;
     offset = (FT_UShort)( base_value_p->u +
                           relative_gindex * sizeof ( FT_UShort ) );
 
-    p     = valid->lookuptbl_head + offset;
+    p     = gxvalid->lookuptbl_head + offset;
     limit = lookuptbl_limit;
 
     GXV_LIMIT_CHECK ( 2 );
   static void
   gxv_morx_subtable_type1_substitutionTable_validate( FT_Bytes       table,
                                                       FT_Bytes       limit,
-                                                      GXV_Validator  valid )
+                                                      GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
     FT_UShort  i;
 
     GXV_morx_subtable_type1_StateOptRecData  optdata =
-      (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata;
+      (GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata;
 
 
     /* TODO: calculate offset/length for each lookupTables */
-    valid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
-    valid->lookupval_func   = gxv_morx_subtable_type1_LookupValue_validate;
-    valid->lookupfmt4_trans = gxv_morx_subtable_type1_LookupFmt4_transit;
+    gxvalid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
+    gxvalid->lookupval_func   = gxv_morx_subtable_type1_LookupValue_validate;
+    gxvalid->lookupfmt4_trans = gxv_morx_subtable_type1_LookupFmt4_transit;
 
     for ( i = 0; i < optdata->substitutionTable_num_lookupTables; i++ )
     {
       GXV_LIMIT_CHECK( 4 );
       offset = FT_NEXT_ULONG( p );
 
-      gxv_LookupTable_validate( table + offset, limit, valid );
+      gxv_LookupTable_validate( table + offset, limit, gxvalid );
     }
 
     /* TODO: overlapping of lookupTables in substitutionTable */
   FT_LOCAL_DEF( void )
   gxv_morx_subtable_type1_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid )
+                                    GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
 
     st_rec.substitutionTable_num_lookupTables = 0;
 
-    valid->xstatetable.optdata =
+    gxvalid->xstatetable.optdata =
       &st_rec;
-    valid->xstatetable.optdata_load_func =
+    gxvalid->xstatetable.optdata_load_func =
       gxv_morx_subtable_type1_substitutionTable_load;
-    valid->xstatetable.subtable_setup_func =
+    gxvalid->xstatetable.subtable_setup_func =
       gxv_morx_subtable_type1_subtable_setup;
-    valid->xstatetable.entry_glyphoffset_fmt =
+    gxvalid->xstatetable.entry_glyphoffset_fmt =
       GXV_GLYPHOFFSET_ULONG;
-    valid->xstatetable.entry_validate_func =
+    gxvalid->xstatetable.entry_validate_func =
       gxv_morx_subtable_type1_entry_validate;
 
-    gxv_XStateTable_validate( p, limit, valid );
+    gxv_XStateTable_validate( p, limit, gxvalid );
 
     gxv_morx_subtable_type1_substitutionTable_validate(
       table + st_rec.substitutionTable,
       table + st_rec.substitutionTable + st_rec.substitutionTable_length,
-      valid );
+      gxvalid );
 
     GXV_EXIT;
   }
index 9d2b0bc..e44445d 100644 (file)
@@ -5,7 +5,7 @@
 /*    TrueTypeGX/AAT morx table validation                                 */
 /*    body for type2 (Ligature Substitution) subtable.                     */
 /*                                                                         */
-/*  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,       */
   static void
   gxv_morx_subtable_type2_opttable_load( FT_Bytes       table,
                                          FT_Bytes       limit,
-                                         GXV_Validator  valid )
+                                         GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
     GXV_morx_subtable_type2_StateOptRecData  optdata =
-      (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata;
+      (GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;
 
 
     GXV_LIMIT_CHECK( 4 + 4 + 4 );
                                           FT_ULong*      classTable_length_p,
                                           FT_ULong*      stateArray_length_p,
                                           FT_ULong*      entryTable_length_p,
-                                          GXV_Validator  valid )
+                                          GXV_Validator  gxvalid )
   {
     FT_ULong   o[6];
     FT_ULong*  l[6];
     FT_ULong   buff[7];
 
     GXV_morx_subtable_type2_StateOptRecData  optdata =
-      (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata;
+      (GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;
 
 
     GXV_NAME_ENTER( "subtable boundaries setup" );
     l[4] = &(optdata->componentTable_length);
     l[5] = &(optdata->ligatureTable_length);
 
-    gxv_set_length_by_ulong_offset( o, l, buff, 6, table_size, valid );
+    gxv_set_length_by_ulong_offset( o, l, buff, 6, table_size, gxvalid );
 
     GXV_TRACE(( "classTable: offset=0x%08x length=0x%08x\n",
                 classTable, *classTable_length_p ));
   gxv_morx_subtable_type2_ligActionIndex_validate(
     FT_Bytes       table,
     FT_UShort      ligActionIndex,
-    GXV_Validator  valid )
+    GXV_Validator  gxvalid )
   {
     /* access ligActionTable */
     GXV_morx_subtable_type2_StateOptRecData optdata =
-      (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata;
+      (GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;
 
     FT_Bytes lat_base  = table + optdata->ligActionTable;
     FT_Bytes p         = lat_base +
       /* it is different from the location offset in mort */
       if ( ( offset & 0x3FFF0000UL ) == 0x3FFF0000UL )
       { /* negative offset */
-        gid_limit = valid->face->num_glyphs - ( offset & 0x0000FFFFUL );
+        gid_limit = gxvalid->face->num_glyphs - ( offset & 0x0000FFFFUL );
         if ( gid_limit > 0 )
           return;
 
                     offset & 0xFFFFU ));
         GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
       }
-      else if ( ( offset & 0x3FFF0000UL ) == 0x0000000UL )
+      else if ( ( offset & 0x3FFF0000UL ) == 0x00000000UL )
       { /* positive offset */
-        if ( (FT_Long)offset < valid->face->num_glyphs )
+        if ( (FT_Long)offset < gxvalid->face->num_glyphs )
           return;
 
         GXV_TRACE(( "ligature action table includes"
     GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,
     FT_Bytes                        table,
     FT_Bytes                        limit,
-    GXV_Validator                   valid )
+    GXV_Validator                   gxvalid )
   {
 #ifdef GXV_LOAD_UNUSED_VARS
     FT_UShort  setComponent;
 
     if ( 0 < ligActionIndex )
       gxv_morx_subtable_type2_ligActionIndex_validate(
-        table, ligActionIndex, valid );
+        table, ligActionIndex, gxvalid );
   }
 
 
   static void
   gxv_morx_subtable_type2_ligatureTable_validate( FT_Bytes       table,
-                                                  GXV_Validator  valid )
+                                                  GXV_Validator  gxvalid )
   {
     GXV_morx_subtable_type2_StateOptRecData  optdata =
-      (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata;
+      (GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;
 
     FT_Bytes p     = table + optdata->ligatureTable;
     FT_Bytes limit = table + optdata->ligatureTable
 
         GXV_LIMIT_CHECK( 2 );
         lig_gid = FT_NEXT_USHORT( p );
-        if ( lig_gid < valid->face->num_glyphs )
+        if ( lig_gid < gxvalid->face->num_glyphs )
           GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
       }
     }
   FT_LOCAL_DEF( void )
   gxv_morx_subtable_type2_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid )
+                                    GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
 
     GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE2_HEADER_SIZE );
 
-    valid->xstatetable.optdata =
+    gxvalid->xstatetable.optdata =
       &lig_rec;
-    valid->xstatetable.optdata_load_func =
+    gxvalid->xstatetable.optdata_load_func =
       gxv_morx_subtable_type2_opttable_load;
-    valid->xstatetable.subtable_setup_func =
+    gxvalid->xstatetable.subtable_setup_func =
       gxv_morx_subtable_type2_subtable_setup;
-    valid->xstatetable.entry_glyphoffset_fmt =
+    gxvalid->xstatetable.entry_glyphoffset_fmt =
       GXV_GLYPHOFFSET_USHORT;
-    valid->xstatetable.entry_validate_func =
+    gxvalid->xstatetable.entry_validate_func =
       gxv_morx_subtable_type2_entry_validate;
 
-    gxv_XStateTable_validate( p, limit, valid );
+    gxv_XStateTable_validate( p, limit, gxvalid );
 
-    p += valid->subtable_length;
-    gxv_morx_subtable_type2_ligatureTable_validate( table, valid );
+#if 0
+    p += gxvalid->subtable_length;
+#endif
+    gxv_morx_subtable_type2_ligatureTable_validate( table, gxvalid );
 
     GXV_EXIT;
   }
index c0d2f78..68ab678 100644 (file)
   FT_LOCAL_DEF( void )
   gxv_morx_subtable_type4_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid )
+                                    GXV_Validator  gxvalid )
   {
     GXV_NAME_ENTER( "morx chain subtable type4 "
                     "(Non-Contextual Glyph Substitution)" );
 
-    gxv_mort_subtable_type4_validate( table, limit, valid );
+    gxv_mort_subtable_type4_validate( table, limit, gxvalid );
 
     GXV_EXIT;
   }
index d8cf700..5e095dd 100644 (file)
   static void
   gxv_morx_subtable_type5_insertionGlyphList_load( FT_Bytes       table,
                                                    FT_Bytes       limit,
-                                                   GXV_Validator  valid )
+                                                   GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
     GXV_morx_subtable_type5_StateOptRecData  optdata =
-      (GXV_morx_subtable_type5_StateOptRecData)valid->xstatetable.optdata;
+      (GXV_morx_subtable_type5_StateOptRecData)gxvalid->xstatetable.optdata;
 
 
     GXV_LIMIT_CHECK( 4 );
                                           FT_ULong*      classTable_length_p,
                                           FT_ULong*      stateArray_length_p,
                                           FT_ULong*      entryTable_length_p,
-                                          GXV_Validator  valid )
+                                          GXV_Validator  gxvalid )
   {
     FT_ULong   o[4];
     FT_ULong*  l[4];
     FT_ULong   buff[5];
 
     GXV_morx_subtable_type5_StateOptRecData  optdata =
-      (GXV_morx_subtable_type5_StateOptRecData)valid->xstatetable.optdata;
+      (GXV_morx_subtable_type5_StateOptRecData)gxvalid->xstatetable.optdata;
 
 
     o[0] = classTable;
     l[2] = entryTable_length_p;
     l[3] = &(optdata->insertionGlyphList_length);
 
-    gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, valid );
+    gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, gxvalid );
   }
 
 
                                                FT_UShort      count,
                                                FT_Bytes       table,
                                                FT_Bytes       limit,
-                                               GXV_Validator  valid )
+                                               GXV_Validator  gxvalid )
   {
-    FT_Bytes p = table + table_index * 2;
+    FT_Bytes  p = table + table_index * 2;
 
 
 #ifndef GXV_LOAD_TRACE_VARS
     GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,
     FT_Bytes                        table,
     FT_Bytes                        limit,
-    GXV_Validator                   valid )
+    GXV_Validator                   gxvalid )
   {
 #ifdef GXV_LOAD_UNUSED_VARS
     FT_Bool    setMark;
       gxv_morx_subtable_type5_InsertList_validate( currentInsertList,
                                                    currentInsertCount,
                                                    table, limit,
-                                                   valid );
+                                                   gxvalid );
 
     if ( markedInsertList && 0 != markedInsertCount )
       gxv_morx_subtable_type5_InsertList_validate( markedInsertList,
                                                    markedInsertCount,
                                                    table, limit,
-                                                   valid );
+                                                   gxvalid );
   }
 
 
   FT_LOCAL_DEF( void )
   gxv_morx_subtable_type5_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
-                                    GXV_Validator  valid )
+                                    GXV_Validator  gxvalid )
   {
     FT_Bytes  p = table;
 
 
     GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE5_HEADER_SIZE );
 
-    valid->xstatetable.optdata =
+    gxvalid->xstatetable.optdata =
       et;
-    valid->xstatetable.optdata_load_func =
+    gxvalid->xstatetable.optdata_load_func =
       gxv_morx_subtable_type5_insertionGlyphList_load;
-    valid->xstatetable.subtable_setup_func =
+    gxvalid->xstatetable.subtable_setup_func =
       gxv_morx_subtable_type5_subtable_setup;
-    valid->xstatetable.entry_glyphoffset_fmt =
+    gxvalid->xstatetable.entry_glyphoffset_fmt =
       GXV_GLYPHOFFSET_ULONG;
-    valid->xstatetable.entry_validate_func =
+    gxvalid->xstatetable.entry_validate_func =
       gxv_morx_subtable_type5_entry_validate;
 
-    gxv_XStateTable_validate( p, limit, valid );
+    gxv_XStateTable_validate( p, limit, gxvalid );
 
     GXV_EXIT;
   }
index e125060..ab0cd72 100644 (file)
   static void
   gxv_opbd_LookupValue_validate( FT_UShort            glyph,
                                  GXV_LookupValueCPtr  value_p,
-                                 GXV_Validator        valid )
+                                 GXV_Validator        gxvalid )
   {
     /* offset in LookupTable is measured from the head of opbd table */
-    FT_Bytes   p     = valid->root->base + value_p->u;
-    FT_Bytes   limit = valid->root->limit;
+    FT_Bytes   p     = gxvalid->root->base + value_p->u;
+    FT_Bytes   limit = gxvalid->root->limit;
     FT_Short   delta_value;
     int        i;
 
@@ -90,7 +90,7 @@
         if ( delta_value == -1 )
           continue;
 
-        gxv_ctlPoint_validate( glyph, delta_value, valid );
+        gxv_ctlPoint_validate( glyph, delta_value, gxvalid );
       }
       else                              /* format 0, value is distance */
         continue;
   gxv_opbd_LookupFmt4_transit( FT_UShort            relative_gindex,
                                GXV_LookupValueCPtr  base_value_p,
                                FT_Bytes             lookuptbl_limit,
-                               GXV_Validator        valid )
+                               GXV_Validator        gxvalid )
   {
     GXV_LookupValueDesc  value;
 
     FT_UNUSED( lookuptbl_limit );
-    FT_UNUSED( valid );
+    FT_UNUSED( gxvalid );
 
     /* XXX: check range? */
     value.u = (FT_UShort)( base_value_p->u +
                      FT_Face       face,
                      FT_Validator  ftvalid )
   {
-    GXV_ValidatorRec  validrec;
-    GXV_Validator     valid = &validrec;
+    GXV_ValidatorRec  gxvalidrec;
+    GXV_Validator     gxvalid = &gxvalidrec;
     GXV_opbd_DataRec  opbdrec;
     GXV_opbd_Data     opbd  = &opbdrec;
     FT_Bytes          p     = table;
     FT_ULong  version;
 
 
-    valid->root       = ftvalid;
-    valid->table_data = opbd;
-    valid->face       = face;
+    gxvalid->root       = ftvalid;
+    gxvalid->table_data = opbd;
+    gxvalid->face       = face;
 
     FT_TRACE3(( "validating `opbd' table\n" ));
     GXV_INIT;
     if ( 0x0001 < GXV_OPBD_DATA( format ) )
       FT_INVALID_FORMAT;
 
-    valid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
-    valid->lookupval_func   = gxv_opbd_LookupValue_validate;
-    valid->lookupfmt4_trans = gxv_opbd_LookupFmt4_transit;
+    gxvalid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
+    gxvalid->lookupval_func   = gxv_opbd_LookupValue_validate;
+    gxvalid->lookupfmt4_trans = gxv_opbd_LookupFmt4_transit;
 
-    gxv_LookupTable_validate( p, limit, valid );
-    p += valid->subtable_length;
+    gxv_LookupTable_validate( p, limit, gxvalid );
+    p += gxvalid->subtable_length;
 
     if ( p > table + GXV_OPBD_DATA( valueOffset_min ) )
     {
index 0be2133..aa5c8ee 100644 (file)
@@ -75,7 +75,7 @@
 
   static void
   gxv_prop_zero_advance_validate( FT_UShort      gid,
-                                  GXV_Validator  valid )
+                                  GXV_Validator  gxvalid )
   {
     FT_Face       face;
     FT_Error      error;
@@ -84,7 +84,7 @@
 
     GXV_NAME_ENTER( "zero advance" );
 
-    face = valid->face;
+    face = gxvalid->face;
 
     error = FT_Load_Glyph( face,
                            gid,
   static void
   gxv_prop_property_validate( FT_UShort      property,
                               FT_UShort      glyph,
-                              GXV_Validator  valid )
+                              GXV_Validator  gxvalid )
   {
     if ( glyph != 0 && ( property & GXV_PROP_FLOATER ) )
-      gxv_prop_zero_advance_validate( glyph, valid );
+      gxv_prop_zero_advance_validate( glyph, gxvalid );
 
     if ( property & GXV_PROP_USE_COMPLEMENTARY_BRACKET )
     {
       else
       {
         /* The gid for complement must be the face. */
-        gxv_glyphid_validate( (FT_UShort)( glyph + complement ), valid );
+        gxv_glyphid_validate( (FT_UShort)( glyph + complement ), gxvalid );
       }
     }
     else
   static void
   gxv_prop_LookupValue_validate( FT_UShort            glyph,
                                  GXV_LookupValueCPtr  value_p,
-                                 GXV_Validator        valid )
+                                 GXV_Validator        gxvalid )
   {
-    gxv_prop_property_validate( value_p->u, glyph, valid );
+    gxv_prop_property_validate( value_p->u, glyph, gxvalid );
   }
 
 
   gxv_prop_LookupFmt4_transit( FT_UShort            relative_gindex,
                                GXV_LookupValueCPtr  base_value_p,
                                FT_Bytes             lookuptbl_limit,
-                               GXV_Validator        valid )
+                               GXV_Validator        gxvalid )
   {
     FT_Bytes             p;
     FT_Bytes             limit;
     /* XXX: check range? */
     offset = (FT_UShort)( base_value_p->u +
                           relative_gindex * sizeof ( FT_UShort ) );
-    p      = valid->lookuptbl_head + offset;
+    p      = gxvalid->lookuptbl_head + offset;
     limit  = lookuptbl_limit;
 
     GXV_LIMIT_CHECK ( 2 );
   {
     FT_Bytes          p     = table;
     FT_Bytes          limit = 0;
-    GXV_ValidatorRec  validrec;
-    GXV_Validator     valid = &validrec;
+    GXV_ValidatorRec  gxvalidrec;
+    GXV_Validator     gxvalid = &gxvalidrec;
 
     GXV_prop_DataRec  proprec;
     GXV_prop_Data     prop = &proprec;
     FT_UShort         defaultProp;
 
 
-    valid->root       = ftvalid;
-    valid->table_data = prop;
-    valid->face       = face;
+    gxvalid->root       = ftvalid;
+    gxvalid->table_data = prop;
+    gxvalid->face       = face;
 
     FT_TRACE3(( "validating `prop' table\n" ));
     GXV_INIT;
       FT_INVALID_FORMAT;
     }
 
-    gxv_prop_property_validate( defaultProp, 0, valid );
+    gxv_prop_property_validate( defaultProp, 0, gxvalid );
 
     if ( format == 0 )
     {
     /* format == 1 */
     GXV_PROP_DATA( version ) = version;
 
-    valid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
-    valid->lookupval_func   = gxv_prop_LookupValue_validate;
-    valid->lookupfmt4_trans = gxv_prop_LookupFmt4_transit;
+    gxvalid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
+    gxvalid->lookupval_func   = gxv_prop_LookupValue_validate;
+    gxvalid->lookupfmt4_trans = gxv_prop_LookupFmt4_transit;
 
-    gxv_LookupTable_validate( p, limit, valid );
+    gxv_LookupTable_validate( p, limit, gxvalid );
 
   Exit:
     FT_TRACE4(( "\n" ));
index 11fbd7c..3ec1a56 100644 (file)
@@ -93,9 +93,9 @@
   gxv_trak_trackTable_validate( FT_Bytes       table,
                                 FT_Bytes       limit,
                                 FT_UShort      nTracks,
-                                GXV_Validator  valid )
+                                GXV_Validator  gxvalid )
   {
-    FT_Bytes   p = table;
+    FT_Bytes  p = table;
 
     FT_Fixed   track, t;
     FT_UShort  nameIndex;
       if ( offset > GXV_TRAK_DATA( trackValueOffset_max ) )
         GXV_TRAK_DATA( trackValueOffset_max ) = offset;
 
-      gxv_sfntName_validate( nameIndex, 256, 32767, valid );
+      gxv_sfntName_validate( nameIndex, 256, 32767, gxvalid );
 
       for ( j = i; j < nTracks; j ++ )
       {
       }
     }
 
-    valid->subtable_length = p - table;
+    gxvalid->subtable_length = p - table;
     GXV_EXIT;
   }
 
   static void
   gxv_trak_trackData_validate( FT_Bytes       table,
                                FT_Bytes       limit,
-                               GXV_Validator  valid )
+                               GXV_Validator  gxvalid )
   {
     FT_Bytes   p = table;
     FT_UShort  nTracks;
     gxv_odtect_add_range( table, p - table, "trackData header", odtect );
 
     /* validate trackTable */
-    gxv_trak_trackTable_validate( p, limit, nTracks, valid );
-    gxv_odtect_add_range( p, valid->subtable_length,
+    gxv_trak_trackTable_validate( p, limit, nTracks, gxvalid );
+    gxv_odtect_add_range( p, gxvalid->subtable_length,
                           "trackTable", odtect );
 
     /* sizeTable is array of FT_Fixed, don't check contents */
-    p = valid->root->base + sizeTableOffset;
+    p = gxvalid->root->base + sizeTableOffset;
     GXV_LIMIT_CHECK( nSizes * 4 );
     gxv_odtect_add_range( p, nSizes * 4, "sizeTable", odtect );
 
     /* validate trackValueOffet */
-    p = valid->root->base + GXV_TRAK_DATA( trackValueOffset_min );
+    p = gxvalid->root->base + GXV_TRAK_DATA( trackValueOffset_min );
     if ( limit - p < nTracks * nSizes * 2 )
       GXV_TRACE(( "too short trackValue array\n" ));
 
-    p = valid->root->base + GXV_TRAK_DATA( trackValueOffset_max );
+    p = gxvalid->root->base + GXV_TRAK_DATA( trackValueOffset_max );
     GXV_LIMIT_CHECK( nSizes * 2 );
 
-    gxv_odtect_add_range( valid->root->base
+    gxv_odtect_add_range( gxvalid->root->base
                             + GXV_TRAK_DATA( trackValueOffset_min ),
                           GXV_TRAK_DATA( trackValueOffset_max )
                             - GXV_TRAK_DATA( trackValueOffset_min )
                             + nSizes * 2,
                           "trackValue array", odtect );
 
-    gxv_odtect_validate( odtect, valid );
+    gxv_odtect_validate( odtect, gxvalid );
 
     GXV_EXIT;
   }
     FT_Bytes          p = table;
     FT_Bytes          limit = 0;
 
-    GXV_ValidatorRec  validrec;
-    GXV_Validator     valid = &validrec;
+    GXV_ValidatorRec  gxvalidrec;
+    GXV_Validator     gxvalid = &gxvalidrec;
     GXV_trak_DataRec  trakrec;
     GXV_trak_Data     trak = &trakrec;
 
     GXV_ODTECT( 3, odtect );
 
     GXV_ODTECT_INIT( odtect );
-    valid->root       = ftvalid;
-    valid->table_data = trak;
-    valid->face       = face;
+    gxvalid->root       = ftvalid;
+    gxvalid->table_data = trak;
+    gxvalid->face       = face;
 
-    limit      = valid->root->limit;
+    limit      = gxvalid->root->limit;
 
     FT_TRACE3(( "validating `trak' table\n" ));
     GXV_INIT;
     /* validate trackData */
     if ( 0 < horizOffset )
     {
-      gxv_trak_trackData_validate( table + horizOffset, limit, valid );
-      gxv_odtect_add_range( table + horizOffset, valid->subtable_length,
+      gxv_trak_trackData_validate( table + horizOffset, limit, gxvalid );
+      gxv_odtect_add_range( table + horizOffset, gxvalid->subtable_length,
                             "horizJustData", odtect );
     }
 
     if ( 0 < vertOffset )
     {
-      gxv_trak_trackData_validate( table + vertOffset, limit, valid );
-      gxv_odtect_add_range( table + vertOffset, valid->subtable_length,
+      gxv_trak_trackData_validate( table + vertOffset, limit, gxvalid );
+      gxv_odtect_add_range( table + vertOffset, gxvalid->subtable_length,
                             "vertJustData", odtect );
     }
 
-    gxv_odtect_validate( odtect, valid );
+    gxv_odtect_validate( odtect, gxvalid );
 
     FT_TRACE4(( "\n" ));
   }
index f3d2ef9..2d4200d 100644 (file)
@@ -8,7 +8,7 @@
 /*  parse compressed PCF fonts, as found with many X11 server              */
 /*  distributions.                                                         */
 /*                                                                         */
-/*  Copyright 2002-2006, 2009-2012 by                                      */
+/*  Copyright 2002-2006, 2009-2014 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #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
 #include "inflate.c"
 #include "adler32.c"
 
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
+
 #endif /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */
 
 
 
     /* head[0] && head[1] are the magic numbers;    */
     /* head[2] is the method, and head[3] the flags */
-    if ( head[0] != 0x1f              ||
-         head[1] != 0x8b              ||
+    if ( head[0] != 0x1F              ||
+         head[1] != 0x8B              ||
          head[2] != Z_DEFLATED        ||
         (head[3] & FT_GZIP_RESERVED)  )
     {
-      error = Gzip_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
                      FT_Stream    source )
   {
     z_stream*  zstream = &zip->zstream;
-    FT_Error   error   = Gzip_Err_Ok;
+    FT_Error   error   = FT_Err_Ok;
 
 
     zip->stream = stream;
 
     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;
       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
     {
         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 );
     }
     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_Error   error   = Gzip_Err_Ok;
+    FT_Error   error   = FT_Err_Ok;
 
 
     zip->cursor        = zip->buffer;
       {
         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 )
       {
-        error = Gzip_Err_Invalid_Stream_Operation;
+        error = FT_THROW( Invalid_Stream_Operation );
         break;
       }
     }
   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;
 
 
   }
 
 
+  /* documentation is in ftgzip.h */
+
   FT_EXPORT_DEF( FT_Error )
   FT_Stream_OpenGzip( FT_Stream  stream,
                       FT_Stream  source )
   {
     FT_Error     error;
-    FT_Memory    memory = source->memory;
+    FT_Memory    memory;
     FT_GZipFile  zip = NULL;
 
 
+    if ( !stream || !source )
+    {
+      error = FT_THROW( Invalid_Stream_Handle );
+      goto Exit;
+    }
+
+    memory = source->memory;
+
     /*
      *  check the header right now; this prevents allocating un-necessary
      *  objects when we don't need them
           ft_gzip_file_io( zip, 0, NULL, 0 );
           FT_FREE( zip_buff );
         }
-        error = Gzip_Err_Ok;
+        error = FT_Err_Ok;
       }
     }
 
     return error;
   }
 
-#else  /* !FT_CONFIG_OPTION_USE_ZLIB */
+
+  /* documentation is in ftgzip.h */
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Gzip_Uncompress( FT_Memory       memory,
+                      FT_Byte*        output,
+                      FT_ULong*       output_len,
+                      const FT_Byte*  input,
+                      FT_ULong        input_len )
+  {
+    z_stream  stream;
+    int       err;
+
+
+    /* check for `input' delayed to `inflate' */
+
+    if ( !memory || ! output_len || !output )
+      return FT_THROW( Invalid_Argument );
+
+    /* this function is modeled after zlib's `uncompress' function */
+
+    stream.next_in  = (Bytef*)input;
+    stream.avail_in = (uInt)input_len;
+
+    stream.next_out  = output;
+    stream.avail_out = (uInt)*output_len;
+
+    stream.zalloc = (alloc_func)ft_gzip_alloc;
+    stream.zfree  = (free_func) ft_gzip_free;
+    stream.opaque = memory;
+
+    err = inflateInit2( &stream, MAX_WBITS );
+    if ( err != Z_OK )
+      return FT_THROW( Invalid_Argument );
+
+    err = inflate( &stream, Z_FINISH );
+    if ( err != Z_STREAM_END )
+    {
+      inflateEnd( &stream );
+      if ( err == Z_OK )
+        err = Z_BUF_ERROR;
+    }
+    else
+    {
+      *output_len = stream.total_out;
+
+      err = inflateEnd( &stream );
+    }
+
+    if ( err == Z_MEM_ERROR )
+      return FT_THROW( Out_Of_Memory );
+
+    if ( err == Z_BUF_ERROR )
+      return FT_THROW( Array_Too_Large );
+
+    if ( err == Z_DATA_ERROR )
+      return FT_THROW( Invalid_Table );
+
+    return FT_Err_Ok;
+  }
+
+
+#else /* !FT_CONFIG_OPTION_USE_ZLIB */
 
   FT_EXPORT_DEF( FT_Error )
   FT_Stream_OpenGzip( FT_Stream  stream,
     FT_UNUSED( stream );
     FT_UNUSED( source );
 
-    return Gzip_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
+  }
+
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Gzip_Uncompress( FT_Memory       memory,
+                      FT_Byte*        output,
+                      FT_ULong*       output_len,
+                      const FT_Byte*  input,
+                      FT_ULong        input_len )
+  {
+    FT_UNUSED( memory );
+    FT_UNUSED( output );
+    FT_UNUSED( output_len );
+    FT_UNUSED( input );
+    FT_UNUSED( input_len );
+
+    return FT_THROW( Unimplemented_Feature );
   }
 
 #endif /* !FT_CONFIG_OPTION_USE_ZLIB */
index ef53652..56f52b1 100644 (file)
@@ -115,16 +115,16 @@ uIntf *v                /* working area: values in order of bit length */
   uInt f;                       /* i repeats in table every f entries */
   int g;                        /* maximum code length */
   int h;                        /* table level */
-  register uInt i;              /* counter, current code */
-  register uInt j;              /* counter */
-  register int k;               /* number of bits in current code */
+  uInt i;                       /* counter, current code */
+  uInt j;                       /* counter */
+  int k;                        /* number of bits in current code */
   int l;                        /* bits per table (returned in m) */
   uInt mask;                    /* (1 << w) - 1, to avoid cc -O bug on HP */
-  register uIntf *p;            /* pointer into c[], b[], or v[] */
+  uIntf *p;                     /* pointer into c[], b[], or v[] */
   inflate_huft *q;              /* points to current table */
   struct inflate_huft_s r;      /* table entry for structure assignment */
   inflate_huft *u[BMAX];        /* table stack */
-  register int w;               /* bits before this table == (l * h) */
+  int w;                        /* bits before this table == (l * h) */
   uInt x[BMAX+1];               /* bit offsets, then code stack */
   uIntf *xp;                    /* pointer into x */
   int y;                        /* number of dummy codes added */
index d2a43a6..37cd991 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 2002, 2003 by
+# Copyright 2002, 2003, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -27,49 +27,52 @@ else
 endif
 
 
-# gzip support sources (i.e., C files)
+# gzip support sources
 #
-GZIP_DRV_SRC := $(GZIP_DIR)/ftgzip.c
-
-# gzip support headers
+# All source and header files get loaded by `ftgzip.c' only if SYTEM_ZLIB is
+# not defined (regardless whether we have a `single' or a `multi' build).
+# However, it doesn't harm if we add everything as a dependency
+# unconditionally.
 #
-GZIP_DRV_H :=
+GZIP_DRV_SRCS := $(GZIP_DIR)/adler32.c  \
+                 $(GZIP_DIR)/infblock.c \
+                 $(GZIP_DIR)/infblock.h \
+                 $(GZIP_DIR)/infcodes.c \
+                 $(GZIP_DIR)/infcodes.h \
+                 $(GZIP_DIR)/inffixed.h \
+                 $(GZIP_DIR)/inflate.c  \
+                 $(GZIP_DIR)/inftrees.c \
+                 $(GZIP_DIR)/inftrees.h \
+                 $(GZIP_DIR)/infutil.c  \
+                 $(GZIP_DIR)/infutil.h  \
+                 $(GZIP_DIR)/zconf.h    \
+                 $(GZIP_DIR)/zlib.h     \
+                 $(GZIP_DIR)/zutil.c    \
+                 $(GZIP_DIR)/zutil.h
 
 
 # gzip driver object(s)
 #
-#   GZIP_DRV_OBJ_M is used during `multi' builds
-#   GZIP_DRV_OBJ_S is used during `single' builds
-#
-ifeq ($(SYSTEM_ZLIB),)
-  GZIP_DRV_OBJ_M := $(GZIP_DRV_SRC:$(GZIP_DIR)/%.c=$(OBJ_DIR)/%.$O)
-else
-  GZIP_DRV_OBJ_M := $(OBJ_DIR)/ftgzip.$O
-endif
-GZIP_DRV_OBJ_S := $(OBJ_DIR)/ftgzip.$O
-
-# gzip support source file for single build
+#   GZIP_DRV_OBJ is used during both `single' and `multi' builds
 #
-GZIP_DRV_SRC_S := $(GZIP_DIR)/ftgzip.c
+GZIP_DRV_OBJ := $(OBJ_DIR)/ftgzip.$O
 
 
-# gzip support - single object
+# gzip main source file
 #
-$(GZIP_DRV_OBJ_S): $(GZIP_DRV_SRC_S) $(GZIP_DRV_SRC) $(FREETYPE_H) \
-                   $(GZIP_DRV_H)
-       $(GZIP_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(GZIP_DRV_SRC_S))
+GZIP_DRV_SRC := $(GZIP_DIR)/ftgzip.c
 
 
-# gzip support - multiple objects
+# gzip support - object
 #
-$(OBJ_DIR)/%.$O: $(GZIP_DIR)/%.c $(FREETYPE_H) $(GZIP_DRV_H)
-       $(GZIP_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
+$(GZIP_DRV_OBJ): $(GZIP_DRV_SRC) $(GZIP_DRV_SRCS) $(FREETYPE_H)
+       $(GZIP_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(GZIP_DRV_SRC))
 
 
 # update main driver object lists
 #
-DRV_OBJS_S += $(GZIP_DRV_OBJ_S)
-DRV_OBJS_M += $(GZIP_DRV_OBJ_M)
+DRV_OBJS_S += $(GZIP_DRV_OBJ)
+DRV_OBJS_M += $(GZIP_DRV_OBJ)
 
 
 # EOF
index 35e392b..e1b3564 100644 (file)
@@ -8,7 +8,7 @@
 /*  be used to parse compressed PCF fonts, as found with many X11 server   */
 /*  distributions.                                                         */
 /*                                                                         */
-/*  Copyright 2004-2006, 2009, 2010, 2012 by                               */
+/*  Copyright 2004-2006, 2009, 2010, 2012-2014 by                          */
 /*  Albert Chin-A-Young.                                                   */
 /*                                                                         */
 /*  Based on code in src/gzip/ftgzip.c, Copyright 2004 by                  */
@@ -96,9 +96,9 @@
       goto Exit;
 
     /* head[0] && head[1] are the magic numbers */
-    if ( head[0] != 0x1f ||
-         head[1] != 0x9d )
-      error = LZW_Err_Invalid_File_Format;
+    if ( head[0] != 0x1F ||
+         head[1] != 0x9D )
+      error = FT_THROW( Invalid_File_Format );
 
   Exit:
     return error;
                     FT_Stream   source )
   {
     FT_LzwState  lzw   = &zip->lzw;
-    FT_Error     error = LZW_Err_Ok;
+    FT_Error     error;
 
 
     zip->stream = stream;
   {
     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->limit = zip->cursor + count;
 
     if ( count == 0 )
-      error = LZW_Err_Invalid_Stream_Operation;
+      error = FT_THROW( Invalid_Stream_Operation );
 
     return error;
   }
   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 */
       if ( numread < delta )
       {
         /* not enough bytes */
-        error = LZW_Err_Invalid_Stream_Operation;
+        error = FT_THROW( Invalid_Stream_Operation );
         break;
       }
 
                      FT_Stream  source )
   {
     FT_Error    error;
-    FT_Memory   memory = source->memory;
+    FT_Memory   memory;
     FT_LZWFile  zip = NULL;
 
 
+    if ( !stream || !source )
+    {
+      error = FT_THROW( Invalid_Stream_Handle );
+      goto Exit;
+    }
+
+    memory = source->memory;
+
     /*
      *  Check the header right now; this prevents allocation of a huge
      *  LZWFile object (400 KByte of heap memory) if not necessary.
     FT_UNUSED( stream );
     FT_UNUSED( source );
 
-    return LZW_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
   }
 
 
index f7d2936..cdc8fd7 100644 (file)
@@ -41,7 +41,7 @@
 #define LZW_CLEAR         256
 #define LZW_FIRST         257
 
-#define LZW_BIT_MASK      0x1f
+#define LZW_BIT_MASK      0x1F
 #define LZW_BLOCK_MASK    0x80
 #define LZW_MASK( n )     ( ( 1U << (n) ) - 1U )
 
index d742d2d..4f9d2fa 100644 (file)
@@ -32,7 +32,7 @@
 
   static void
   otv_BaseCoord_validate( FT_Bytes       table,
-                          OTV_Validator  valid )
+                          OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   BaseCoordFormat;
@@ -58,7 +58,7 @@
     case 3:     /* BaseCoordFormat3 */
       OTV_LIMIT_CHECK( 2 );
       /* DeviceTable */
-      otv_Device_validate( table + FT_NEXT_USHORT( p ), valid );
+      otv_Device_validate( table + FT_NEXT_USHORT( p ), otvalid );
       break;
 
     default:
@@ -71,7 +71,7 @@
 
   static void
   otv_BaseTagList_validate( FT_Bytes       table,
-                            OTV_Validator  valid )
+                            OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   BaseTagCount;
@@ -93,7 +93,7 @@
 
   static void
   otv_BaseValues_validate( FT_Bytes       table,
-                           OTV_Validator  valid )
+                           OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   BaseCoordCount;
 
     /* BaseCoord */
     for ( ; BaseCoordCount > 0; BaseCoordCount-- )
-      otv_BaseCoord_validate( table + FT_NEXT_USHORT( p ), valid );
+      otv_BaseCoord_validate( table + FT_NEXT_USHORT( p ), otvalid );
 
     OTV_EXIT;
   }
 
   static void
   otv_MinMax_validate( FT_Bytes       table,
-                       OTV_Validator  valid )
+                       OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   table_size;
 
     OTV_SIZE_CHECK( MinCoord );
     if ( MinCoord )
-      otv_BaseCoord_validate( table + MinCoord, valid );
+      otv_BaseCoord_validate( table + MinCoord, otvalid );
 
     OTV_SIZE_CHECK( MaxCoord );
     if ( MaxCoord )
-      otv_BaseCoord_validate( table + MaxCoord, valid );
+      otv_BaseCoord_validate( table + MaxCoord, otvalid );
 
     OTV_LIMIT_CHECK( FeatMinMaxCount * 8 );
 
 
       OTV_SIZE_CHECK( MinCoord );
       if ( MinCoord )
-        otv_BaseCoord_validate( table + MinCoord, valid );
+        otv_BaseCoord_validate( table + MinCoord, otvalid );
 
       OTV_SIZE_CHECK( MaxCoord );
       if ( MaxCoord )
-        otv_BaseCoord_validate( table + MaxCoord, valid );
+        otv_BaseCoord_validate( table + MaxCoord, otvalid );
     }
 
     OTV_EXIT;
 
   static void
   otv_BaseScript_validate( FT_Bytes       table,
-                           OTV_Validator  valid )
+                           OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   table_size;
 
     OTV_SIZE_CHECK( BaseValues );
     if ( BaseValues )
-      otv_BaseValues_validate( table + BaseValues, valid );
+      otv_BaseValues_validate( table + BaseValues, otvalid );
 
     OTV_SIZE_CHECK( DefaultMinMax );
     if ( DefaultMinMax )
-      otv_MinMax_validate( table + DefaultMinMax, valid );
+      otv_MinMax_validate( table + DefaultMinMax, otvalid );
 
     OTV_LIMIT_CHECK( BaseLangSysCount * 6 );
 
     {
       p += 4;       /* skip BaseLangSysTag */
 
-      otv_MinMax_validate( table + FT_NEXT_USHORT( p ), valid );
+      otv_MinMax_validate( table + FT_NEXT_USHORT( p ), otvalid );
     }
 
     OTV_EXIT;
 
   static void
   otv_BaseScriptList_validate( FT_Bytes       table,
-                               OTV_Validator  valid )
+                               OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   BaseScriptCount;
       p += 4;       /* skip BaseScriptTag */
 
       /* BaseScript */
-      otv_BaseScript_validate( table + FT_NEXT_USHORT( p ), valid );
+      otv_BaseScript_validate( table + FT_NEXT_USHORT( p ), otvalid );
     }
 
     OTV_EXIT;
 
   static void
   otv_Axis_validate( FT_Bytes       table,
-                     OTV_Validator  valid )
+                     OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   table_size;
 
     OTV_SIZE_CHECK( BaseTagList );
     if ( BaseTagList )
-      otv_BaseTagList_validate( table + BaseTagList, valid );
+      otv_BaseTagList_validate( table + BaseTagList, otvalid );
 
     /* BaseScriptList */
-    otv_BaseScriptList_validate( table + FT_NEXT_USHORT( p ), valid );
+    otv_BaseScriptList_validate( table + FT_NEXT_USHORT( p ), otvalid );
 
     OTV_EXIT;
   }
   otv_BASE_validate( FT_Bytes      table,
                      FT_Validator  ftvalid )
   {
-    OTV_ValidatorRec  validrec;
-    OTV_Validator     valid = &validrec;
-    FT_Bytes          p     = table;
+    OTV_ValidatorRec  otvalidrec;
+    OTV_Validator     otvalid = &otvalidrec;
+    FT_Bytes          p       = table;
     FT_UInt           table_size;
 
     OTV_OPTIONAL_TABLE( HorizAxis );
     OTV_OPTIONAL_TABLE( VertAxis  );
 
 
-    valid->root = ftvalid;
+    otvalid->root = ftvalid;
 
     FT_TRACE3(( "validating BASE table\n" ));
     OTV_INIT;
     OTV_OPTIONAL_OFFSET( HorizAxis );
     OTV_SIZE_CHECK( HorizAxis );
     if ( HorizAxis )
-      otv_Axis_validate( table + HorizAxis, valid );
+      otv_Axis_validate( table + HorizAxis, otvalid );
 
     OTV_OPTIONAL_OFFSET( VertAxis );
     OTV_SIZE_CHECK( VertAxis );
     if ( VertAxis )
-      otv_Axis_validate( table + VertAxis, valid );
+      otv_Axis_validate( table + VertAxis, otvalid );
 
     FT_TRACE4(( "\n" ));
   }
index a4f885b..3c3de63 100644 (file)
@@ -39,7 +39,7 @@
 
   FT_LOCAL_DEF( void )
   otv_Coverage_validate( FT_Bytes       table,
-                         OTV_Validator  valid,
+                         OTV_Validator  otvalid,
                          FT_Int         expected_count )
   {
     FT_Bytes  p = table;
@@ -74,7 +74,7 @@
 
 
           gid = FT_NEXT_USHORT( p );
-          if ( gid >= valid->glyph_count )
+          if ( gid >= otvalid->glyph_count )
             FT_INVALID_GLYPH_ID;
         }
 
           if ( Start > End || StartCoverageIndex != total )
             FT_INVALID_DATA;
 
-          if ( End >= valid->glyph_count )
+          if ( End >= otvalid->glyph_count )
             FT_INVALID_GLYPH_ID;
 
           if ( n > 0 && Start <= last )
 
   FT_LOCAL_DEF( void )
   otv_ClassDef_validate( FT_Bytes       table,
-                         OTV_Validator  valid )
+                         OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   ClassFormat;
 
         OTV_LIMIT_CHECK( GlyphCount * 2 );    /* ClassValueArray */
 
-        if ( StartGlyph + GlyphCount - 1 >= valid->glyph_count )
+        if ( StartGlyph + GlyphCount - 1 >= otvalid->glyph_count )
           FT_INVALID_GLYPH_ID;
       }
       break;
           if ( Start > End || ( n > 0 && Start <= last ) )
             FT_INVALID_DATA;
 
-          if ( End >= valid->glyph_count )
+          if ( End >= otvalid->glyph_count )
             FT_INVALID_GLYPH_ID;
 
           last = End;
 
   FT_LOCAL_DEF( void )
   otv_Device_validate( FT_Bytes       table,
-                       OTV_Validator  valid )
+                       OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   StartSize, EndSize, DeltaFormat, count;
   /*************************************************************************/
   /*************************************************************************/
 
-  /* uses valid->type_count */
-  /* uses valid->type_funcs */
+  /* uses otvalid->type_count */
+  /* uses otvalid->type_funcs */
 
   FT_LOCAL_DEF( void )
   otv_Lookup_validate( FT_Bytes       table,
-                       OTV_Validator  valid )
+                       OTV_Validator  otvalid )
   {
     FT_Bytes           p = table;
     FT_UInt            LookupType, SubTableCount;
 
     OTV_TRACE(( " (type %d)\n", LookupType ));
 
-    if ( LookupType == 0 || LookupType > valid->type_count )
+    if ( LookupType == 0 || LookupType > otvalid->type_count )
       FT_INVALID_DATA;
 
-    validate = valid->type_funcs[LookupType - 1];
+    validate = otvalid->type_funcs[LookupType - 1];
 
     OTV_TRACE(( " (SubTableCount = %d)\n", SubTableCount ));
 
 
     /* SubTable */
     for ( ; SubTableCount > 0; SubTableCount-- )
-      validate( table + FT_NEXT_USHORT( p ), valid );
+      validate( table + FT_NEXT_USHORT( p ), otvalid );
 
     OTV_EXIT;
   }
 
   FT_LOCAL_DEF( void )
   otv_LookupList_validate( FT_Bytes       table,
-                           OTV_Validator  valid )
+                           OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   LookupCount;
 
     OTV_LIMIT_CHECK( LookupCount * 2 );
 
-    valid->lookup_count = LookupCount;
+    otvalid->lookup_count = LookupCount;
 
     /* Lookup */
     for ( ; LookupCount > 0; LookupCount-- )
-      otv_Lookup_validate( table + FT_NEXT_USHORT( p ), valid );
+      otv_Lookup_validate( table + FT_NEXT_USHORT( p ), otvalid );
 
     OTV_EXIT;
   }
   /*************************************************************************/
   /*************************************************************************/
 
-  /* uses valid->lookup_count */
+  /* uses otvalid->lookup_count */
 
   FT_LOCAL_DEF( void )
   otv_Feature_validate( FT_Bytes       table,
-                        OTV_Validator  valid )
+                        OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   LookupCount;
 
     /* LookupListIndex */
     for ( ; LookupCount > 0; LookupCount-- )
-      if ( FT_NEXT_USHORT( p ) >= valid->lookup_count )
+      if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count )
         FT_INVALID_DATA;
 
     OTV_EXIT;
   }
 
 
-  /* sets valid->lookup_count */
+  /* sets otvalid->lookup_count */
 
   FT_LOCAL_DEF( void )
   otv_FeatureList_validate( FT_Bytes       table,
                             FT_Bytes       lookups,
-                            OTV_Validator  valid )
+                            OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   FeatureCount;
 
     OTV_LIMIT_CHECK( FeatureCount * 2 );
 
-    valid->lookup_count = otv_LookupList_get_count( lookups );
+    otvalid->lookup_count = otv_LookupList_get_count( lookups );
 
     /* FeatureRecord */
     for ( ; FeatureCount > 0; FeatureCount-- )
       p += 4;       /* skip FeatureTag */
 
       /* Feature */
-      otv_Feature_validate( table + FT_NEXT_USHORT( p ), valid );
+      otv_Feature_validate( table + FT_NEXT_USHORT( p ), otvalid );
     }
 
     OTV_EXIT;
   /*************************************************************************/
 
 
-  /* uses valid->extra1 (number of features) */
+  /* uses otvalid->extra1 (number of features) */
 
   FT_LOCAL_DEF( void )
   otv_LangSys_validate( FT_Bytes       table,
-                        OTV_Validator  valid )
+                        OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   ReqFeatureIndex;
     OTV_TRACE(( " (ReqFeatureIndex = %d)\n", ReqFeatureIndex ));
     OTV_TRACE(( " (FeatureCount = %d)\n",    FeatureCount    ));
 
-    if ( ReqFeatureIndex != 0xFFFFU && ReqFeatureIndex >= valid->extra1 )
+    if ( ReqFeatureIndex != 0xFFFFU && ReqFeatureIndex >= otvalid->extra1 )
       FT_INVALID_DATA;
 
     OTV_LIMIT_CHECK( FeatureCount * 2 );
 
     /* FeatureIndex */
     for ( ; FeatureCount > 0; FeatureCount-- )
-      if ( FT_NEXT_USHORT( p ) >= valid->extra1 )
+      if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )
         FT_INVALID_DATA;
 
     OTV_EXIT;
 
   FT_LOCAL_DEF( void )
   otv_Script_validate( FT_Bytes       table,
-                       OTV_Validator  valid )
+                       OTV_Validator  otvalid )
   {
     FT_UInt   DefaultLangSys, LangSysCount;
     FT_Bytes  p = table;
     OTV_TRACE(( " (LangSysCount = %d)\n", LangSysCount ));
 
     if ( DefaultLangSys != 0 )
-      otv_LangSys_validate( table + DefaultLangSys, valid );
+      otv_LangSys_validate( table + DefaultLangSys, otvalid );
 
     OTV_LIMIT_CHECK( LangSysCount * 6 );
 
       p += 4;       /* skip LangSysTag */
 
       /* LangSys */
-      otv_LangSys_validate( table + FT_NEXT_USHORT( p ), valid );
+      otv_LangSys_validate( table + FT_NEXT_USHORT( p ), otvalid );
     }
 
     OTV_EXIT;
   }
 
 
-  /* sets valid->extra1 (number of features) */
+  /* sets otvalid->extra1 (number of features) */
 
   FT_LOCAL_DEF( void )
   otv_ScriptList_validate( FT_Bytes       table,
                            FT_Bytes       features,
-                           OTV_Validator  valid )
+                           OTV_Validator  otvalid )
   {
     FT_UInt   ScriptCount;
     FT_Bytes  p = table;
 
     OTV_LIMIT_CHECK( ScriptCount * 6 );
 
-    valid->extra1 = otv_Feature_get_count( features );
+    otvalid->extra1 = otv_Feature_get_count( features );
 
     /* ScriptRecord */
     for ( ; ScriptCount > 0; ScriptCount-- )
     {
       p += 4;       /* skip ScriptTag */
 
-      otv_Script_validate( table + FT_NEXT_USHORT( p ), valid ); /* Script */
+      otv_Script_validate( table + FT_NEXT_USHORT( p ), otvalid ); /* Script */
     }
 
     OTV_EXIT;
 
   FT_LOCAL_DEF( void )
   otv_x_Ox( FT_Bytes       table,
-            OTV_Validator  valid )
+            OTV_Validator  otvalid )
   {
     FT_Bytes           p = table;
     FT_UInt            Count;
 
     OTV_LIMIT_CHECK( Count * 2 );
 
-    valid->nesting_level++;
-    func = valid->func[valid->nesting_level];
+    otvalid->nesting_level++;
+    func = otvalid->func[otvalid->nesting_level];
 
     for ( ; Count > 0; Count-- )
-      func( table + FT_NEXT_USHORT( p ), valid );
+      func( table + FT_NEXT_USHORT( p ), otvalid );
 
-    valid->nesting_level--;
+    otvalid->nesting_level--;
 
     OTV_EXIT;
   }
 
   FT_LOCAL_DEF( void )
   otv_u_C_x_Ox( FT_Bytes       table,
-                OTV_Validator  valid )
+                OTV_Validator  otvalid )
   {
     FT_Bytes           p = table;
     FT_UInt            Count, Coverage;
 
     OTV_TRACE(( " (Count = %d)\n", Count ));
 
-    otv_Coverage_validate( table + Coverage, valid, Count );
+    otv_Coverage_validate( table + Coverage, otvalid, Count );
 
     OTV_LIMIT_CHECK( Count * 2 );
 
-    valid->nesting_level++;
-    func = valid->func[valid->nesting_level];
+    otvalid->nesting_level++;
+    func = otvalid->func[otvalid->nesting_level];
 
     for ( ; Count > 0; Count-- )
-      func( table + FT_NEXT_USHORT( p ), valid );
+      func( table + FT_NEXT_USHORT( p ), otvalid );
 
-    valid->nesting_level--;
+    otvalid->nesting_level--;
 
     OTV_EXIT;
   }
 
 
-  /* uses valid->extra1 (if > 0: array value limit) */
+  /* uses otvalid->extra1 (if > 0: array value limit) */
 
   FT_LOCAL_DEF( void )
   otv_x_ux( FT_Bytes       table,
-            OTV_Validator  valid )
+            OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   Count;
 
     OTV_LIMIT_CHECK( Count * 2 );
 
-    if ( valid->extra1 )
+    if ( otvalid->extra1 )
     {
       for ( ; Count > 0; Count-- )
-        if ( FT_NEXT_USHORT( p ) >= valid->extra1 )
+        if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )
           FT_INVALID_DATA;
     }
 
   /* `ux' in the function's name is not really correct since only x-1 */
   /* elements are tested                                              */
 
-  /* uses valid->extra1 (array value limit) */
+  /* uses otvalid->extra1 (array value limit) */
 
   FT_LOCAL_DEF( void )
   otv_x_y_ux_sy( FT_Bytes       table,
-                 OTV_Validator  valid )
+                 OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   Count1, Count2;
       if ( FT_NEXT_USHORT( p ) >= Count1 )
         FT_INVALID_DATA;
 
-      if ( FT_NEXT_USHORT( p ) >= valid->extra1 )
+      if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )
         FT_INVALID_DATA;
     }
 
   /* `uy' in the function's name is not really correct since only y-1 */
   /* elements are tested                                              */
 
-  /* uses valid->extra1 (array value limit) */
+  /* uses otvalid->extra1 (array value limit) */
 
   FT_LOCAL_DEF( void )
   otv_x_ux_y_uy_z_uz_p_sp( FT_Bytes       table,
-                           OTV_Validator  valid )
+                           OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   BacktrackCount, InputCount, LookaheadCount;
       if ( FT_NEXT_USHORT( p ) >= InputCount )
         FT_INVALID_DATA;
 
-      if ( FT_NEXT_USHORT( p ) >= valid->extra1 )
+      if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )
         FT_INVALID_DATA;
     }
 
   }
 
 
-  /* sets valid->extra1 (valid->lookup_count) */
+  /* sets otvalid->extra1 (valid->lookup_count) */
 
   FT_LOCAL_DEF( void )
   otv_u_O_O_x_Onx( FT_Bytes       table,
-                   OTV_Validator  valid )
+                   OTV_Validator  otvalid )
   {
     FT_Bytes           p = table;
     FT_UInt            Coverage, ClassDef, ClassSetCount;
 
     OTV_TRACE(( " (ClassSetCount = %d)\n", ClassSetCount ));
 
-    otv_Coverage_validate( table + Coverage, valid, -1 );
-    otv_ClassDef_validate( table + ClassDef, valid );
+    otv_Coverage_validate( table + Coverage, otvalid, -1 );
+    otv_ClassDef_validate( table + ClassDef, otvalid );
 
     OTV_LIMIT_CHECK( ClassSetCount * 2 );
 
-    valid->nesting_level++;
-    func          = valid->func[valid->nesting_level];
-    valid->extra1 = valid->lookup_count;
+    otvalid->nesting_level++;
+    func          = otvalid->func[otvalid->nesting_level];
+    otvalid->extra1 = otvalid->lookup_count;
 
     for ( ; ClassSetCount > 0; ClassSetCount-- )
     {
 
 
       if ( offset )
-        func( table + offset, valid );
+        func( table + offset, otvalid );
     }
 
-    valid->nesting_level--;
+    otvalid->nesting_level--;
 
     OTV_EXIT;
   }
 
 
-  /* uses valid->lookup_count */
+  /* uses otvalid->lookup_count */
 
   FT_LOCAL_DEF( void )
   otv_u_x_y_Ox_sy( FT_Bytes       table,
-                   OTV_Validator  valid )
+                   OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   GlyphCount, Count, count1;
     OTV_LIMIT_CHECK( GlyphCount * 2 + Count * 4 );
 
     for ( count1 = GlyphCount; count1 > 0; count1-- )
-      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid, -1 );
+      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );
 
     for ( ; Count > 0; Count-- )
     {
       if ( FT_NEXT_USHORT( p ) >= GlyphCount )
         FT_INVALID_DATA;
 
-      if ( FT_NEXT_USHORT( p ) >= valid->lookup_count )
+      if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count )
         FT_INVALID_DATA;
     }
 
   }
 
 
-  /* sets valid->extra1 (valid->lookup_count)    */
+  /* sets otvalid->extra1 (valid->lookup_count)    */
 
   FT_LOCAL_DEF( void )
   otv_u_O_O_O_O_x_Onx( FT_Bytes       table,
-                       OTV_Validator  valid )
+                       OTV_Validator  otvalid )
   {
     FT_Bytes           p = table;
     FT_UInt            Coverage;
 
     OTV_TRACE(( " (ChainClassSetCount = %d)\n", ChainClassSetCount ));
 
-    otv_Coverage_validate( table + Coverage, valid, -1 );
+    otv_Coverage_validate( table + Coverage, otvalid, -1 );
 
-    otv_ClassDef_validate( table + BacktrackClassDef,  valid );
-    otv_ClassDef_validate( table + InputClassDef, valid );
-    otv_ClassDef_validate( table + LookaheadClassDef, valid );
+    otv_ClassDef_validate( table + BacktrackClassDef,  otvalid );
+    otv_ClassDef_validate( table + InputClassDef, otvalid );
+    otv_ClassDef_validate( table + LookaheadClassDef, otvalid );
 
     OTV_LIMIT_CHECK( ChainClassSetCount * 2 );
 
-    valid->nesting_level++;
-    func          = valid->func[valid->nesting_level];
-    valid->extra1 = valid->lookup_count;
+    otvalid->nesting_level++;
+    func          = otvalid->func[otvalid->nesting_level];
+    otvalid->extra1 = otvalid->lookup_count;
 
     for ( ; ChainClassSetCount > 0; ChainClassSetCount-- )
     {
 
 
       if ( offset )
-        func( table + offset, valid );
+        func( table + offset, otvalid );
     }
 
-    valid->nesting_level--;
+    otvalid->nesting_level--;
 
     OTV_EXIT;
   }
 
 
-  /* uses valid->lookup_count */
+  /* uses otvalid->lookup_count */
 
   FT_LOCAL_DEF( void )
   otv_u_x_Ox_y_Oy_z_Oz_p_sp( FT_Bytes       table,
-                             OTV_Validator  valid )
+                             OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   BacktrackGlyphCount, InputGlyphCount, LookaheadGlyphCount;
     OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 );
 
     for ( ; BacktrackGlyphCount > 0; BacktrackGlyphCount-- )
-      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid, -1 );
+      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );
 
     InputGlyphCount = FT_NEXT_USHORT( p );
 
     OTV_LIMIT_CHECK( InputGlyphCount * 2 + 2 );
 
     for ( count1 = InputGlyphCount; count1 > 0; count1-- )
-      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid, -1 );
+      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );
 
     LookaheadGlyphCount = FT_NEXT_USHORT( p );
 
     OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 );
 
     for ( ; LookaheadGlyphCount > 0; LookaheadGlyphCount-- )
-      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid, -1 );
+      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );
 
     count2 = FT_NEXT_USHORT( p );
 
       if ( FT_NEXT_USHORT( p ) >= InputGlyphCount )
         FT_INVALID_DATA;
 
-      if ( FT_NEXT_USHORT( p ) >= valid->lookup_count )
+      if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count )
         FT_INVALID_DATA;
     }
 
index 898887f..5c93ba7 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType common tables validation (specification).                   */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2007, 2009 by                                    */
+/*  Copyright 2004, 2005, 2007, 2009, 2014 by                              */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -39,7 +39,7 @@ FT_BEGIN_HEADER
   typedef struct OTV_ValidatorRec_*  OTV_Validator;
 
   typedef void  (*OTV_Validate_Func)( FT_Bytes       table,
-                                      OTV_Validator  valid );
+                                      OTV_Validator  otvalid );
 
   typedef struct  OTV_ValidatorRec_
   {
@@ -67,8 +67,8 @@ FT_BEGIN_HEADER
 
 
 #undef  FT_INVALID_
-#define FT_INVALID_( _prefix, _error )                         \
-          ft_validator_error( valid->root, _prefix ## _error )
+#define FT_INVALID_( _error ) \
+          ft_validator_error( otvalid->root, FT_THROW( _error ) )
 
 #define OTV_OPTIONAL_TABLE( _table )  FT_UShort  _table;      \
                                       FT_Bytes   _table ## _p
@@ -81,7 +81,7 @@ FT_BEGIN_HEADER
 
 #define OTV_LIMIT_CHECK( _count )                    \
           FT_BEGIN_STMNT                             \
-            if ( p + (_count) > valid->root->limit ) \
+            if ( p + (_count) > otvalid->root->limit ) \
               FT_INVALID_TOO_SHORT;                  \
           FT_END_STMNT
 
@@ -89,7 +89,7 @@ FT_BEGIN_HEADER
           FT_BEGIN_STMNT                                            \
             if ( _size > 0 && _size < table_size )                  \
             {                                                       \
-              if ( valid->root->level == FT_VALIDATE_PARANOID )     \
+              if ( otvalid->root->level == FT_VALIDATE_PARANOID )     \
                 FT_INVALID_OFFSET;                                  \
               else                                                  \
               {                                                     \
@@ -117,79 +117,79 @@ FT_BEGIN_HEADER
 
 #ifdef FT_DEBUG_LEVEL_TRACE
 
-#define OTV_NEST1( x )                                     \
-          FT_BEGIN_STMNT                                   \
-            valid->nesting_level          = 0;             \
-            valid->func[0]                = OTV_FUNC( x ); \
-            valid->debug_function_name[0] = OTV_NAME( x ); \
+#define OTV_NEST1( x )                                       \
+          FT_BEGIN_STMNT                                     \
+            otvalid->nesting_level          = 0;             \
+            otvalid->func[0]                = OTV_FUNC( x ); \
+            otvalid->debug_function_name[0] = OTV_NAME( x ); \
           FT_END_STMNT
 
-#define OTV_NEST2( x, y )                                  \
-          FT_BEGIN_STMNT                                   \
-            valid->nesting_level          = 0;             \
-            valid->func[0]                = OTV_FUNC( x ); \
-            valid->func[1]                = OTV_FUNC( y ); \
-            valid->debug_function_name[0] = OTV_NAME( x ); \
-            valid->debug_function_name[1] = OTV_NAME( y ); \
+#define OTV_NEST2( x, y )                                    \
+          FT_BEGIN_STMNT                                     \
+            otvalid->nesting_level          = 0;             \
+            otvalid->func[0]                = OTV_FUNC( x ); \
+            otvalid->func[1]                = OTV_FUNC( y ); \
+            otvalid->debug_function_name[0] = OTV_NAME( x ); \
+            otvalid->debug_function_name[1] = OTV_NAME( y ); \
           FT_END_STMNT
 
-#define OTV_NEST3( x, y, z )                               \
-          FT_BEGIN_STMNT                                   \
-            valid->nesting_level          = 0;             \
-            valid->func[0]                = OTV_FUNC( x ); \
-            valid->func[1]                = OTV_FUNC( y ); \
-            valid->func[2]                = OTV_FUNC( z ); \
-            valid->debug_function_name[0] = OTV_NAME( x ); \
-            valid->debug_function_name[1] = OTV_NAME( y ); \
-            valid->debug_function_name[2] = OTV_NAME( z ); \
+#define OTV_NEST3( x, y, z )                                 \
+          FT_BEGIN_STMNT                                     \
+            otvalid->nesting_level          = 0;             \
+            otvalid->func[0]                = OTV_FUNC( x ); \
+            otvalid->func[1]                = OTV_FUNC( y ); \
+            otvalid->func[2]                = OTV_FUNC( z ); \
+            otvalid->debug_function_name[0] = OTV_NAME( x ); \
+            otvalid->debug_function_name[1] = OTV_NAME( y ); \
+            otvalid->debug_function_name[2] = OTV_NAME( z ); \
           FT_END_STMNT
 
-#define OTV_INIT  valid->debug_indent = 0
+#define OTV_INIT  otvalid->debug_indent = 0
 
-#define OTV_ENTER                                                            \
-          FT_BEGIN_STMNT                                                     \
-            valid->debug_indent += 2;                                        \
-            FT_TRACE4(( "%*.s", valid->debug_indent, 0 ));                   \
-            FT_TRACE4(( "%s table\n",                                        \
-                        valid->debug_function_name[valid->nesting_level] )); \
+#define OTV_ENTER                                                              \
+          FT_BEGIN_STMNT                                                       \
+            otvalid->debug_indent += 2;                                        \
+            FT_TRACE4(( "%*.s", otvalid->debug_indent, 0 ));                   \
+            FT_TRACE4(( "%s table\n",                                          \
+                        otvalid->debug_function_name[otvalid->nesting_level] )); \
           FT_END_STMNT
 
-#define OTV_NAME_ENTER( name )                             \
-          FT_BEGIN_STMNT                                   \
-            valid->debug_indent += 2;                      \
-            FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \
-            FT_TRACE4(( "%s table\n", name ));             \
+#define OTV_NAME_ENTER( name )                               \
+          FT_BEGIN_STMNT                                     \
+            otvalid->debug_indent += 2;                      \
+            FT_TRACE4(( "%*.s", otvalid->debug_indent, 0 )); \
+            FT_TRACE4(( "%s table\n", name ));               \
           FT_END_STMNT
 
-#define OTV_EXIT  valid->debug_indent -= 2
+#define OTV_EXIT  otvalid->debug_indent -= 2
 
-#define OTV_TRACE( s )                                     \
-          FT_BEGIN_STMNT                                   \
-            FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \
-            FT_TRACE4( s );                                \
+#define OTV_TRACE( s )                                       \
+          FT_BEGIN_STMNT                                     \
+            FT_TRACE4(( "%*.s", otvalid->debug_indent, 0 )); \
+            FT_TRACE4( s );                                  \
           FT_END_STMNT
 
 #else   /* !FT_DEBUG_LEVEL_TRACE */
 
-#define OTV_NEST1( x )                            \
-          FT_BEGIN_STMNT                          \
-            valid->nesting_level = 0;             \
-            valid->func[0]       = OTV_FUNC( x ); \
+#define OTV_NEST1( x )                              \
+          FT_BEGIN_STMNT                            \
+            otvalid->nesting_level = 0;             \
+            otvalid->func[0]       = OTV_FUNC( x ); \
           FT_END_STMNT
 
-#define OTV_NEST2( x, y )                         \
-          FT_BEGIN_STMNT                          \
-            valid->nesting_level = 0;             \
-            valid->func[0]       = OTV_FUNC( x ); \
-            valid->func[1]       = OTV_FUNC( y ); \
+#define OTV_NEST2( x, y )                           \
+          FT_BEGIN_STMNT                            \
+            otvalid->nesting_level = 0;             \
+            otvalid->func[0]       = OTV_FUNC( x ); \
+            otvalid->func[1]       = OTV_FUNC( y ); \
           FT_END_STMNT
 
-#define OTV_NEST3( x, y, z )                      \
-          FT_BEGIN_STMNT                          \
-            valid->nesting_level = 0;             \
-            valid->func[0]       = OTV_FUNC( x ); \
-            valid->func[1]       = OTV_FUNC( y ); \
-            valid->func[2]       = OTV_FUNC( z ); \
+#define OTV_NEST3( x, y, z )                        \
+          FT_BEGIN_STMNT                            \
+            otvalid->nesting_level = 0;             \
+            otvalid->func[0]       = OTV_FUNC( x ); \
+            otvalid->func[1]       = OTV_FUNC( y ); \
+            otvalid->func[2]       = OTV_FUNC( z ); \
           FT_END_STMNT
 
 #define OTV_INIT                do { } while ( 0 )
@@ -202,7 +202,7 @@ FT_BEGIN_HEADER
 #endif  /* !FT_DEBUG_LEVEL_TRACE */
 
 
-#define OTV_RUN  valid->func[0]
+#define OTV_RUN  otvalid->func[0]
 
 
   /*************************************************************************/
@@ -215,7 +215,7 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   otv_Coverage_validate( FT_Bytes       table,
-                         OTV_Validator  valid,
+                         OTV_Validator  otvalid,
                          FT_Int         expected_count );
 
   /* return first covered glyph */
@@ -241,7 +241,7 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   otv_ClassDef_validate( FT_Bytes       table,
-                         OTV_Validator  valid );
+                         OTV_Validator  otvalid );
 
 
   /*************************************************************************/
@@ -254,7 +254,7 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   otv_Device_validate( FT_Bytes       table,
-                       OTV_Validator  valid );
+                       OTV_Validator  otvalid );
 
 
   /*************************************************************************/
@@ -267,11 +267,11 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   otv_Lookup_validate( FT_Bytes       table,
-                       OTV_Validator  valid );
+                       OTV_Validator  otvalid );
 
   FT_LOCAL( void )
   otv_LookupList_validate( FT_Bytes       table,
-                           OTV_Validator  valid );
+                           OTV_Validator  otvalid );
 
 
   /*************************************************************************/
@@ -284,13 +284,13 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   otv_Feature_validate( FT_Bytes       table,
-                        OTV_Validator  valid );
+                        OTV_Validator  otvalid );
 
   /* lookups must already be validated */
   FT_LOCAL( void )
   otv_FeatureList_validate( FT_Bytes       table,
                             FT_Bytes       lookups,
-                            OTV_Validator  valid );
+                            OTV_Validator  otvalid );
 
 
   /*************************************************************************/
@@ -303,7 +303,7 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   otv_LangSys_validate( FT_Bytes       table,
-                        OTV_Validator  valid );
+                        OTV_Validator  otvalid );
 
 
   /*************************************************************************/
@@ -316,13 +316,13 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   otv_Script_validate( FT_Bytes       table,
-                       OTV_Validator  valid );
+                       OTV_Validator  otvalid );
 
   /* features must already be validated */
   FT_LOCAL( void )
   otv_ScriptList_validate( FT_Bytes       table,
                            FT_Bytes       features,
-                           OTV_Validator  valid );
+                           OTV_Validator  otvalid );
 
 
   /*************************************************************************/
@@ -349,7 +349,7 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   otv_x_Ox ( FT_Bytes       table,
-             OTV_Validator  valid );
+             OTV_Validator  otvalid );
 
 #define AlternateSubstFormat1Func     otv_u_C_x_Ox
 #define ChainContextPosFormat1Func    otv_u_C_x_Ox
@@ -361,7 +361,7 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   otv_u_C_x_Ox( FT_Bytes       table,
-                OTV_Validator  valid );
+                OTV_Validator  otvalid );
 
 #define AlternateSetFunc     otv_x_ux
 #define AttachPointFunc      otv_x_ux
@@ -372,7 +372,7 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   otv_x_ux( FT_Bytes       table,
-            OTV_Validator  valid );
+            OTV_Validator  otvalid );
 
 #define PosClassRuleFunc  otv_x_y_ux_sy
 #define PosRuleFunc       otv_x_y_ux_sy
@@ -381,7 +381,7 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   otv_x_y_ux_sy( FT_Bytes       table,
-                 OTV_Validator  valid );
+                 OTV_Validator  otvalid );
 
 #define ChainPosClassRuleFunc  otv_x_ux_y_uy_z_uz_p_sp
 #define ChainPosRuleFunc       otv_x_ux_y_uy_z_uz_p_sp
@@ -390,35 +390,35 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   otv_x_ux_y_uy_z_uz_p_sp( FT_Bytes       table,
-                           OTV_Validator  valid );
+                           OTV_Validator  otvalid );
 
 #define ContextPosFormat2Func    otv_u_O_O_x_Onx
 #define ContextSubstFormat2Func  otv_u_O_O_x_Onx
 
   FT_LOCAL( void )
   otv_u_O_O_x_Onx( FT_Bytes       table,
-                   OTV_Validator  valid );
+                   OTV_Validator  otvalid );
 
 #define ContextPosFormat3Func    otv_u_x_y_Ox_sy
 #define ContextSubstFormat3Func  otv_u_x_y_Ox_sy
 
   FT_LOCAL( void )
   otv_u_x_y_Ox_sy( FT_Bytes       table,
-                   OTV_Validator  valid );
+                   OTV_Validator  otvalid );
 
 #define ChainContextPosFormat2Func    otv_u_O_O_O_O_x_Onx
 #define ChainContextSubstFormat2Func  otv_u_O_O_O_O_x_Onx
 
   FT_LOCAL( void )
   otv_u_O_O_O_O_x_Onx( FT_Bytes       table,
-                       OTV_Validator  valid );
+                       OTV_Validator  otvalid );
 
 #define ChainContextPosFormat3Func    otv_u_x_Ox_y_Oy_z_Oz_p_sp
 #define ChainContextSubstFormat3Func  otv_u_x_Ox_y_Oy_z_Oz_p_sp
 
   FT_LOCAL( void )
   otv_u_x_Ox_y_Oy_z_Oz_p_sp( FT_Bytes       table,
-                             OTV_Validator  valid );
+                             OTV_Validator  otvalid );
 
 
   FT_LOCAL( FT_UInt )
index 522f4a2..b6f00c9 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType validation module error codes (specification only).         */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2012 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,       */
@@ -34,8 +34,6 @@
 #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__ */
index 3633ad0..e60ef36 100644 (file)
@@ -45,7 +45,7 @@
 
   static void
   otv_O_x_Ox( FT_Bytes       table,
-              OTV_Validator  valid )
+              OTV_Validator  otvalid )
   {
     FT_Bytes           p = table;
     FT_Bytes           Coverage;
 
     OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));
 
-    otv_Coverage_validate( Coverage, valid, GlyphCount );
+    otv_Coverage_validate( Coverage, otvalid, GlyphCount );
     if ( GlyphCount != otv_Coverage_get_count( Coverage ) )
       FT_INVALID_DATA;
 
     OTV_LIMIT_CHECK( GlyphCount * 2 );
 
-    valid->nesting_level++;
-    func          = valid->func[valid->nesting_level];
-    valid->extra1 = 0;
+    otvalid->nesting_level++;
+    func          = otvalid->func[otvalid->nesting_level];
+    otvalid->extra1 = 0;
 
     for ( ; GlyphCount > 0; GlyphCount-- )
-      func( table + FT_NEXT_USHORT( p ), valid );
+      func( table + FT_NEXT_USHORT( p ), otvalid );
 
-    valid->nesting_level--;
+    otvalid->nesting_level--;
 
     OTV_EXIT;
   }
@@ -92,7 +92,7 @@
 
   static void
   otv_CaretValue_validate( FT_Bytes       table,
-                           OTV_Validator  valid )
+                           OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   CaretValueFormat;
       OTV_LIMIT_CHECK( 2 );
 
       /* DeviceTable */
-      otv_Device_validate( table + FT_NEXT_USHORT( p ), valid );
+      otv_Device_validate( table + FT_NEXT_USHORT( p ), otvalid );
       break;
 
     default:
   /*************************************************************************/
   /*************************************************************************/
 
-  /* sets valid->glyph_count */
+  /* sets otvalid->glyph_count */
 
   FT_LOCAL_DEF( void )
   otv_GDEF_validate( FT_Bytes      table,
                      FT_UInt       glyph_count,
                      FT_Validator  ftvalid )
   {
-    OTV_ValidatorRec  validrec;
-    OTV_Validator     valid = &validrec;
+    OTV_ValidatorRec  otvalidrec;
+    OTV_Validator     otvalid = &otvalidrec;
     FT_Bytes          p     = table;
     FT_UInt           table_size;
     FT_Bool           need_MarkAttachClassDef;
     OTV_OPTIONAL_TABLE( MarkAttachClassDef );
 
 
-    valid->root = ftvalid;
+    otvalid->root = ftvalid;
 
     FT_TRACE3(( "validating GDEF table\n" ));
     OTV_INIT;
     else
       table_size = 10;              /* OpenType < 1.2  */
 
-    valid->glyph_count = glyph_count;
+    otvalid->glyph_count = glyph_count;
 
     OTV_OPTIONAL_OFFSET( GlyphClassDef );
     OTV_SIZE_CHECK( GlyphClassDef );
     if ( GlyphClassDef )
-      otv_ClassDef_validate( table + GlyphClassDef, valid );
+      otv_ClassDef_validate( table + GlyphClassDef, otvalid );
 
     OTV_OPTIONAL_OFFSET( AttachListOffset );
     OTV_SIZE_CHECK( AttachListOffset );
     if ( AttachListOffset )
     {
       OTV_NEST2( AttachList, AttachPoint );
-      OTV_RUN( table + AttachListOffset, valid );
+      OTV_RUN( table + AttachListOffset, otvalid );
     }
 
     OTV_OPTIONAL_OFFSET( LigCaretListOffset );
     if ( LigCaretListOffset )
     {
       OTV_NEST3( LigCaretList, LigGlyph, CaretValue );
-      OTV_RUN( table + LigCaretListOffset, valid );
+      OTV_RUN( table + LigCaretListOffset, otvalid );
     }
 
     if ( need_MarkAttachClassDef )
       OTV_OPTIONAL_OFFSET( MarkAttachClassDef );
       OTV_SIZE_CHECK( MarkAttachClassDef );
       if ( MarkAttachClassDef )
-        otv_ClassDef_validate( table + MarkAttachClassDef, valid );
+        otv_ClassDef_validate( table + MarkAttachClassDef, otvalid );
     }
 
     FT_TRACE4(( "\n" ));
index 49b4618..1a9dbaa 100644 (file)
@@ -57,7 +57,7 @@
 
   static void
   otv_x_sxy( FT_Bytes       table,
-             OTV_Validator  valid )
+             OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   Count, count1, table_size;
 
     OTV_TRACE(( " (Count = %d)\n", Count ));
 
-    OTV_LIMIT_CHECK( Count * valid->extra1 * 2 );
+    OTV_LIMIT_CHECK( Count * otvalid->extra1 * 2 );
 
-    table_size = Count * valid->extra1 * 2 + 2;
+    table_size = Count * otvalid->extra1 * 2 + 2;
 
     for ( ; Count > 0; Count-- )
-      for ( count1 = valid->extra1; count1 > 0; count1-- )
+      for ( count1 = otvalid->extra1; count1 > 0; count1-- )
       {
         OTV_OPTIONAL_TABLE( anchor_offset );
 
 
         OTV_OPTIONAL_OFFSET( anchor_offset );
 
-        if ( valid->extra2 )
+        if ( otvalid->extra2 )
         {
           OTV_SIZE_CHECK( anchor_offset );
           if ( anchor_offset )
-            otv_Anchor_validate( table + anchor_offset, valid );
+            otv_Anchor_validate( table + anchor_offset, otvalid );
         }
         else
-          otv_Anchor_validate( table + anchor_offset, valid );
+          otv_Anchor_validate( table + anchor_offset, otvalid );
       }
 
     OTV_EXIT;
 #define MarkLigPosFormat1Func   otv_u_O_O_u_O_O
 #define MarkMarkPosFormat1Func  otv_u_O_O_u_O_O
 
-  /* sets valid->extra1 (class count) */
+  /* sets otvalid->extra1 (class count) */
 
   static void
   otv_u_O_O_u_O_O( FT_Bytes       table,
-                   OTV_Validator  valid )
+                   OTV_Validator  otvalid )
   {
     FT_Bytes           p = table;
     FT_UInt            Coverage1, Coverage2, ClassCount;
     Array1     = FT_NEXT_USHORT( p );
     Array2     = FT_NEXT_USHORT( p );
 
-    otv_Coverage_validate( table + Coverage1, valid, -1 );
-    otv_Coverage_validate( table + Coverage2, valid, -1 );
+    otv_Coverage_validate( table + Coverage1, otvalid, -1 );
+    otv_Coverage_validate( table + Coverage2, otvalid, -1 );
 
-    otv_MarkArray_validate( table + Array1, valid );
+    otv_MarkArray_validate( table + Array1, otvalid );
 
-    valid->nesting_level++;
-    func          = valid->func[valid->nesting_level];
-    valid->extra1 = ClassCount;
+    otvalid->nesting_level++;
+    func          = otvalid->func[otvalid->nesting_level];
+    otvalid->extra1 = ClassCount;
 
-    func( table + Array2, valid );
+    func( table + Array2, otvalid );
 
-    valid->nesting_level--;
+    otvalid->nesting_level--;
 
     OTV_EXIT;
   }
   }
 
 
-  /* uses valid->extra3 (pointer to base table) */
+  /* uses otvalid->extra3 (pointer to base table) */
 
   static void
   otv_ValueRecord_validate( FT_Bytes       table,
                             FT_UInt        format,
-                            OTV_Validator  valid )
+                            OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   count;
         /* ValueRecord is part of an array -- getting the correct table    */
         /* size is probably not worth the trouble                          */
 
-        table_size = p - valid->extra3;
+        table_size = p - otvalid->extra3;
 
         OTV_SIZE_CHECK( device );
         if ( device )
-          otv_Device_validate( valid->extra3 + device, valid );
+          otv_Device_validate( otvalid->extra3 + device, otvalid );
       }
       format >>= 1;
     }
 
   static void
   otv_Anchor_validate( FT_Bytes       table,
-                       OTV_Validator  valid )
+                       OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   AnchorFormat;
 
         OTV_SIZE_CHECK( XDeviceTable );
         if ( XDeviceTable )
-          otv_Device_validate( table + XDeviceTable, valid );
+          otv_Device_validate( table + XDeviceTable, otvalid );
 
         OTV_SIZE_CHECK( YDeviceTable );
         if ( YDeviceTable )
-          otv_Device_validate( table + YDeviceTable, valid );
+          otv_Device_validate( table + YDeviceTable, otvalid );
       }
       break;
 
 
   static void
   otv_MarkArray_validate( FT_Bytes       table,
-                          OTV_Validator  valid )
+                          OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   MarkCount;
     {
       p += 2;   /* skip Class */
       /* MarkAnchor */
-      otv_Anchor_validate( table + FT_NEXT_USHORT( p ), valid );
+      otv_Anchor_validate( table + FT_NEXT_USHORT( p ), otvalid );
     }
 
     OTV_EXIT;
   /*************************************************************************/
   /*************************************************************************/
 
-  /* sets valid->extra3 (pointer to base table) */
+  /* sets otvalid->extra3 (pointer to base table) */
 
   static void
   otv_SinglePos_validate( FT_Bytes       table,
-                          OTV_Validator  valid )
+                          OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   PosFormat;
 
     OTV_TRACE(( " (format %d)\n", PosFormat ));
 
-    valid->extra3 = table;
+    otvalid->extra3 = table;
 
     switch ( PosFormat )
     {
         Coverage    = FT_NEXT_USHORT( p );
         ValueFormat = FT_NEXT_USHORT( p );
 
-        otv_Coverage_validate( table + Coverage, valid, -1 );
-        otv_ValueRecord_validate( p, ValueFormat, valid ); /* Value */
+        otv_Coverage_validate( table + Coverage, otvalid, -1 );
+        otv_ValueRecord_validate( p, ValueFormat, otvalid ); /* Value */
       }
       break;
 
 
         len_value = otv_value_length( ValueFormat );
 
-        otv_Coverage_validate( table + Coverage, valid, ValueCount );
+        otv_Coverage_validate( table + Coverage, otvalid, ValueCount );
 
         OTV_LIMIT_CHECK( ValueCount * len_value );
 
         /* Value */
         for ( ; ValueCount > 0; ValueCount-- )
         {
-          otv_ValueRecord_validate( p, ValueFormat, valid );
+          otv_ValueRecord_validate( p, ValueFormat, otvalid );
           p += len_value;
         }
       }
   otv_PairSet_validate( FT_Bytes       table,
                         FT_UInt        format1,
                         FT_UInt        format2,
-                        OTV_Validator  valid )
+                        OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   value_len1, value_len2, PairValueCount;
       p += 2;       /* skip SecondGlyph */
 
       if ( format1 )
-        otv_ValueRecord_validate( p, format1, valid ); /* Value1 */
+        otv_ValueRecord_validate( p, format1, otvalid ); /* Value1 */
       p += value_len1;
 
       if ( format2 )
-        otv_ValueRecord_validate( p, format2, valid ); /* Value2 */
+        otv_ValueRecord_validate( p, format2, otvalid ); /* Value2 */
       p += value_len2;
     }
 
   }
 
 
-  /* sets valid->extra3 (pointer to base table) */
+  /* sets otvalid->extra3 (pointer to base table) */
 
   static void
   otv_PairPos_validate( FT_Bytes       table,
-                        OTV_Validator  valid )
+                        OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   PosFormat;
 
     OTV_TRACE(( " (format %d)\n", PosFormat ));
 
-    valid->extra3 = table;
+    otvalid->extra3 = table;
 
     switch ( PosFormat )
     {
 
         OTV_TRACE(( " (PairSetCount = %d)\n", PairSetCount ));
 
-        otv_Coverage_validate( table + Coverage, valid, -1 );
+        otv_Coverage_validate( table + Coverage, otvalid, -1 );
 
         OTV_LIMIT_CHECK( PairSetCount * 2 );
 
         /* PairSetOffset */
         for ( ; PairSetCount > 0; PairSetCount-- )
           otv_PairSet_validate( table + FT_NEXT_USHORT( p ),
-                                ValueFormat1, ValueFormat2, valid );
+                                ValueFormat1, ValueFormat2, otvalid );
       }
       break;
 
         len_value1 = otv_value_length( ValueFormat1 );
         len_value2 = otv_value_length( ValueFormat2 );
 
-        otv_Coverage_validate( table + Coverage, valid, -1 );
-        otv_ClassDef_validate( table + ClassDef1, valid );
-        otv_ClassDef_validate( table + ClassDef2, valid );
+        otv_Coverage_validate( table + Coverage, otvalid, -1 );
+        otv_ClassDef_validate( table + ClassDef1, otvalid );
+        otv_ClassDef_validate( table + ClassDef2, otvalid );
 
         OTV_LIMIT_CHECK( ClassCount1 * ClassCount2 *
                      ( len_value1 + len_value2 ) );
           {
             if ( ValueFormat1 )
               /* Value1 */
-              otv_ValueRecord_validate( p, ValueFormat1, valid );
+              otv_ValueRecord_validate( p, ValueFormat1, otvalid );
             p += len_value1;
 
             if ( ValueFormat2 )
               /* Value2 */
-              otv_ValueRecord_validate( p, ValueFormat2, valid );
+              otv_ValueRecord_validate( p, ValueFormat2, otvalid );
             p += len_value2;
           }
         }
 
   static void
   otv_CursivePos_validate( FT_Bytes       table,
-                           OTV_Validator  valid )
+                           OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   PosFormat;
 
         OTV_TRACE(( " (EntryExitCount = %d)\n", EntryExitCount ));
 
-        otv_Coverage_validate( table + Coverage, valid, EntryExitCount );
+        otv_Coverage_validate( table + Coverage, otvalid, EntryExitCount );
 
         OTV_LIMIT_CHECK( EntryExitCount * 4 );
 
 
           OTV_SIZE_CHECK( EntryAnchor );
           if ( EntryAnchor )
-            otv_Anchor_validate( table + EntryAnchor, valid );
+            otv_Anchor_validate( table + EntryAnchor, otvalid );
 
           OTV_SIZE_CHECK( ExitAnchor );
           if ( ExitAnchor )
-            otv_Anchor_validate( table + ExitAnchor, valid );
+            otv_Anchor_validate( table + ExitAnchor, otvalid );
         }
       }
       break;
   /* UNDOCUMENTED (in OpenType 1.5):              */
   /* BaseRecord tables can contain NULL pointers. */
 
-  /* sets valid->extra2 (1) */
+  /* sets otvalid->extra2 (1) */
 
   static void
   otv_MarkBasePos_validate( FT_Bytes       table,
-                            OTV_Validator  valid )
+                            OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   PosFormat;
     switch ( PosFormat )
     {
     case 1:
-      valid->extra2 = 1;
+      otvalid->extra2 = 1;
       OTV_NEST2( MarkBasePosFormat1, BaseArray );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     default:
   /*************************************************************************/
   /*************************************************************************/
 
-  /* sets valid->extra2 (1) */
+  /* sets otvalid->extra2 (1) */
 
   static void
   otv_MarkLigPos_validate( FT_Bytes       table,
-                           OTV_Validator  valid )
+                           OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   PosFormat;
     switch ( PosFormat )
     {
     case 1:
-      valid->extra2 = 1;
+      otvalid->extra2 = 1;
       OTV_NEST3( MarkLigPosFormat1, LigatureArray, LigatureAttach );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     default:
   /*************************************************************************/
   /*************************************************************************/
 
-  /* sets valid->extra2 (0) */
+  /* sets otvalid->extra2 (0) */
 
   static void
   otv_MarkMarkPos_validate( FT_Bytes       table,
-                            OTV_Validator  valid )
+                            OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   PosFormat;
     switch ( PosFormat )
     {
     case 1:
-      valid->extra2 = 0;
+      otvalid->extra2 = 0;
       OTV_NEST2( MarkMarkPosFormat1, Mark2Array );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     default:
   /*************************************************************************/
   /*************************************************************************/
 
-  /* sets valid->extra1 (lookup count) */
+  /* sets otvalid->extra1 (lookup count) */
 
   static void
   otv_ContextPos_validate( FT_Bytes       table,
-                           OTV_Validator  valid )
+                           OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   PosFormat;
       /* context rules since even invalid glyph indices/classes return  */
       /* meaningful results                                             */
 
-      valid->extra1 = valid->lookup_count;
+      otvalid->extra1 = otvalid->lookup_count;
       OTV_NEST3( ContextPosFormat1, PosRuleSet, PosRule );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     case 2:
       /* meaningful results                                             */
 
       OTV_NEST3( ContextPosFormat2, PosClassSet, PosClassRule );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     case 3:
       OTV_NEST1( ContextPosFormat3 );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     default:
   /*************************************************************************/
   /*************************************************************************/
 
-  /* sets valid->extra1 (lookup count) */
+  /* sets otvalid->extra1 (lookup count) */
 
   static void
   otv_ChainContextPos_validate( FT_Bytes       table,
-                                OTV_Validator  valid )
+                                OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   PosFormat;
       /* context rules since even invalid glyph indices/classes return  */
       /* meaningful results                                             */
 
-      valid->extra1 = valid->lookup_count;
+      otvalid->extra1 = otvalid->lookup_count;
       OTV_NEST3( ChainContextPosFormat1,
                  ChainPosRuleSet, ChainPosRule );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     case 2:
 
       OTV_NEST3( ChainContextPosFormat2,
                  ChainPosClassSet, ChainPosClassRule );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     case 3:
       OTV_NEST1( ChainContextPosFormat3 );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     default:
   /*************************************************************************/
   /*************************************************************************/
 
-  /* uses valid->type_funcs */
+  /* uses otvalid->type_funcs */
 
   static void
   otv_ExtensionPos_validate( FT_Bytes       table,
-                             OTV_Validator  valid )
+                             OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   PosFormat;
         if ( ExtensionLookupType == 0 || ExtensionLookupType >= 9 )
           FT_INVALID_DATA;
 
-        validate = valid->type_funcs[ExtensionLookupType - 1];
-        validate( table + ExtensionOffset, valid );
+        validate = otvalid->type_funcs[ExtensionLookupType - 1];
+        validate( table + ExtensionOffset, otvalid );
       }
       break;
 
   };
 
 
-  /* sets valid->type_count */
-  /* sets valid->type_funcs */
+  /* sets otvalid->type_count */
+  /* sets otvalid->type_funcs */
 
   FT_LOCAL_DEF( void )
   otv_GPOS_subtable_validate( FT_Bytes       table,
-                              OTV_Validator  valid )
+                              OTV_Validator  otvalid )
   {
-    valid->type_count = 9;
-    valid->type_funcs = (OTV_Validate_Func*)otv_gpos_validate_funcs;
+    otvalid->type_count = 9;
+    otvalid->type_funcs = (OTV_Validate_Func*)otv_gpos_validate_funcs;
 
-    otv_Lookup_validate( table, valid );
+    otv_Lookup_validate( table, otvalid );
   }
 
 
   /*************************************************************************/
   /*************************************************************************/
 
-  /* sets valid->glyph_count */
+  /* sets otvalid->glyph_count */
 
   FT_LOCAL_DEF( void )
   otv_GPOS_validate( FT_Bytes      table,
                      FT_Validator  ftvalid )
   {
     OTV_ValidatorRec  validrec;
-    OTV_Validator     valid = &validrec;
+    OTV_Validator     otvalid = &validrec;
     FT_Bytes          p     = table;
     FT_UInt           ScriptList, FeatureList, LookupList;
 
 
-    valid->root = ftvalid;
+    otvalid->root = ftvalid;
 
     FT_TRACE3(( "validating GPOS table\n" ));
     OTV_INIT;
     FeatureList = FT_NEXT_USHORT( p );
     LookupList  = FT_NEXT_USHORT( p );
 
-    valid->type_count  = 9;
-    valid->type_funcs  = (OTV_Validate_Func*)otv_gpos_validate_funcs;
-    valid->glyph_count = glyph_count;
+    otvalid->type_count  = 9;
+    otvalid->type_funcs  = (OTV_Validate_Func*)otv_gpos_validate_funcs;
+    otvalid->glyph_count = glyph_count;
 
     otv_LookupList_validate( table + LookupList,
-                             valid );
+                             otvalid );
     otv_FeatureList_validate( table + FeatureList, table + LookupList,
-                              valid );
+                              otvalid );
     otv_ScriptList_validate( table + ScriptList, table + FeatureList,
-                             valid );
+                             otvalid );
 
     FT_TRACE4(( "\n" ));
   }
index ed499d1..024b8ca 100644 (file)
   /*************************************************************************/
   /*************************************************************************/
 
-  /* uses valid->glyph_count */
+  /* uses otvalid->glyph_count */
 
   static void
   otv_SingleSubst_validate( FT_Bytes       table,
-                            OTV_Validator  valid )
+                            OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   SubstFormat;
         Coverage     = table + FT_NEXT_USHORT( p );
         DeltaGlyphID = FT_NEXT_SHORT( p );
 
-        otv_Coverage_validate( Coverage, valid, -1 );
+        otv_Coverage_validate( Coverage, otvalid, -1 );
 
         idx = otv_Coverage_get_first( Coverage ) + DeltaGlyphID;
         if ( idx < 0 )
           FT_INVALID_DATA;
 
         idx = otv_Coverage_get_last( Coverage ) + DeltaGlyphID;
-        if ( (FT_UInt)idx >= valid->glyph_count )
+        if ( (FT_UInt)idx >= otvalid->glyph_count )
           FT_INVALID_DATA;
       }
       break;
 
         OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));
 
-        otv_Coverage_validate( table + Coverage, valid, GlyphCount );
+        otv_Coverage_validate( table + Coverage, otvalid, GlyphCount );
 
         OTV_LIMIT_CHECK( GlyphCount * 2 );
 
         /* Substitute */
         for ( ; GlyphCount > 0; GlyphCount-- )
-          if ( FT_NEXT_USHORT( p ) >= valid->glyph_count )
+          if ( FT_NEXT_USHORT( p ) >= otvalid->glyph_count )
             FT_INVALID_GLYPH_ID;
       }
       break;
   /*************************************************************************/
   /*************************************************************************/
 
-  /* sets valid->extra1 (glyph count) */
+  /* sets otvalid->extra1 (glyph count) */
 
   static void
   otv_MultipleSubst_validate( FT_Bytes       table,
-                              OTV_Validator  valid )
+                              OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   SubstFormat;
     switch ( SubstFormat )
     {
     case 1:
-      valid->extra1 = valid->glyph_count;
+      otvalid->extra1 = otvalid->glyph_count;
       OTV_NEST2( MultipleSubstFormat1, Sequence );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     default:
   /*************************************************************************/
   /*************************************************************************/
 
-  /* sets valid->extra1 (glyph count) */
+  /* sets otvalid->extra1 (glyph count) */
 
   static void
   otv_AlternateSubst_validate( FT_Bytes       table,
-                               OTV_Validator  valid )
+                               OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   SubstFormat;
     switch ( SubstFormat )
     {
     case 1:
-      valid->extra1 = valid->glyph_count;
+      otvalid->extra1 = otvalid->glyph_count;
       OTV_NEST2( AlternateSubstFormat1, AlternateSet );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     default:
 
 #define LigatureFunc  otv_Ligature_validate
 
-  /* uses valid->glyph_count */
+  /* uses otvalid->glyph_count */
 
   static void
   otv_Ligature_validate( FT_Bytes       table,
-                         OTV_Validator  valid )
+                         OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   LigatureGlyph, CompCount;
 
     OTV_LIMIT_CHECK( 4 );
     LigatureGlyph = FT_NEXT_USHORT( p );
-    if ( LigatureGlyph >= valid->glyph_count )
+    if ( LigatureGlyph >= otvalid->glyph_count )
       FT_INVALID_DATA;
 
     CompCount = FT_NEXT_USHORT( p );
 
   static void
   otv_LigatureSubst_validate( FT_Bytes       table,
-                              OTV_Validator  valid )
+                              OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   SubstFormat;
     {
     case 1:
       OTV_NEST3( LigatureSubstFormat1, LigatureSet, Ligature );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     default:
   /*************************************************************************/
   /*************************************************************************/
 
-  /* sets valid->extra1 (lookup count) */
+  /* sets otvalid->extra1 (lookup count) */
 
   static void
   otv_ContextSubst_validate( FT_Bytes       table,
-                             OTV_Validator  valid )
+                             OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   SubstFormat;
       /* context rules since even invalid glyph indices/classes return  */
       /* meaningful results                                             */
 
-      valid->extra1 = valid->lookup_count;
+      otvalid->extra1 = otvalid->lookup_count;
       OTV_NEST3( ContextSubstFormat1, SubRuleSet, SubRule );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     case 2:
       /* meaningful results                                             */
 
       OTV_NEST3( ContextSubstFormat2, SubClassSet, SubClassRule );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     case 3:
       OTV_NEST1( ContextSubstFormat3 );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     default:
   /*************************************************************************/
   /*************************************************************************/
 
-  /* sets valid->extra1 (lookup count)            */
+  /* sets otvalid->extra1 (lookup count)            */
 
   static void
   otv_ChainContextSubst_validate( FT_Bytes       table,
-                                  OTV_Validator  valid )
+                                  OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   SubstFormat;
       /* context rules since even invalid glyph indices/classes return  */
       /* meaningful results                                             */
 
-      valid->extra1 = valid->lookup_count;
+      otvalid->extra1 = otvalid->lookup_count;
       OTV_NEST3( ChainContextSubstFormat1,
                  ChainSubRuleSet, ChainSubRule );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     case 2:
 
       OTV_NEST3( ChainContextSubstFormat2,
                  ChainSubClassSet, ChainSubClassRule );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     case 3:
       OTV_NEST1( ChainContextSubstFormat3 );
-      OTV_RUN( table, valid );
+      OTV_RUN( table, otvalid );
       break;
 
     default:
   /*************************************************************************/
   /*************************************************************************/
 
-  /* uses valid->type_funcs */
+  /* uses otvalid->type_funcs */
 
   static void
   otv_ExtensionSubst_validate( FT_Bytes       table,
-                               OTV_Validator  valid )
+                               OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   SubstFormat;
              ExtensionLookupType > 8  )
           FT_INVALID_DATA;
 
-        validate = valid->type_funcs[ExtensionLookupType - 1];
-        validate( table + ExtensionOffset, valid );
+        validate = otvalid->type_funcs[ExtensionLookupType - 1];
+        validate( table + ExtensionOffset, otvalid );
       }
       break;
 
   /*************************************************************************/
   /*************************************************************************/
 
-  /* uses valid->glyph_count */
+  /* uses otvalid->glyph_count */
 
   static void
   otv_ReverseChainSingleSubst_validate( FT_Bytes       table,
-                                        OTV_Validator  valid )
+                                        OTV_Validator  otvalid )
   {
     FT_Bytes  p = table, Coverage;
     FT_UInt   SubstFormat;
 
       OTV_TRACE(( " (BacktrackGlyphCount = %d)\n", BacktrackGlyphCount ));
 
-      otv_Coverage_validate( Coverage, valid, -1 );
+      otv_Coverage_validate( Coverage, otvalid, -1 );
 
       OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 );
 
       for ( ; BacktrackGlyphCount > 0; BacktrackGlyphCount-- )
-        otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid, -1 );
+        otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );
 
       LookaheadGlyphCount = FT_NEXT_USHORT( p );
 
       OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 );
 
       for ( ; LookaheadGlyphCount > 0; LookaheadGlyphCount-- )
-        otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid, -1 );
+        otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );
 
       GlyphCount = FT_NEXT_USHORT( p );
 
 
       /* Substitute */
       for ( ; GlyphCount > 0; GlyphCount-- )
-        if ( FT_NEXT_USHORT( p ) >= valid->glyph_count )
+        if ( FT_NEXT_USHORT( p ) >= otvalid->glyph_count )
           FT_INVALID_DATA;
 
       break;
   /*************************************************************************/
   /*************************************************************************/
 
-  /* sets valid->type_count  */
-  /* sets valid->type_funcs  */
-  /* sets valid->glyph_count */
+  /* sets otvalid->type_count  */
+  /* sets otvalid->type_funcs  */
+  /* sets otvalid->glyph_count */
 
   FT_LOCAL_DEF( void )
   otv_GSUB_validate( FT_Bytes      table,
                      FT_UInt       glyph_count,
                      FT_Validator  ftvalid )
   {
-    OTV_ValidatorRec  validrec;
-    OTV_Validator     valid = &validrec;
-    FT_Bytes          p     = table;
+    OTV_ValidatorRec  otvalidrec;
+    OTV_Validator     otvalid = &otvalidrec;
+    FT_Bytes          p       = table;
     FT_UInt           ScriptList, FeatureList, LookupList;
 
 
-    valid->root = ftvalid;
+    otvalid->root = ftvalid;
 
     FT_TRACE3(( "validating GSUB table\n" ));
     OTV_INIT;
     FeatureList = FT_NEXT_USHORT( p );
     LookupList  = FT_NEXT_USHORT( p );
 
-    valid->type_count  = 8;
-    valid->type_funcs  = (OTV_Validate_Func*)otv_gsub_validate_funcs;
-    valid->glyph_count = glyph_count;
+    otvalid->type_count  = 8;
+    otvalid->type_funcs  = (OTV_Validate_Func*)otv_gsub_validate_funcs;
+    otvalid->glyph_count = glyph_count;
 
     otv_LookupList_validate( table + LookupList,
-                             valid );
+                             otvalid );
     otv_FeatureList_validate( table + FeatureList, table + LookupList,
-                              valid );
+                              otvalid );
     otv_ScriptList_validate( table + ScriptList, table + FeatureList,
-                             valid );
+                             otvalid );
 
     FT_TRACE4(( "\n" ));
   }
index a616a23..f273be8 100644 (file)
 #define JstfPriorityFunc  otv_JstfPriority_validate
 #define JstfLookupFunc    otv_GPOS_subtable_validate
 
-  /* uses valid->extra1 (GSUB lookup count) */
-  /* uses valid->extra2 (GPOS lookup count) */
-  /* sets valid->extra1 (counter)           */
+  /* uses otvalid->extra1 (GSUB lookup count) */
+  /* uses otvalid->extra2 (GPOS lookup count) */
+  /* sets otvalid->extra1 (counter)           */
 
   static void
   otv_JstfPriority_validate( FT_Bytes       table,
-                             OTV_Validator  valid )
+                             OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   table_size;
 
     OTV_LIMIT_CHECK( 20 );
 
-    gsub_lookup_count = valid->extra1;
-    gpos_lookup_count = valid->extra2;
+    gsub_lookup_count = otvalid->extra1;
+    gpos_lookup_count = otvalid->extra2;
 
     table_size = 20;
 
-    valid->extra1 = gsub_lookup_count;
+    otvalid->extra1 = gsub_lookup_count;
 
     OTV_OPTIONAL_OFFSET( ShrinkageEnableGSUB );
     OTV_SIZE_CHECK( ShrinkageEnableGSUB );
     if ( ShrinkageEnableGSUB )
-      otv_x_ux( table + ShrinkageEnableGSUB, valid );
+      otv_x_ux( table + ShrinkageEnableGSUB, otvalid );
 
     OTV_OPTIONAL_OFFSET( ShrinkageDisableGSUB );
     OTV_SIZE_CHECK( ShrinkageDisableGSUB );
     if ( ShrinkageDisableGSUB )
-      otv_x_ux( table + ShrinkageDisableGSUB, valid );
+      otv_x_ux( table + ShrinkageDisableGSUB, otvalid );
 
-    valid->extra1 = gpos_lookup_count;
+    otvalid->extra1 = gpos_lookup_count;
 
     OTV_OPTIONAL_OFFSET( ShrinkageEnableGPOS );
     OTV_SIZE_CHECK( ShrinkageEnableGPOS );
     if ( ShrinkageEnableGPOS )
-      otv_x_ux( table + ShrinkageEnableGPOS, valid );
+      otv_x_ux( table + ShrinkageEnableGPOS, otvalid );
 
     OTV_OPTIONAL_OFFSET( ShrinkageDisableGPOS );
     OTV_SIZE_CHECK( ShrinkageDisableGPOS );
     if ( ShrinkageDisableGPOS )
-      otv_x_ux( table + ShrinkageDisableGPOS, valid );
+      otv_x_ux( table + ShrinkageDisableGPOS, otvalid );
 
     OTV_OPTIONAL_OFFSET( ShrinkageJstfMax );
     OTV_SIZE_CHECK( ShrinkageJstfMax );
     {
       /* XXX: check lookup types? */
       OTV_NEST2( JstfMax, JstfLookup );
-      OTV_RUN( table + ShrinkageJstfMax, valid );
+      OTV_RUN( table + ShrinkageJstfMax, otvalid );
     }
 
-    valid->extra1 = gsub_lookup_count;
+    otvalid->extra1 = gsub_lookup_count;
 
     OTV_OPTIONAL_OFFSET( ExtensionEnableGSUB );
     OTV_SIZE_CHECK( ExtensionEnableGSUB );
     if ( ExtensionEnableGSUB )
-      otv_x_ux( table + ExtensionEnableGSUB, valid );
+      otv_x_ux( table + ExtensionEnableGSUB, otvalid );
 
     OTV_OPTIONAL_OFFSET( ExtensionDisableGSUB );
     OTV_SIZE_CHECK( ExtensionDisableGSUB );
     if ( ExtensionDisableGSUB )
-      otv_x_ux( table + ExtensionDisableGSUB, valid );
+      otv_x_ux( table + ExtensionDisableGSUB, otvalid );
 
-    valid->extra1 = gpos_lookup_count;
+    otvalid->extra1 = gpos_lookup_count;
 
     OTV_OPTIONAL_OFFSET( ExtensionEnableGPOS );
     OTV_SIZE_CHECK( ExtensionEnableGPOS );
     if ( ExtensionEnableGPOS )
-      otv_x_ux( table + ExtensionEnableGPOS, valid );
+      otv_x_ux( table + ExtensionEnableGPOS, otvalid );
 
     OTV_OPTIONAL_OFFSET( ExtensionDisableGPOS );
     OTV_SIZE_CHECK( ExtensionDisableGPOS );
     if ( ExtensionDisableGPOS )
-      otv_x_ux( table + ExtensionDisableGPOS, valid );
+      otv_x_ux( table + ExtensionDisableGPOS, otvalid );
 
     OTV_OPTIONAL_OFFSET( ExtensionJstfMax );
     OTV_SIZE_CHECK( ExtensionJstfMax );
     {
       /* XXX: check lookup types? */
       OTV_NEST2( JstfMax, JstfLookup );
-      OTV_RUN( table + ExtensionJstfMax, valid );
+      OTV_RUN( table + ExtensionJstfMax, otvalid );
     }
 
-    valid->extra1 = gsub_lookup_count;
-    valid->extra2 = gpos_lookup_count;
+    otvalid->extra1 = gsub_lookup_count;
+    otvalid->extra2 = gpos_lookup_count;
 
     OTV_EXIT;
   }
 
 
-  /* sets valid->extra (glyph count)               */
-  /* sets valid->func1 (otv_JstfPriority_validate) */
+  /* sets otvalid->extra (glyph count)               */
+  /* sets otvalid->func1 (otv_JstfPriority_validate) */
 
   static void
   otv_JstfScript_validate( FT_Bytes       table,
-                           OTV_Validator  valid )
+                           OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   table_size;
     OTV_SIZE_CHECK( ExtGlyph );
     if ( ExtGlyph )
     {
-      valid->extra1 = valid->glyph_count;
+      otvalid->extra1 = otvalid->glyph_count;
       OTV_NEST1( ExtenderGlyph );
-      OTV_RUN( table + ExtGlyph, valid );
+      OTV_RUN( table + ExtGlyph, otvalid );
     }
 
     OTV_SIZE_CHECK( DefJstfLangSys );
     if ( DefJstfLangSys )
     {
       OTV_NEST2( JstfLangSys, JstfPriority );
-      OTV_RUN( table + DefJstfLangSys, valid );
+      OTV_RUN( table + DefJstfLangSys, otvalid );
     }
 
     OTV_LIMIT_CHECK( 6 * JstfLangSysCount );
     {
       p += 4;       /* skip JstfLangSysTag */
 
-      OTV_RUN( table + FT_NEXT_USHORT( p ), valid );
+      OTV_RUN( table + FT_NEXT_USHORT( p ), otvalid );
     }
 
     OTV_EXIT;
   }
 
 
-  /* sets valid->extra1 (GSUB lookup count) */
-  /* sets valid->extra2 (GPOS lookup count) */
-  /* sets valid->glyph_count                */
+  /* sets otvalid->extra1 (GSUB lookup count) */
+  /* sets otvalid->extra2 (GPOS lookup count) */
+  /* sets otvalid->glyph_count                */
 
   FT_LOCAL_DEF( void )
   otv_JSTF_validate( FT_Bytes      table,
                      FT_UInt       glyph_count,
                      FT_Validator  ftvalid )
   {
-    OTV_ValidatorRec  validrec;
-    OTV_Validator     valid = &validrec;
+    OTV_ValidatorRec  otvalidrec;
+    OTV_Validator     otvalid = &otvalidrec;
     FT_Bytes          p     = table;
     FT_UInt           JstfScriptCount;
 
 
-    valid->root = ftvalid;
+    otvalid->root = ftvalid;
+
 
     FT_TRACE3(( "validating JSTF table\n" ));
     OTV_INIT;
     OTV_LIMIT_CHECK( JstfScriptCount * 6 );
 
     if ( gsub )
-      valid->extra1 = otv_GSUBGPOS_get_Lookup_count( gsub );
+      otvalid->extra1 = otv_GSUBGPOS_get_Lookup_count( gsub );
     else
-      valid->extra1 = 0;
+      otvalid->extra1 = 0;
 
     if ( gpos )
-      valid->extra2 = otv_GSUBGPOS_get_Lookup_count( gpos );
+      otvalid->extra2 = otv_GSUBGPOS_get_Lookup_count( gpos );
     else
-      valid->extra2 = 0;
+      otvalid->extra2 = 0;
 
-    valid->glyph_count = glyph_count;
+    otvalid->glyph_count = glyph_count;
 
     /* JstfScriptRecord */
     for ( ; JstfScriptCount > 0; JstfScriptCount-- )
       p += 4;       /* skip JstfScriptTag */
 
       /* JstfScript */
-      otv_JstfScript_validate( table + FT_NEXT_USHORT( p ), valid );
+      otv_JstfScript_validate( table + FT_NEXT_USHORT( p ), otvalid );
     }
 
     FT_TRACE4(( "\n" ));
index 96f841f..d1791f8 100644 (file)
@@ -44,7 +44,7 @@
 
   static void
   otv_MathConstants_validate( FT_Bytes       table,
-                              OTV_Validator  valid )
+                              OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   i;
@@ -66,7 +66,7 @@
       OTV_OPTIONAL_OFFSET( DeviceTableOffset );
       OTV_SIZE_CHECK( DeviceTableOffset );
       if ( DeviceTableOffset )
-        otv_Device_validate( table + DeviceTableOffset, valid );
+        otv_Device_validate( table + DeviceTableOffset, otvalid );
     }
 
     OTV_EXIT;
@@ -84,7 +84,7 @@
 
   static void
   otv_MathItalicsCorrectionInfo_validate( FT_Bytes       table,
-                                          OTV_Validator  valid,
+                                          OTV_Validator  otvalid,
                                           FT_Int         isItalic )
   {
     FT_Bytes  p = table;
     table_size = 4 + 4 * cnt;
 
     OTV_SIZE_CHECK( Coverage );
-    otv_Coverage_validate( table + Coverage, valid, cnt );
+    otv_Coverage_validate( table + Coverage, otvalid, cnt );
 
     for ( i = 0; i < cnt; ++i )
     {
       OTV_OPTIONAL_OFFSET( DeviceTableOffset );
       OTV_SIZE_CHECK( DeviceTableOffset );
       if ( DeviceTableOffset )
-        otv_Device_validate( table + DeviceTableOffset, valid );
+        otv_Device_validate( table + DeviceTableOffset, otvalid );
     }
 
     OTV_EXIT;
 
   static void
   otv_MathKern_validate( FT_Bytes       table,
-                         OTV_Validator  valid )
+                         OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   i, cnt, table_size;
       OTV_OPTIONAL_OFFSET( DeviceTableOffset );
       OTV_SIZE_CHECK( DeviceTableOffset );
       if ( DeviceTableOffset )
-        otv_Device_validate( table + DeviceTableOffset, valid );
+        otv_Device_validate( table + DeviceTableOffset, otvalid );
     }
 
     /* One more Kerning value */
       OTV_OPTIONAL_OFFSET( DeviceTableOffset );
       OTV_SIZE_CHECK( DeviceTableOffset );
       if ( DeviceTableOffset )
-        otv_Device_validate( table + DeviceTableOffset, valid );
+        otv_Device_validate( table + DeviceTableOffset, otvalid );
     }
 
     OTV_EXIT;
 
   static void
   otv_MathKernInfo_validate( FT_Bytes       table,
-                             OTV_Validator  valid )
+                             OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   i, j, cnt, table_size;
     table_size = 4 + 8 * cnt;
 
     OTV_SIZE_CHECK( Coverage );
-    otv_Coverage_validate( table + Coverage, valid, cnt );
+    otv_Coverage_validate( table + Coverage, otvalid, cnt );
 
     for ( i = 0; i < cnt; ++i )
     {
         OTV_OPTIONAL_OFFSET( MKRecordOffset );
         OTV_SIZE_CHECK( MKRecordOffset );
         if ( MKRecordOffset )
-          otv_MathKern_validate( table + MKRecordOffset, valid );
+          otv_MathKern_validate( table + MKRecordOffset, otvalid );
       }
     }
 
 
   static void
   otv_MathGlyphInfo_validate( FT_Bytes       table,
-                              OTV_Validator  valid )
+                              OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   MathItalicsCorrectionInfo, MathTopAccentAttachment;
 
     if ( MathItalicsCorrectionInfo )
       otv_MathItalicsCorrectionInfo_validate(
-        table + MathItalicsCorrectionInfo, valid, TRUE );
+        table + MathItalicsCorrectionInfo, otvalid, TRUE );
 
     /* Italic correction and Top Accent Attachment have the same format */
     if ( MathTopAccentAttachment )
       otv_MathItalicsCorrectionInfo_validate(
-        table + MathTopAccentAttachment, valid, FALSE );
+        table + MathTopAccentAttachment, otvalid, FALSE );
 
     if ( ExtendedShapeCoverage )
     {
       OTV_NAME_ENTER( "ExtendedShapeCoverage" );
-      otv_Coverage_validate( table + ExtendedShapeCoverage, valid, -1 );
+      otv_Coverage_validate( table + ExtendedShapeCoverage, otvalid, -1 );
       OTV_EXIT;
     }
 
     if ( MathKernInfo )
-      otv_MathKernInfo_validate( table + MathKernInfo, valid );
+      otv_MathKernInfo_validate( table + MathKernInfo, otvalid );
 
     OTV_EXIT;
   }
 
   static void
   otv_GlyphAssembly_validate( FT_Bytes       table,
-                              OTV_Validator  valid )
+                              OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   pcnt, table_size;
 
     OTV_SIZE_CHECK( DeviceTableOffset );
     if ( DeviceTableOffset )
-      otv_Device_validate( table + DeviceTableOffset, valid );
+      otv_Device_validate( table + DeviceTableOffset, otvalid );
 
     for ( i = 0; i < pcnt; ++i )
     {
 
 
       gid = FT_NEXT_USHORT( p );
-      if ( gid >= valid->glyph_count )
+      if ( gid >= otvalid->glyph_count )
         FT_INVALID_GLYPH_ID;
       p += 2*4;             /* skip the Start, End, Full, and Flags fields */
     }
 
   static void
   otv_MathGlyphConstruction_validate( FT_Bytes       table,
-                                      OTV_Validator  valid )
+                                      OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   vcnt, table_size;
 
 
       gid = FT_NEXT_USHORT( p );
-      if ( gid >= valid->glyph_count )
+      if ( gid >= otvalid->glyph_count )
         FT_INVALID_GLYPH_ID;
       p += 2;                          /* skip the size */
     }
 
     OTV_SIZE_CHECK( GlyphAssembly );
     if ( GlyphAssembly )
-      otv_GlyphAssembly_validate( table+GlyphAssembly, valid );
+      otv_GlyphAssembly_validate( table+GlyphAssembly, otvalid );
 
     /* OTV_EXIT; */
   }
 
   static void
   otv_MathVariants_validate( FT_Bytes       table,
-                             OTV_Validator  valid )
+                             OTV_Validator  otvalid )
   {
     FT_Bytes  p = table;
     FT_UInt   vcnt, hcnt, i, table_size;
 
     OTV_SIZE_CHECK( VCoverage );
     if ( VCoverage )
-      otv_Coverage_validate( table + VCoverage, valid, vcnt );
+      otv_Coverage_validate( table + VCoverage, otvalid, vcnt );
 
     OTV_SIZE_CHECK( HCoverage );
     if ( HCoverage )
-      otv_Coverage_validate( table + HCoverage, valid, hcnt );
+      otv_Coverage_validate( table + HCoverage, otvalid, hcnt );
 
     for ( i = 0; i < vcnt; ++i )
     {
       OTV_OPTIONAL_OFFSET( Offset );
       OTV_SIZE_CHECK( Offset );
-      otv_MathGlyphConstruction_validate( table + Offset, valid );
+      otv_MathGlyphConstruction_validate( table + Offset, otvalid );
     }
 
     for ( i = 0; i < hcnt; ++i )
     {
       OTV_OPTIONAL_OFFSET( Offset );
       OTV_SIZE_CHECK( Offset );
-      otv_MathGlyphConstruction_validate( table + Offset, valid );
+      otv_MathGlyphConstruction_validate( table + Offset, otvalid );
     }
 
     OTV_EXIT;
   /*************************************************************************/
   /*************************************************************************/
 
-  /* sets valid->glyph_count */
+  /* sets otvalid->glyph_count */
 
   FT_LOCAL_DEF( void )
   otv_MATH_validate( FT_Bytes      table,
                      FT_UInt       glyph_count,
                      FT_Validator  ftvalid )
   {
-    OTV_ValidatorRec  validrec;
-    OTV_Validator     valid = &validrec;
-    FT_Bytes          p     = table;
+    OTV_ValidatorRec  otvalidrec;
+    OTV_Validator     otvalid = &otvalidrec;
+    FT_Bytes          p       = table;
     FT_UInt           MathConstants, MathGlyphInfo, MathVariants;
 
 
-    valid->root = ftvalid;
+    otvalid->root = ftvalid;
 
     FT_TRACE3(( "validating MATH table\n" ));
     OTV_INIT;
     MathGlyphInfo = FT_NEXT_USHORT( p );
     MathVariants  = FT_NEXT_USHORT( p );
 
-    valid->glyph_count = glyph_count;
+    otvalid->glyph_count = glyph_count;
 
     otv_MathConstants_validate( table + MathConstants,
-                                valid );
+                                otvalid );
     otv_MathGlyphInfo_validate( table + MathGlyphInfo,
-                                valid );
+                                otvalid );
     otv_MathVariants_validate ( table + MathVariants,
-                                valid );
+                                otvalid );
 
     FT_TRACE4(( "\n" ));
   }
index acf213f..37c6e86 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -49,8 +49,8 @@
 
 
     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;
 
@@ -73,7 +73,7 @@
                 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;
index 8858d68..10eff15 100644 (file)
@@ -33,7 +33,7 @@ Encodings
 
 Use `FT_Get_BDF_Charset_ID' to access the encoding and registry.
 
-The driver always exports `ft_encoding_none' as face->charmap.encoding. 
+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.
 
index ba54488..96f6912 100644 (file)
@@ -2,7 +2,7 @@
 
     FreeType font driver for pcf files
 
-    Copyright (C) 2000-2004, 2006-2011 by
+    Copyright (C) 2000-2004, 2006-2011, 2013, 2014 by
     Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -83,7 +83,7 @@ THE SOFTWARE.
     cmap->num_encodings = (FT_UInt)face->nencodings;
     cmap->encodings     = face->encodings;
 
-    return PCF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
@@ -189,7 +189,7 @@ THE SOFTWARE.
   }
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FT_CMap_ClassRec  pcf_cmap_class =
   {
     sizeof ( PCF_CMapRec ),
@@ -218,25 +218,24 @@ THE SOFTWARE.
     FT_FREE( face->metrics );
 
     /* free properties */
+    if ( face->properties )
     {
-      PCF_Property  prop;
-      FT_Int        i;
+      FT_Int  i;
 
 
-      if ( face->properties )
+      for ( i = 0; i < face->nprops; i++ )
       {
-        for ( i = 0; i < face->nprops; i++ )
+        PCF_Property  prop = &face->properties[i];
+
+
+        if ( prop )
         {
-          prop = &face->properties[i];
-
-          if ( prop )
-          {
-            FT_FREE( prop->name );
-            if ( prop->isString )
-              FT_FREE( prop->value.atom );
-          }
+          FT_FREE( prop->name );
+          if ( prop->isString )
+            FT_FREE( prop->value.atom );
         }
       }
+
       FT_FREE( face->properties );
     }
 
@@ -264,11 +263,10 @@ THE SOFTWARE.
                  FT_Parameter*  params )
   {
     PCF_Face  face  = (PCF_Face)pcfface;
-    FT_Error  error = PCF_Err_Ok;
+    FT_Error  error;
 
     FT_UNUSED( num_params );
     FT_UNUSED( params );
-    FT_UNUSED( face_index );
 
 
     FT_TRACE2(( "PCF driver\n" ));
@@ -289,7 +287,7 @@ THE SOFTWARE.
 
         /* this didn't work, try gzip support! */
         error2 = FT_Stream_OpenGzip( &face->comp_stream, stream );
-        if ( FT_ERROR_BASE( error2 ) == FT_Err_Unimplemented_Feature )
+        if ( FT_ERR_EQ( error2, Unimplemented_Feature ) )
           goto Fail;
 
         error = error2;
@@ -304,7 +302,7 @@ THE SOFTWARE.
 
         /* this didn't work, try LZW support! */
         error3 = FT_Stream_OpenLZW( &face->comp_stream, stream );
-        if ( FT_ERROR_BASE( error3 ) == FT_Err_Unimplemented_Feature )
+        if ( FT_ERR_EQ( error3, Unimplemented_Feature ) )
           goto Fail;
 
         error = error3;
@@ -319,7 +317,7 @@ THE SOFTWARE.
 
         /* this didn't work, try Bzip2 support! */
         error4 = FT_Stream_OpenBzip2( &face->comp_stream, stream );
-        if ( FT_ERROR_BASE( error4 ) == FT_Err_Unimplemented_Feature )
+        if ( FT_ERR_EQ( error4, Unimplemented_Feature ) )
           goto Fail;
 
         error = error4;
@@ -347,6 +345,18 @@ THE SOFTWARE.
 #endif
     }
 
+    /* PCF could not have multiple face in single font file.
+     * XXX: non-zero face_index is already invalid argument, but
+     *      Type1, Type42 driver has a convention to return
+     *      an invalid argument error when the font could be
+     *      opened by the specified driver.
+     */
+    if ( face_index > 0 ) {
+      FT_ERROR(( "PCF_Face_Init: invalid face index\n" ));
+      PCF_Face_Done( pcfface );
+      return FT_THROW( Invalid_Argument );
+    }
+
     /* set up charmap */
     {
       FT_String  *charset_registry = face->charset_registry;
@@ -406,7 +416,7 @@ THE SOFTWARE.
   Fail:
     FT_TRACE2(( "  not a PCF file\n" ));
     PCF_Face_Done( pcfface );
-    error = PCF_Err_Unknown_File_Format;  /* error */
+    error = FT_THROW( Unknown_File_Format );  /* error */
     goto Exit;
   }
 
@@ -424,7 +434,7 @@ THE SOFTWARE.
     size->metrics.descender   = -accel->fontDescent << 6;
     size->metrics.max_advance =  accel->maxbounds.characterWidth << 6;
 
-    return PCF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
@@ -434,7 +444,7 @@ THE SOFTWARE.
   {
     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;
 
 
@@ -445,17 +455,17 @@ THE SOFTWARE.
     {
     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 ) )
-        error = PCF_Err_Ok;
+        error = FT_Err_Ok;
       break;
 
     default:
-      error = PCF_Err_Unimplemented_Feature;
+      error = FT_THROW( Unimplemented_Feature );
       break;
     }
 
@@ -474,7 +484,7 @@ THE SOFTWARE.
   {
     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;
@@ -482,11 +492,17 @@ THE SOFTWARE.
     FT_UNUSED( load_flags );
 
 
-    FT_TRACE4(( "load_glyph %d ---", glyph_index ));
+    FT_TRACE1(( "PCF_Glyph_Load: glyph index %d\n", glyph_index ));
 
-    if ( !face || glyph_index >= (FT_UInt)face->root.num_glyphs )
+    if ( !face )
     {
-      error = PCF_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Face_Handle );
+      goto Exit;
+    }
+
+    if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
+    {
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
@@ -526,13 +542,13 @@ THE SOFTWARE.
       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;
 
-    error = ft_glyphslot_alloc_bitmap( slot, bytes );
+    error = ft_glyphslot_alloc_bitmap( slot, (FT_ULong)bytes );
     if ( error )
       goto Exit;
 
@@ -576,8 +592,6 @@ THE SOFTWARE.
                                     ( face->accel.fontAscent +
                                       face->accel.fontDescent ) << 6 );
 
-    FT_TRACE4(( " --- ok\n" ));
-
   Exit:
     return error;
   }
@@ -622,7 +636,7 @@ THE SOFTWARE.
       return 0;
     }
 
-    return PCF_Err_Invalid_Argument;
+    return FT_THROW( Invalid_Argument );
   }
 
 
@@ -699,10 +713,6 @@ THE SOFTWARE.
     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  */
index d9914c0..a29a9e3 100644 (file)
@@ -2,7 +2,7 @@
 
     FreeType font driver for pcf fonts
 
-  Copyright 2000-2010, 2012 by
+  Copyright 2000-2010, 2012-2014 by
   Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -78,7 +78,7 @@ THE SOFTWARE.
     FT_FRAME_START( 16  ),
       FT_FRAME_ULONG_LE( type ),
       FT_FRAME_ULONG_LE( format ),
-      FT_FRAME_ULONG_LE( size ),
+      FT_FRAME_ULONG_LE( size ),   /* rounded up to a multiple of 4 */
       FT_FRAME_ULONG_LE( offset ),
     FT_FRAME_END
   };
@@ -92,21 +92,23 @@ THE SOFTWARE.
     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;
 
+    FT_ULong   size;
 
-    if ( FT_STREAM_SEEK ( 0 )                          ||
-         FT_STREAM_READ_FIELDS ( pcf_toc_header, toc ) )
-      return PCF_Err_Cannot_Open_Resource;
+
+    if ( FT_STREAM_SEEK( 0 )                          ||
+         FT_STREAM_READ_FIELDS( pcf_toc_header, toc ) )
+      return FT_THROW( Cannot_Open_Resource );
 
     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 ) )
-      return PCF_Err_Out_Of_Memory;
+      return FT_THROW( Out_Of_Memory );
 
     tables = face->toc.tables;
     for ( n = 0; n < toc->count; n++ )
@@ -144,13 +146,62 @@ THE SOFTWARE.
 
         if ( ( tables[i].size   > tables[i + 1].offset )                  ||
              ( tables[i].offset > tables[i + 1].offset - tables[i].size ) )
-          return PCF_Err_Invalid_Offset;
+        {
+          error = FT_THROW( Invalid_Offset );
+          goto Exit;
+        }
       }
 
       if ( !have_change )
         break;
     }
 
+    /*
+     *  We now check whether the `size' and `offset' values are reasonable:
+     *  `offset' + `size' must not exceed the stream size.
+     *
+     *  Note, however, that X11's `pcfWriteFont' routine (used by the
+     *  `bdftopcf' program to create PDF font files) has two special
+     *  features.
+     *
+     *  - It always assigns the accelerator table a size of 100 bytes in the
+     *    TOC, regardless of its real size, which can vary between 34 and 72
+     *    bytes.
+     *
+     *  - Due to the way the routine is designed, it ships out the last font
+     *    table with its real size, ignoring the TOC's size value.  Since
+     *    the TOC size values are always rounded up to a multiple of 4, the
+     *    difference can be up to three bytes for all tables except the
+     *    accelerator table, for which the difference can be as large as 66
+     *    bytes.
+     *
+     */
+
+    tables = face->toc.tables;
+    size   = stream->size;
+
+    for ( n = 0; n < toc->count - 1; n++ )
+    {
+      /* we need two checks to avoid overflow */
+      if ( ( tables->size   > size                ) ||
+           ( tables->offset > size - tables->size ) )
+      {
+        error = FT_THROW( Invalid_Table );
+        goto Exit;
+      }
+      tables++;
+    }
+
+    /* only check `tables->offset' for last table element ... */
+    if ( ( tables->offset > size ) )
+    {
+      error = FT_THROW( Invalid_Table );
+      goto Exit;
+    }
+    /* ... and adjust `tables->size' to the real value if necessary */
+    if ( tables->size > size - tables->offset )
+      tables->size = size - tables->offset;
+
 #ifdef FT_DEBUG_LEVEL_TRACE
 
     {
@@ -181,7 +232,7 @@ THE SOFTWARE.
 
 #endif
 
-    return PCF_Err_Ok;
+    return FT_Err_Ok;
 
   Exit:
     FT_FREE( face->toc.tables );
@@ -248,7 +299,7 @@ THE SOFTWARE.
                   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 ) )
@@ -294,7 +345,7 @@ THE SOFTWARE.
                           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;
 
 
@@ -303,20 +354,20 @@ THE SOFTWARE.
       {
         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 ) )
         {
-          error = PCF_Err_Invalid_Stream_Skip;
+          error = FT_THROW( Invalid_Stream_Skip );
           goto Fail;
         }
 
         *asize   = tables[i].size;
         *aformat = tables[i].format;
 
-        return PCF_Err_Ok;
+        return FT_Err_Ok;
       }
 
   Fail:
@@ -402,7 +453,7 @@ THE SOFTWARE.
     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;
 
@@ -441,7 +492,7 @@ THE SOFTWARE.
     /* rough estimate */
     if ( nprops > size / PCF_PROPERTY_SIZE )
     {
-      error = PCF_Err_Invalid_Table;
+      error = FT_THROW( Invalid_Table );
       goto Bail;
     }
 
@@ -474,7 +525,7 @@ THE SOFTWARE.
       i = 4 - ( nprops & 3 );
       if ( FT_STREAM_SKIP( i ) )
       {
-        error = PCF_Err_Invalid_Stream_Skip;
+        error = FT_THROW( Invalid_Stream_Skip );
         goto Bail;
       }
     }
@@ -491,7 +542,7 @@ THE SOFTWARE.
     /* rough estimate */
     if ( string_size > size - nprops * PCF_PROPERTY_SIZE )
     {
-      error = PCF_Err_Invalid_Table;
+      error = FT_THROW( Invalid_Table );
       goto Bail;
     }
 
@@ -516,7 +567,7 @@ THE SOFTWARE.
       if ( ( name_offset < 0 )                     ||
            ( (FT_ULong)name_offset > string_size ) )
       {
-        error = PCF_Err_Invalid_Offset;
+        error = FT_THROW( Invalid_Offset );
         goto Bail;
       }
 
@@ -535,7 +586,7 @@ THE SOFTWARE.
         if ( ( value_offset < 0 )                     ||
              ( (FT_ULong)value_offset > string_size ) )
         {
-          error = PCF_Err_Invalid_Offset;
+          error = FT_THROW( Invalid_Offset );
           goto Bail;
         }
 
@@ -552,7 +603,7 @@ THE SOFTWARE.
       }
     }
 
-    error = PCF_Err_Ok;
+    error = FT_Err_Ok;
 
   Bail:
     FT_FREE( props );
@@ -566,10 +617,10 @@ THE SOFTWARE.
   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;
-    PCF_Metric  metrics  = 0;
+    PCF_Metric  metrics = 0;
     FT_ULong    nmetrics, i;
 
 
@@ -587,7 +638,7 @@ THE SOFTWARE.
 
     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 ) )
     {
@@ -604,12 +655,12 @@ THE SOFTWARE.
         (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 )
-      return PCF_Err_Invalid_Table;
+      return FT_THROW( Invalid_Table );
 
     FT_TRACE4(( "pcf_get_metrics:\n" ));
 
@@ -619,36 +670,52 @@ THE SOFTWARE.
     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 )
-        return PCF_Err_Invalid_Table;
+        return FT_THROW( Invalid_Table );
     }
 
     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++ )
+    for ( i = 0; i < nmetrics; i++, metrics++ )
     {
-      error = pcf_get_metric( stream, format, metrics + i );
+      error = pcf_get_metric( stream, format, metrics );
 
-      metrics[i].bits = 0;
+      metrics->bits = 0;
 
       FT_TRACE5(( "  idx %d: width=%d, "
                   "lsb=%d, rsb=%d, ascent=%d, descent=%d, swidth=%d\n",
                   i,
-                  ( metrics + i )->characterWidth,
-                  ( metrics + i )->leftSideBearing,
-                  ( metrics + i )->rightSideBearing,
-                  ( metrics + i )->ascent,
-                  ( metrics + i )->descent,
-                  ( metrics + i )->attributes ));
+                  metrics->characterWidth,
+                  metrics->leftSideBearing,
+                  metrics->rightSideBearing,
+                  metrics->ascent,
+                  metrics->descent,
+                  metrics->attributes ));
 
       if ( error )
         break;
+
+      /* sanity checks -- those values are used in `PCF_Glyph_Load' to     */
+      /* compute a glyph's bitmap dimensions, thus setting them to zero in */
+      /* case of an error disables this particular glyph only              */
+      if ( metrics->rightSideBearing < metrics->leftSideBearing ||
+           metrics->ascent + metrics->descent < 0               )
+      {
+        metrics->characterWidth   = 0;
+        metrics->leftSideBearing  = 0;
+        metrics->rightSideBearing = 0;
+        metrics->ascent           = 0;
+        metrics->descent          = 0;
+
+        FT_TRACE0(( "pcf_get_metrics:"
+                    " invalid metrics for glyph %d\n", i ));
+      }
     }
 
     if ( error )
@@ -663,8 +730,8 @@ THE SOFTWARE.
   pcf_get_bitmaps( 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_Long*   offsets = NULL;
     FT_Long    bitmapSizes[GLYPHPADOPTIONS];
     FT_ULong   format, size;
@@ -693,15 +760,15 @@ THE SOFTWARE.
     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(( "  number of bitmaps: %d\n", nbitmaps ));
 
-    /* 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;
+    /* XXX: PCF_Face->nmetrics is signed FT_Long, see pcf.h */
+    if ( face->nmetrics < 0 || nbitmaps != (FT_ULong)face->nmetrics )
+      return FT_THROW( Invalid_File_Format );
 
     if ( FT_NEW_ARRAY( offsets, nbitmaps ) )
       return error;
@@ -765,14 +832,14 @@ THE SOFTWARE.
   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;
-    int           i, j;
-    PCF_Encoding  tmpEncoding = NULL, encoding = 0;
+    int           i, j, k;
+    PCF_Encoding  encoding = NULL;
 
 
     error = pcf_seek_to_table_type( stream,
@@ -810,7 +877,16 @@ THE SOFTWARE.
     FT_Stream_ExitFrame( stream );
 
     if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
-      return PCF_Err_Invalid_File_Format;
+      return FT_THROW( Invalid_File_Format );
+
+    /* sanity checks */
+    if ( firstCol < 0       ||
+         firstCol > lastCol ||
+         lastCol  > 0xFF    ||
+         firstRow < 0       ||
+         firstRow > lastRow ||
+         lastRow  > 0xFF    )
+      return FT_THROW( Invalid_Table );
 
     FT_TRACE4(( "pdf_get_encodings:\n" ));
 
@@ -819,56 +895,47 @@ THE SOFTWARE.
 
     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;
 
-    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 );
 
-    if ( FT_NEW_ARRAY( encoding, j ) )
+    if ( FT_RENEW_ARRAY( encoding, nencoding, k ) )
       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;
-    FT_FREE( tmpEncoding );
 
     return error;
 
   Bail:
     FT_FREE( encoding );
-    FT_FREE( tmpEncoding );
     return error;
   }
 
@@ -923,7 +990,7 @@ THE SOFTWARE.
                  FT_ULong   type )
   {
     FT_ULong   format, size;
-    FT_Error   error = PCF_Err_Ok;
+    FT_Error   error;
     PCF_Accel  accel = &face->accel;
 
 
@@ -994,7 +1061,7 @@ THE SOFTWARE.
   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;
 
@@ -1023,20 +1090,20 @@ THE SOFTWARE.
          ( *(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' ) )
-      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' ) )
-      strings[0] = (char *)(prop->value.atom);
+      strings[0] = (char*)( prop->value.atom );
 
     for ( len = 0, nn = 0; nn < 4; nn++ )
     {
@@ -1050,7 +1117,7 @@ THE SOFTWARE.
 
     if ( len == 0 )
     {
-      strings[0] = (char *)"Regular";
+      strings[0] = (char*)"Regular";
       lengths[0] = ft_strlen( strings[0] );
       len        = lengths[0] + 1;
     }
@@ -1088,7 +1155,7 @@ THE SOFTWARE.
 
 
           for ( mm = 0; mm < len; mm++ )
-            if (s[mm] == ' ')
+            if ( s[mm] == ' ' )
               s[mm] = '-';
         }
 
@@ -1105,8 +1172,8 @@ THE SOFTWARE.
   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_Memory  memory = FT_FACE( face )->memory;
     FT_Bool    hasBDFAccelerators;
 
 
@@ -1162,9 +1229,10 @@ THE SOFTWARE.
 
       root->num_faces  = 1;
       root->face_index = 0;
-      root->face_flags = FT_FACE_FLAG_FIXED_SIZES |
-                         FT_FACE_FLAG_HORIZONTAL  |
-                         FT_FACE_FLAG_FAST_GLYPHS;
+
+      root->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
+                          FT_FACE_FLAG_HORIZONTAL  |
+                          FT_FACE_FLAG_FAST_GLYPHS;
 
       if ( face->accel.constantWidth )
         root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
@@ -1268,7 +1336,7 @@ THE SOFTWARE.
     {
       /* 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;
index b91274f..0451ee8 100644 (file)
@@ -66,11 +66,11 @@ in this Software without prior written authorization from The Open Group.
   TwoByteSwap( unsigned char*  buf,
                size_t          nbytes )
   {
-    unsigned char  c;
-
-
     for ( ; nbytes >= 2; nbytes -= 2, buf += 2 )
     {
+      unsigned char  c;
+
+
       c      = buf[0];
       buf[0] = buf[1];
       buf[1] = c;
@@ -85,11 +85,11 @@ in this Software without prior written authorization from The Open Group.
   FourByteSwap( unsigned char*  buf,
                 size_t          nbytes )
   {
-    unsigned char  c;
-
-
     for ( ; nbytes >= 4; nbytes -= 4, buf += 4 )
     {
+      unsigned char  c;
+
+
       c      = buf[0];
       buf[0] = buf[3];
       buf[3] = c;
index 9c8f9ed..90ba010 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -16,6 +16,8 @@
 /***************************************************************************/
 
 
+#include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
 #include "pfrcmap.h"
 #include "pfrobjs.h"
 
 
 
   FT_CALLBACK_DEF( FT_Error )
-  pfr_cmap_init( PFR_CMap  cmap )
+  pfr_cmap_init( PFR_CMap    cmap,
+                 FT_Pointer  pointer )
   {
-    FT_Error  error = PFR_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     PFR_Face  face  = (PFR_Face)FT_CMAP_FACE( cmap );
 
+    FT_UNUSED( pointer );
+
 
     cmap->num_chars = face->phy_font.num_chars;
     cmap->chars     = face->phy_font.chars;
@@ -42,7 +47,7 @@
       {
         if ( cmap->chars[n - 1].char_code >= cmap->chars[n].char_code )
         {
-          error = PFR_Err_Invalid_Table;
+          error = FT_THROW( Invalid_Table );
           goto Exit;
         }
       }
   pfr_cmap_char_index( PFR_CMap   cmap,
                        FT_UInt32  char_code )
   {
-    FT_UInt   min = 0;
-    FT_UInt   max = cmap->num_chars;
-    FT_UInt   mid;
-    PFR_Char  gchar;
+    FT_UInt  min = 0;
+    FT_UInt  max = cmap->num_chars;
 
 
     while ( min < max )
     {
+      PFR_Char  gchar;
+      FT_UInt   mid;
+
+
       mid   = min + ( max - min ) / 2;
       gchar = cmap->chars + mid;
 
index c59d8ae..db66281 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR driver interface (body).                                */
 /*                                                                         */
-/*  Copyright 2002-2004, 2006, 2008, 2010, 2011 by                         */
+/*  Copyright 2002-2004, 2006, 2008, 2010, 2011, 2013, 2014 by             */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -37,7 +37,7 @@
     PFR_PhyFont  phys = &face->phy_font;
 
 
-    pfr_face_get_kerning( pfrface, left, right, avector );
+    (void)pfr_face_get_kerning( pfrface, left, right, avector );
 
     /* convert from metrics to outline units when necessary */
     if ( phys->outline_resolution != phys->metrics_resolution )
@@ -51,7 +51,7 @@
                                             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_Error  error = PFR_Err_Invalid_Argument;
+    FT_Error  error = FT_ERR( Invalid_Argument );
 
 
     *anadvance = 0;
@@ -84,7 +84,7 @@
       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;
 
-    return PFR_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FT_Service_PfrMetricsRec  pfr_metrics_service_rec =
   {
     pfr_get_metrics,
     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,
index 6f65b01..2ce0937 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
     /* 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;
     }
     /* 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_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;
 
   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_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;
       /* 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;
 
   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;
   }
         PFR_SubGlyph  subglyph;
 
 
-        FT_TRACE4(( "subglyph %d:\n", n ));
+        FT_TRACE4(( "  subglyph %d:\n", n ));
 
         subglyph   = glyph->subs + old_count + n;
         old_points = base->n_points;
index 325322e..f68d016 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR loader (body).                                          */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2005, 2007, 2009, 2010 by                  */
+/*  Copyright 2002-2005, 2007, 2009, 2010, 2013, 2014 by                   */
 /*  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 )
   {
-    FT_Error  error = PFR_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     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" ));
-    error = PFR_Err_Invalid_Table;
+    error = FT_THROW( Invalid_Table );
     goto Exit;
   }
 
     if ( header->signature  != 0x50465230L ||   /* "PFR0" */
          header->version     > 4           ||
          header->header_size < 58          ||
-         header->signature2 != 0x0d0a      )    /* CR/LF  */
+         header->signature2 != 0x0D0A      )    /* CR/LF  */
     {
       result = 0;
     }
       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 )    ||
 
   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;
   }
 
     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 );
     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_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_UInt    count, num_vert, num_horz;
     FT_Int*    snaps  = NULL;
-    FT_Error   error  = PFR_Err_Ok;
+    FT_Error   error  = FT_Err_Ok;
     FT_Memory  memory = phy_font->memory;
 
 
     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;
                                      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;
 
 
   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_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;
 
           phy_font->ascent  = PFR_NEXT_SHORT( q );
           phy_font->descent = PFR_NEXT_SHORT( q );
           phy_font->leading = PFR_NEXT_SHORT( q );
-          q += 16;
           break;
 
         case 3:
     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;
   }
index c65cf29..0c89242 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR object methods (body).                                  */
 /*                                                                         */
-/*  Copyright 2002-2008, 2010-2011 by                                      */
+/*  Copyright 2002-2008, 2010-2011, 2013, 2014 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -23,6 +23,7 @@
 #include "pfrsbit.h"
 #include FT_OUTLINE_H
 #include FT_INTERNAL_DEBUG_H
+#include FT_INTERNAL_CALC_H
 #include FT_TRUETYPE_IDS_H
 
 #include "pfrerror.h"
@@ -87,7 +88,7 @@
     if ( !pfr_header_check( &face->header ) )
     {
       FT_TRACE2(( "  not a PFR font\n" ));
-      error = PFR_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
     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;
     }
 
 
       pfrface->face_index = face_index;
       pfrface->num_glyphs = phy_font->num_chars + 1;
-      pfrface->face_flags = FT_FACE_FLAG_SCALABLE;
+
+      pfrface->face_flags |= FT_FACE_FLAG_SCALABLE;
 
       /* if all characters point to the same gps_offset 0, we */
       /* assume that the font only contains bitmaps           */
           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;
           }
         }
     FT_ULong     gps_offset;
 
 
+    FT_TRACE1(( "pfr_slot_load: glyph index %d\n", gindex ));
+
     if ( gindex > 0 )
       gindex--;
 
     if ( !face || gindex >= face->phy_font.num_chars )
     {
-      error = PFR_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
 
     if ( load_flags & FT_LOAD_SBITS_ONLY )
     {
-      error = PFR_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
                         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;
 
       {
         FT_UInt    count       = item->pair_count;
         FT_UInt    size        = item->pair_size;
-        FT_UInt    power       = (FT_UInt)ft_highpow2( (FT_UInt32)count );
+        FT_UInt    power       = 1 << FT_MSB( count );
         FT_UInt    probe       = power * size;
         FT_UInt    extra       = count - power;
         FT_Byte*   base        = stream->cursor;
index 52bc2c8..979bf78 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -59,7 +59,7 @@
 
     if ( !decreasing )
     {
-      writer->line += writer->pitch * ( target->rows-1 );
+      writer->line += writer->pitch * ( target->rows - 1 );
       writer->pitch = -writer->pitch;
     }
   }
                            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;
     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_Bool     decreasing,
                         FT_Bitmap*  target )
   {
-    FT_Error          error = PFR_Err_Ok;
+    FT_Error          error = FT_Err_Ok;
     PFR_BitWriterRec  writer;
 
 
 
       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 */
-      return PFR_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
     }
 
   Found_Strike:
       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;
       }
     }
        *      which causes a size truncation, because truncated
        *      size properties makes bitmap glyph broken.
        */
-      if ( xpos > FT_INT_MAX || ( ypos + ysize ) > FT_INT_MAX )
+      if ( xpos > FT_INT_MAX  || xpos < FT_INT_MIN         ||
+           ysize > FT_INT_MAX || ypos + ysize > FT_INT_MAX ||
+           ypos + (FT_Long)ysize < FT_INT_MIN )
       {
         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 )
index 5f3f9e6..6a40e11 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    AFM parser (body).                                                   */
 /*                                                                         */
-/*  Copyright 2006-2010, 2012 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,       */
@@ -17,6 +17,7 @@
 
 #include <ft2build.h>
 #include FT_FREETYPE_H
+#include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_POSTSCRIPT_AUX_H
 
 #include "afmparse.h"
   afm_stream_read_one( AFM_Stream  stream )
   {
     char*  str;
-    int    ch;
 
 
     afm_stream_skip_spaces( stream );
 
     while ( 1 )
     {
-      ch = AFM_GETC();
+      int  ch = AFM_GETC();
+
+
       if ( AFM_IS_SPACE( ch ) )
         break;
       else if ( AFM_IS_NEWLINE( ch ) )
   afm_stream_read_string( AFM_Stream  stream )
   {
     char*  str;
-    int    ch;
 
 
     afm_stream_skip_spaces( stream );
     /* scan to eol */
     while ( 1 )
     {
-      ch = AFM_GETC();
+      int  ch = AFM_GETC();
+
+
       if ( AFM_IS_NEWLINE( ch ) )
       {
         stream->status = AFM_STREAM_STATUS_EOL;
     parser->FontInfo  = NULL;
     parser->get_index = NULL;
 
-    return PSaux_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     {
       *aint = val.u.i;
 
-      return PSaux_Err_Ok;
+      return FT_Err_Ok;
     }
     else
-      return PSaux_Err_Syntax_Error;
+      return FT_THROW( Syntax_Error );
   }
 
 
       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;
     }
 
   Fail:
-    return PSaux_Err_Syntax_Error;
+    return FT_THROW( Syntax_Error );
   }
 
 
         ft_qsort( fi->KernPairs, fi->NumKernPair,
                   sizeof ( AFM_KernPairRec ),
                   afm_compare_kern_pairs );
-        return PSaux_Err_Ok;
+        return FT_Err_Ok;
 
       case AFM_TOKEN_UNKNOWN:
         break;
     }
 
   Fail:
-    return PSaux_Err_Syntax_Error;
+    return FT_THROW( Syntax_Error );
   }
 
 
 
       case AFM_TOKEN_ENDKERNDATA:
       case AFM_TOKEN_ENDFONTMETRICS:
-        return PSaux_Err_Ok;
+        return FT_Err_Ok;
 
       case AFM_TOKEN_UNKNOWN:
         break;
     }
 
   Fail:
-    return PSaux_Err_Syntax_Error;
+    return FT_THROW( Syntax_Error );
   }
 
 
 
 
       if ( token == end_section || token == AFM_TOKEN_ENDFONTMETRICS )
-        return PSaux_Err_Ok;
+        return FT_Err_Ok;
     }
 
   Fail:
-    return PSaux_Err_Syntax_Error;
+    return FT_THROW( Syntax_Error );
   }
 
 
   {
     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 )
-      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 )
-      return PSaux_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )
     {
 
         if ( metrics_sets != 0 && metrics_sets != 2 )
         {
-          error = PSaux_Err_Unimplemented_Feature;
+          error = FT_THROW( Unimplemented_Feature );
 
           goto Fail;
         }
         /* fall through since we only support kern data */
 
       case AFM_TOKEN_ENDFONTMETRICS:
-        return PSaux_Err_Ok;
+        return FT_Err_Ok;
 
       default:
         break;
index 9ea7fb9..22e8cf2 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Some convenience conversions (body).                                 */
 /*                                                                         */
-/*  Copyright 2006, 2008, 2009, 2012 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,       */
 
 #include <ft2build.h>
 #include FT_INTERNAL_POSTSCRIPT_AUX_H
+#include FT_INTERNAL_DEBUG_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.                 */
 
 #endif /* 'A' == 193 */
 
 
-  FT_LOCAL_DEF( FT_Int )
+  FT_LOCAL_DEF( FT_Long )
   PS_Conv_Strtol( FT_Byte**  cursor,
                   FT_Byte*   limit,
-                  FT_Int     base )
+                  FT_Long    base )
   {
     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 )
+      goto Bad;
 
-    if ( p >= limit || base < 2 || base > 36 )
+    if ( base < 2 || base > 36 )
+    {
+      FT_TRACE4(( "!!!INVALID BASE:!!!" ));
       return 0;
+    }
 
     if ( *p == '-' || *p == '+' )
     {
 
       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;
       if ( IS_PS_SPACE( *p ) || *p OP 0x80 )
         break;
 
-      c = ft_char_table[*p & 0x7f];
+      c = ft_char_table[*p & 0x7F];
 
       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;
 
-    *cursor = p;
-
     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 )
 
   {
-    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 == '#' )
     {
-      *cursor = p + 1;
+      p++;
+
+      curp = p;
+      num  = PS_Conv_Strtol( &p, limit, num );
 
-      return PS_Conv_Strtol( cursor, 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_Int     power_ten )
+                   FT_Long    power_ten )
   {
     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;
+
+    FT_Bool   sign           = 0;
+    FT_Bool   have_overflow  = 0;
+    FT_Bool   have_underflow = 0;
 
 
     if ( p >= limit )
-      return 0;
+      goto Bad;
 
     if ( *p == '-' || *p == '+' )
     {
 
       p++;
       if ( p == limit )
-        return 0;
+        goto Bad;
     }
 
+    /* read the integer part */
     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 == '.' )
         if ( IS_PS_SPACE( *p ) || *p OP 0x80 )
           break;
 
-        c = ft_char_table[*p & 0x7f];
+        c = ft_char_table[*p & 0x7F];
 
         if ( c < 0 || c >= 10 )
           break;
 
-        if ( !integral && power_ten > 0 )
+        /* only add digit if we don't overflow */
+        if ( divider < 0xCCCCCCCL && decimal < 0xCCCCCCCL )
         {
-          power_ten--;
           decimal = decimal * 10 + c;
-        }
-        else
-        {
-          if ( divider < 10000000L )
-          {
-            decimal = decimal * 10 + c;
+
+          if ( !integral && power_ten > 0 )
+            power_ten--;
+          else
             divider *= 10;
-          }
         }
       }
     }
     /* read exponent, if any */
     if ( p + 1 < limit && ( *p == 'e' || *p == 'E' ) )
     {
+      FT_Long  exponent;
+
+
       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 )
     {
+      if ( integral >= 0xCCCCCCCL )
+        goto Overflow;
       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;
-      divider  *= 10;
+      if ( divider < 0xCCCCCCCL )
+        divider *= 10;
+      else
+        decimal /= 10;
+
+      if ( !integral && !decimal )
+        goto Underflow;
+
       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;
 
-    *cursor = p;
-
     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 ( *p OP 0x80 )
         break;
 
-      c = ft_char_table[*p & 0x7f];
+      c = ft_char_table[*p & 0x7F];
 
       if ( (unsigned)c >= 16 )
         break;
index 84854ba..d91c762 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
 FT_BEGIN_HEADER
 
 
-  FT_LOCAL( FT_Int )
+  FT_LOCAL( FT_Long )
   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,
-                   FT_Int     power_ten );
+                   FT_Long    power_ten );
 
 #if 0
   FT_LOCAL( FT_UInt )
index 06df6e6..7ec3b4c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auxiliary functions for PostScript fonts (body).                     */
 /*                                                                         */
-/*  Copyright 1996-2012 by                                                 */
+/*  Copyright 1996-2014 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 
   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;
 
     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" ));
-      return PSaux_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
     }
 
     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 */
     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_Error      error = PSaux_Err_Invalid_File_Format;
+    FT_Error      error = FT_ERR( Invalid_File_Format );
     unsigned int  i;
 
 
         embed--;
         if ( embed == 0 )
         {
-          error = PSaux_Err_Ok;
+          error = FT_Err_Ok;
           break;
         }
       }
                FT_Byte*   limit )
   {
     FT_Byte*  cur = *acur;
-    FT_Error  err =  PSaux_Err_Ok;
+    FT_Error  err =  FT_Err_Ok;
 
 
     while ( ++cur < limit )
     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++;
   {
     FT_Byte*  cur;
     FT_Int    embed = 0;
-    FT_Error  error = PSaux_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     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 )
       {
 
   end:
     if ( embed != 0 )
-      error = PSaux_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
 
     *acur = cur;
 
 
     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 */
       {
         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++;
                  " but invalid at this point\n",
                  *cur ));
 
-      error = PSaux_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
     }
 
     parser->error  = error;
       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->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;
 
   /* first character must be a delimiter or a part of a number */
   /* NB: `values' can be NULL if we just want to skip the      */
   /*     array; in this case we ignore `max_values'            */
+  /*                                                           */
+  /* return number of successfully parsed values               */
 
   static FT_Int
   ps_tofixedarray( FT_Byte*  *acur,
                         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 */
     cur   = token.start;
     limit = token.limit;
 
+    type = field->type;
+
     /* 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;
       parser->limit  = old_limit;
 
       if ( token2.type == T1_TOKEN_TYPE_ARRAY )
+      {
+        type = T1_FIELD_TYPE_MM_BBOX;
         goto FieldArray;
+      }
     }
     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;
 
-      count = max_objects;
-      idx   = 1;
+      idx = 1;
 
       /* don't include delimiters */
       cur++;
 
       skip_spaces( &cur, limit );
 
-      switch ( field->type )
+      switch ( type )
       {
       case T1_FIELD_TYPE_BOOL:
         val = ps_tobool( &cur, limit );
                        "                     "
                        " but found token of type %d instead\n",
                        token.type ));
-            error = PSaux_Err_Invalid_File_Format;
+            error = FT_THROW( Invalid_File_Format );
             goto Exit;
           }
 
 
           result = ps_tofixedarray( &cur, limit, 4, temp, 0 );
 
-          if ( result < 0 )
+          if ( result < 4 )
           {
             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;
           }
 
         }
         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_UInt)result < max_objects )
+            {
+              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;
     FT_UNUSED( pflags );
 #endif
 
-    error = PSaux_Err_Ok;
+    error = FT_Err_Ok;
 
   Exit:
     return error;
 
   Fail:
-    error = PSaux_Err_Invalid_File_Format;
+    error = FT_THROW( Invalid_File_Format );
     goto Exit;
   }
 
     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;
                               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 )
     {
       parser->cursor = token->start;
       parser->limit  = token->limit;
-      ps_parser_load_field( parser, &fieldrec, objects, max_objects, 0 );
+
+      error = ps_parser_load_field( parser,
+                                    &fieldrec,
+                                    objects,
+                                    max_objects,
+                                    0 );
+      if ( error )
+        break;
+
       fieldrec.offset += fieldrec.size;
     }
 
                       FT_Long*   pnum_bytes,
                       FT_Bool    delimiters )
   {
-    FT_Error  error = PSaux_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_Byte*  cur;
 
 
       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;
       }
 
       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;
       }
 
                   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;
     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++;
-      return PSaux_Err_Ok;
+      return FT_Err_Ok;
     }
 
     error = FT_GLYPHLOADER_CHECK_POINTS( builder->loader, 0, 1 );
                           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 )
-      error = PSaux_Err_Ok;
+      error = FT_Err_Ok;
     else
     {
       builder->parse_state = T1_Parse_Have_Path;
index 9e5bd34..fb1353a 100644 (file)
 
 
   FT_CALLBACK_DEF( FT_Error )
-  t1_cmap_standard_init( T1_CMapStd  cmap )
+  t1_cmap_standard_init( T1_CMapStd  cmap,
+                         FT_Pointer  pointer )
   {
+    FT_UNUSED( pointer );
+
+
     t1_cmap_std_init( cmap, 0 );
     return 0;
   }
 
 
   FT_CALLBACK_DEF( FT_Error )
-  t1_cmap_expert_init( T1_CMapStd  cmap )
+  t1_cmap_expert_init( T1_CMapStd  cmap,
+                       FT_Pointer  pointer )
   {
+    FT_UNUSED( pointer );
+
+
     t1_cmap_std_init( cmap, 1 );
     return 0;
   }
 
 
   FT_CALLBACK_DEF( FT_Error )
-  t1_cmap_custom_init( T1_CMapCustom  cmap )
+  t1_cmap_custom_init( T1_CMapCustom  cmap,
+                       FT_Pointer     pointer )
   {
     T1_Face      face     = (T1_Face)FT_CMAP_FACE( cmap );
     T1_Encoding  encoding = &face->type1.encoding;
 
+    FT_UNUSED( pointer );
+
 
     cmap->first   = encoding->code_first;
     cmap->count   = (FT_UInt)( encoding->code_last - cmap->first );
 
 
   FT_CALLBACK_DEF( FT_Error )
-  t1_cmap_unicode_init( PS_Unicodes  unicodes )
+  t1_cmap_unicode_init( PS_Unicodes  unicodes,
+                        FT_Pointer   pointer )
   {
     T1_Face             face    = (T1_Face)FT_CMAP_FACE( unicodes );
     FT_Memory           memory  = FT_FACE_MEMORY( face );
     FT_Service_PsCMaps  psnames = (FT_Service_PsCMaps)face->psnames;
 
+    FT_UNUSED( pointer );
+
 
     return psnames->unicodes_init( memory,
                                    unicodes,
index ea67841..d67a05e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PostScript Type 1 decoding routines (body).                          */
 /*                                                                         */
-/*  Copyright 2000-2011 by                                                 */
+/*  Copyright 2000-2014 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
     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 */
     {
       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
     {
       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 */
     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;
           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 */
         else
         {
           if ( !large_int )
-            value <<= 16;
+            value = (FT_Int32)( (FT_UInt32)value << 16 );
         }
 
         break;
             }
 
             if ( ip[-2] < 251 )
-              value =  ( ( (FT_Int32)ip[-2] - 247 ) << 8 ) + ip[-1] + 108;
+              value =    ( ( ip[-2] - 247 ) * 256 ) + ip[-1] + 108;
             else
-              value = -( ( ( (FT_Int32)ip[-2] - 251 ) << 8 ) + ip[-1] + 108 );
+              value = -( ( ( ip[-2] - 251 ) * 256 ) + ip[-1] + 108 );
           }
 
           if ( !large_int )
-            value <<= 16;
+            value = (FT_Int32)( (FT_UInt32)value << 16 );
         }
         else
         {
           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 ) )
-                 != PSaux_Err_Ok                                   )
+                 != FT_Err_Ok                                   )
             goto Fail;
           break;
 
               goto Syntax_Error;
 
             /* apply hints to the loaded glyph outline now */
-            hinter->apply( hinter->hints,
-                           builder->current,
-                           (PSH_Globals)builder->hints_globals,
-                           decoder->hint_mode );
+            error = hinter->apply( hinter->hints,
+                                   builder->current,
+                                   (PSH_Globals)builder->hints_globals,
+                                   decoder->hint_mode );
+            if ( error )
+              goto Fail;
           }
 
           /* add current outline to the glyph slot */
           FT_TRACE4(( "\n" ));
 
           /* return now! */
-          return PSaux_Err_Ok;
+          return FT_Err_Ok;
 
         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 )
-            return PSaux_Err_Ok;
+            return FT_Err_Ok;
 
           break;
 
           /* 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;
 
           FT_TRACE4(( " hlineto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
-                 != PSaux_Err_Ok )
+                 != FT_Err_Ok )
             goto Fail;
 
           x += top[0];
           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 ) )
-                 != PSaux_Err_Ok                                   )
+                 != FT_Err_Ok                                   )
             goto Fail;
 
           x += top[0];
           FT_TRACE4(( " rlineto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
-                 != PSaux_Err_Ok )
+                 != FT_Err_Ok )
             goto Fail;
 
           x += top[0];
 
         Add_Line:
           if ( ( error = t1_builder_add_point1( builder, x, y ) )
-                 != PSaux_Err_Ok )
+                 != FT_Err_Ok )
             goto Fail;
           break;
 
           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 ) )
-                 != PSaux_Err_Ok                                   )
+                 != FT_Err_Ok                                   )
             goto Fail;
 
           x += top[0];
           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 ) )
-                 != PSaux_Err_Ok                                   )
+                 != FT_Err_Ok                                   )
             goto Fail;
 
           y += top[0];
           FT_TRACE4(( " vlineto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
-                 != PSaux_Err_Ok )
+                 != FT_Err_Ok )
             goto Fail;
 
           y += top[0];
     return error;
 
   Syntax_Error:
-    return PSaux_Err_Syntax_Error;
+    return FT_THROW( Syntax_Error );
 
   Stack_Underflow:
-    return PSaux_Err_Stack_Underflow;
+    return FT_THROW( Stack_Underflow );
   }
 
 
       {
         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->funcs          = t1_decoder_funcs;
 
-    return PSaux_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
index d798978..644c76d 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    PostScript hinting algorithm (body).                                 */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010   */
-/*            by                                                           */
+/*  Copyright 2001-2010, 2012-2014 by                                      */
 /*  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 )
   {
-    PSH_Hint  hint;
-    FT_UInt   count;
+    FT_UInt  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 );
               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
     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 )
     {
 
       point  = first;
       before = point;
-      after  = point;
 
       do
       {
       start = first;
       do
       {
-        point = first;
-
         /* skip consecutive fitted points */
         for (;;)
         {
 
     /* something to do? */
     if ( outline->n_points == 0 || outline->n_contours == 0 )
-      return PSH_Err_Ok;
+      return FT_Err_Ok;
 
 #ifdef DEBUG_HINTER
 
index 1a248a7..c70f31e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -22,7 +22,6 @@
 
 #include "pshrec.h"
 #include "pshglob.h"
-#include FT_TRIGONOMETRY_H
 
 
 FT_BEGIN_HEADER
@@ -168,8 +167,6 @@ FT_BEGIN_HEADER
     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;
@@ -186,12 +183,6 @@ FT_BEGIN_HEADER
   } 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;
index 31231ad..1bcc481 100644 (file)
@@ -5,7 +5,7 @@
 /*    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-2014 by                          */
 /*  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,
                            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;
 
   }
 
 
-  FT_LOCAL_DEF( FT_Error )
+  FT_LOCAL_DEF( void )
   psh_globals_set_scale( PSH_Globals  globals,
                          FT_Fixed     x_scale,
                          FT_Fixed     y_scale,
                          FT_Fixed     x_delta,
                          FT_Fixed     y_delta )
   {
-    PSH_Dimension  dim = &globals->dimension[0];
+    PSH_Dimension  dim;
 
 
     dim = &globals->dimension[0];
       psh_globals_scale_widths( globals, 1 );
       psh_blues_scale_zones( &globals->blues, y_scale, y_delta );
     }
-
-    return 0;
   }
 
 
index c511626..94d972a 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PostScript hinter global hinting management.                         */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003 by                                          */
+/*  Copyright 2001, 2002, 2003, 2014 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -167,7 +167,7 @@ FT_BEGIN_HEADER
                             FT_Int         org_width );
 #endif
 
-  FT_LOCAL( FT_Error )
+  FT_LOCAL( void )
   psh_globals_set_scale( PSH_Globals  globals,
                          FT_Fixed     x_scale,
                          FT_Fixed     y_scale,
index 91da5d7..cdeaca1 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
   }
 
 
-  FT_DEFINE_PSHINTER_INTERFACE(pshinter_interface,
+  FT_DEFINE_PSHINTER_INTERFACE(
+    pshinter_interface,
     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 ),
     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_Requester)  0        /* no additional interface for now */
-  )
+    (FT_Module_Requester)  NULL )   /* no additional interface for now */
+
 
 /* END */
index 1e0f9a9..568f4ac 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -22,6 +22,7 @@
 #include "pshpic.h"
 #include "pshnterr.h"
 
+
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from pshmod.c */
@@ -33,7 +34,7 @@
   pshinter_module_class_pic_free( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
-    FT_Memory  memory = library->memory;
+    FT_Memory          memory        = library->memory;
 
 
     if ( pic_container->pshinter )
   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 */
-    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;
     FT_Init_Class_pshinter_interface(
       library, &container->pshinter_interface );
 
-/*Exit:*/
-    if( error )
+    if ( error )
       pshinter_module_class_pic_free( library );
+
     return error;
   }
 
-
 #endif /* FT_CONFIG_OPTION_PIC */
 
+
 /* END */
index c10bdd9..b46f853 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -24,21 +24,25 @@ FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
+
 #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
 
-  typedef struct PSHinterPIC_
+  typedef struct  PSHinterPIC_
   {
-    PSHinter_Interface pshinter_interface;
+    PSHinter_Interface  pshinter_interface;
+
   } 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
index 0910cc5..73a18ff 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PostScript hints recorder (body).                           */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004, 2007, 2009 by                        */
+/*  Copyright 2001-2004, 2007, 2009, 2013, 2014 by                         */
 /*  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_Error  error   = PSH_Err_Ok;
+    FT_Error  error   = FT_Err_Ok;
 
 
     if ( new_max > old_max )
@@ -83,7 +83,7 @@
                        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   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 )
                    FT_Int     idx,
                    FT_Memory  memory )
   {
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_Byte*  p;
 
 
   {
     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 )
                        PS_Mask       *amask )
   {
     FT_UInt   count;
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     PS_Mask   mask  = 0;
 
 
                       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         bit_count,
                           FT_Memory       memory )
   {
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error;
     PS_Mask   mask;
 
 
     FT_UInt   count;
 
 
-    count = ( count1 <= count2 ) ? count1 : count2;
+    count = FT_MIN( count1, count2 );
     for ( ; count >= 8; count -= 8 )
     {
       if ( p1[0] & p2[0] )
                        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 */
                            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-- )
                              FT_Memory     memory )
   {
     PS_Mask   mask;
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     /* get last hint mask */
                          FT_UInt       end_point )
   {
     FT_UInt  count = dim->masks.num_masks;
-    PS_Mask  mask;
 
 
     if ( count > 0 )
     {
-      mask            = dim->masks.masks + count - 1;
+      PS_Mask  mask = dim->masks.masks + count - 1;
+
+
       mask->end_point = end_point;
     }
   }
                               FT_UInt         end_point,
                               FT_Memory       memory )
   {
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error;
 
 
     /* reset current mask, if any */
                            FT_Memory     memory,
                            FT_Int       *aindex )
   {
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_UInt   flags = 0;
 
 
                             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;
 
     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;
   }
 
 
-  FT_LOCAL( FT_Error )
+  FT_LOCAL( void )
   ps_hints_init( PS_Hints   hints,
                  FT_Memory  memory )
   {
     FT_MEM_ZERO( hints, sizeof ( *hints ) );
     hints->memory = memory;
-    return PSH_Err_Ok;
   }
 
 
     {
     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] );
       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" ));
                     FT_Int     dimension,
                     FT_Fixed*  stems )
   {
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     if ( !hints->error )
       else
       {
         FT_ERROR(( "ps_hints_t1stem3: called with invalid hint type\n" ));
-        error = PSH_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Fail;
       }
     }
   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 )
       else
       {
         /* invalid hint type */
-        error = PSH_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Fail;
       }
     }
index dcb3197..a88fe6e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Postscript (Type1/Type2) hints recorder (specification).             */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2006, 2008 by                              */
+/*  Copyright 2001, 2002, 2003, 2006, 2008, 2014 by                        */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -141,7 +141,7 @@ FT_BEGIN_HEADER
   /* */
 
   /* initialize hints recorder */
-  FT_LOCAL( FT_Error )
+  FT_LOCAL( void )
   ps_hints_init( PS_Hints   hints,
                  FT_Memory  memory );
 
index 3619174..42c9aff 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PSNames module implementation (body).                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008 by             */
+/*  Copyright 1996-2003, 2005-2008, 2012-2014 by                           */
 /*  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_INTERNAL_DEBUG_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_POSTSCRIPT_CMAPS_H
 
         /* 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
       {
         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, */
 
 
 #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_Adobe_Std_StringsFunc) ps_get_standard_strings,
 
     t1_standard_encoding,
-    t1_expert_encoding
-  )
+    t1_expert_encoding )
 
 #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,
-    t1_expert_encoding
-  )
+    t1_expert_encoding )
 
 #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 )
   {
-    /* FT_PSCMAPS_SERVICES_GET derefers `library' in PIC mode */
+    /* PSCMAPS_SERVICES_GET dereferences `library' in PIC mode */
 #ifdef FT_CONFIG_OPTION_PIC
     FT_Library  library;
 
     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
-#define PUT_PS_NAMES_SERVICE(a) 0
+#define PUT_PS_NAMES_SERVICE( a )  NULL
 #else
-#define PUT_PS_NAMES_SERVICE(a) a
+#define PUT_PS_NAMES_SERVICE( a )  a
 #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 ),
     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 */
index 467ab73..3820f65 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -22,6 +22,7 @@
 #include "pspic.h"
 #include "psnamerr.h"
 
+
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from psmodule.c */
   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_Memory          memory        = library->memory;
 
 
     if ( pic_container->psnames )
@@ -48,7 +50,7 @@
       PSModulePIC*  container = (PSModulePIC*)pic_container->psnames;
 
 
-      if(container->pscmaps_services)
+      if ( container->pscmaps_services )
         FT_Destroy_Class_pscmaps_services( library,
                                            container->pscmaps_services );
       container->pscmaps_services = NULL;
   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 */
-    if ( FT_ALLOC ( container, sizeof ( *container ) ) )
+    if ( FT_ALLOC( container, sizeof ( *container ) ) )
       return error;
     FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->psnames = 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_pscmaps_services(
               library, &container->pscmaps_services );
     if ( error )
@@ -81,7 +84,7 @@
     FT_Init_Class_pscmaps_interface( library,
                                      &container->pscmaps_interface );
 
-Exit:
+  Exit:
     if ( error )
       psnames_module_class_pic_free( library );
     return error;
index 1169b89..6ff002c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -25,22 +25,27 @@ 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
 
-  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;
 
-#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
index 4cd39a8..f321de2 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2001, 2003, 2011 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,
@@ -46,7 +46,7 @@ PSNAMES_DRV_OBJ_S := $(OBJ_DIR)/psnames.$O
 
 # PSNames driver source file for single build
 #
-PSNAMES_DRV_SRC_S := $(PSNAMES_DIR)/psmodule.c
+PSNAMES_DRV_SRC_S := $(PSNAMES_DIR)/psnames.c
 
 
 # PSNames driver - single object
index 7773924..703155a 100644 (file)
     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__ */
 
 
index f85845e..b06ac33 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType glyph rasterizer (body).                                */
 /*                                                                         */
-/*  Copyright 1996-2003, 2005, 2007-2012 by                                */
+/*  Copyright 1996-2003, 2005, 2007-2014 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -24,8 +24,8 @@
   /*                                                                       */
   /* - copy `src/raster/ftraster.c' (this file) to your current directory  */
   /*                                                                       */
-  /* - copy `include/freetype/ftimage.h' and `src/raster/ftmisc.h'         */
-  /*   to your current directory                                           */
+  /* - copy `include/ftimage.h' and `src/raster/ftmisc.h' to your current  */
+  /*   directory                                                           */
   /*                                                                       */
   /* - compile `ftraster' with the _STANDALONE_ macro defined, as in       */
   /*                                                                       */
@@ -60,7 +60,7 @@
 
 #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"
 
 
 #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  */
 #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
 #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
 
 
 #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"
 
-#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
   /* 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    */
   typedef short           Short;
   typedef unsigned short  UShort, *PUShort;
   typedef long            Long, *PLong;
+  typedef unsigned long   ULong;
 
   typedef unsigned char   Byte, *PByte;
   typedef char            Bool;
 
 #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 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   */
   /*    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
 
     if ( ras.top >= ras.maxBuff )
     {
-      ras.error = Raster_Err_Overflow;
+      ras.error = FT_THROW( Overflow );
       return FAILURE;
     }
 
 
     default:
       FT_ERROR(( "New_Profile: invalid profile direction\n" ));
-      ras.error = Raster_Err_Invalid;
+      ras.error = FT_THROW( Invalid );
       return FAILURE;
     }
 
   static Bool
   End_Profile( RAS_ARGS Bool  overshoot )
   {
-    Long      h;
-    PProfile  oldProfile;
+    Long  h;
 
 
     h = (Long)( ras.top - ras.cProfile->offset );
     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 )
     {
+      PProfile  oldProfile;
+
+
       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" ));
-      ras.error = Raster_Err_Overflow;
+      ras.error = FT_THROW( Overflow );
       return FAILURE;
     }
 
   Insert_Y_Turn( RAS_ARGS Int  y )
   {
     PLong  y_turns;
-    Int    y2, n;
+    Int    n;
 
 
     n       = ras.numTurns - 1;
     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--;
       ras.maxBuff--;
       if ( ras.maxBuff <= ras.top )
       {
-        ras.error = Raster_Err_Overflow;
+        ras.error = FT_THROW( Overflow );
         return FAILURE;
       }
       ras.numTurns++;
   static Bool
   Finalize_Profile_Table( RAS_ARG )
   {
-    Int       bottom, top;
     UShort    n;
     PProfile  p;
 
     {
       while ( n > 0 )
       {
+        Int  bottom, top;
+
+
         if ( n > 1 )
           p->link = (PProfile)( p->offset + p->height );
         else
     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 )
     {
-      Ix = SMulDiv( ras.precision, Dx, Dy);
+      Ix = SMulDiv_No_Round( ras.precision, Dx, Dy );
       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;
     }
 
     if ( ( top + TRUNC( e2 - e ) + 1 ) >= ras.maxBuff )
     {
       ras.top   = top;
-      ras.error = Raster_Err_Overflow;
+      ras.error = FT_THROW( Overflow );
       return FAILURE;
     }
 
         v_start.x = ( v_start.x + v_last.x ) / 2;
         v_start.y = ( v_start.y + v_last.y ) / 2;
 
-        v_last = v_start;
+     /* v_last = v_start; */
       }
       point--;
       tags--;
     return SUCCESS;
 
   Invalid_Outline:
-    ras.error = Raster_Err_Invalid;
+    ras.error = FT_THROW( Invalid );
 
   Fail:
     return FAILURE;
     int       i;
     unsigned  start;
 
-    PProfile  lastProfile;
-
 
     ras.fProfile = NULL;
     ras.joint    = FALSE;
 
     for ( i = 0; i < ras.outline.n_contours; i++ )
     {
-      Bool  o;
+      PProfile  lastProfile;
+      Bool      o;
 
 
       ras.state    = Unknown_State;
                                 PProfile    right )
   {
     Long   e1, e2;
-    int    c1, c2;
-    Byte   f1, f2;
     Byte*  target;
 
+    Int  dropOutControl = left->flags & 7;
+
     FT_UNUSED( y );
     FT_UNUSED( left );
     FT_UNUSED( right );
 
     e1 = TRUNC( CEILING( x1 ) );
 
-    if ( x2 - x1 - ras.precision <= ras.precision_jitter )
+    if ( dropOutControl != 2                             &&
+         x2 - x1 - ras.precision <= ras.precision_jitter )
       e2 = e1;
     else
       e2 = TRUNC( FLOOR( x2 ) );
 
     if ( e2 >= 0 && e1 < ras.bWidth )
     {
+      int   c1, c2;
+      Byte  f1, f2;
+
+
       if ( e1 < 0 )
         e1 = 0;
       if ( e2 >= ras.bWidth )
                                   PProfile    left,
                                   PProfile    right )
   {
-    Long   e1, e2;
-    PByte  bits;
-    Byte   f1;
-
     FT_UNUSED( left );
     FT_UNUSED( right );
 
 
     if ( x2 - x1 < ras.precision )
     {
+      Long  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 ) );
 
         e1 = TRUNC( e1 );
 
-        if ( e1 >= 0 && e1 < ras.target.rows )
+        if ( e1 >= 0 && (ULong)e1 < ras.target.rows )
         {
           PByte  p;
 
         /* bounding box instead                                           */
         if ( pxl < 0 )
           pxl = e1;
-        else if ( TRUNC( pxl ) >= ras.target.rows )
+        else if ( (ULong)( TRUNC( pxl ) ) >= ras.target.rows )
           pxl = e2;
 
         /* check that the other pixel isn't set */
         if ( ras.target.pitch > 0 )
           bits += ( ras.target.rows - 1 ) * ras.target.pitch;
 
-        if ( e1 >= 0              &&
-             e1 < ras.target.rows &&
-             *bits & f1           )
+        if ( e1 >= 0                     &&
+             (ULong)e1 < ras.target.rows &&
+             *bits & f1                  )
           return;
       }
       else
 
     e1 = TRUNC( pxl );
 
-    if ( e1 >= 0 && e1 < ras.target.rows )
+    if ( e1 >= 0 && (ULong)e1 < ras.target.rows )
     {
       bits -= e1 * ras.target.pitch;
       if ( ras.target.pitch > 0 )
   static void
   Vertical_Gray_Sweep_Step( RAS_ARG )
   {
-    Int     c1, c2;
-    PByte   pix, bit, bit2;
     short*  count = (short*)count_table;
     Byte*   grays;
 
 
     if ( ras.traceOfs > ras.gray_width )
     {
+      PByte  pix;
+
+
       pix   = ras.gTarget + ras.traceG + ras.gray_min_x * 4;
       grays = ras.grays;
 
         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 )
         {
   {
     Long   e1, e2;
     PByte  pixel;
-    Byte   color;
 
 
     /* During the horizontal sweep, we only take care of drop-outs */
 
     if ( e1 >= 0 )
     {
+      Byte  color;
+
+
       if ( x2 - x1 >= ras.precision_half )
         color = ras.grays[2];
       else
     /* check the Y-turns */
     if ( ras.numTurns == 0 )
     {
-      ras.error = Raster_Err_Invalid;
+      ras.error = FT_THROW( Invalid );
       return FAILURE;
     }
 
         if ( ras.band_top >= 7 || k < i )
         {
           ras.band_top = 0;
-          ras.error    = Raster_Err_Invalid;
+          ras.error    = FT_THROW( Invalid );
 
           return ras.error;
         }
   {
     FT_UNUSED_RASTER;
 
-    return Raster_Err_Unsupported;
+    return FT_THROW( Unsupported );
   }
 
 #endif /* !FT_RASTER_OPTION_ANTI_ALIASING */
 
 
         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
   }
 
 
-  static void
+  static int
   ft_black_set_mode( black_PRaster  raster,
                      unsigned long  mode,
                      const char*    palette )
     FT_UNUSED( palette );
 
 #endif
+
+    return 0;
   }
 
 
 
 
     if ( !raster || !raster->buffer || !raster->buffer_size )
-      return Raster_Err_Not_Ini;
+      return FT_THROW( Not_Ini );
 
     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 Raster_Err_Invalid;
+      return FT_THROW( Invalid );
 
     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 )
-      return Raster_Err_Unsupported;
+      return FT_THROW( Unsupported );
 
     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 )
-      return Raster_Err_Invalid;
+      return FT_THROW( Invalid );
 
     ras.outline = *outline;
     ras.target  = *target_map;
index 859cb7d..aa7f6d5 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType glyph rasterizer interface (body).                      */
 /*                                                                         */
-/*  Copyright 1996-2003, 2005, 2006, 2011 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,       */
@@ -17,6 +17,7 @@
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_OUTLINE_H
 #include "ftrend1.h"
@@ -37,7 +38,7 @@
                                                library->raster_pool,
                                                library->raster_pool_size );
 
-    return Raster_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
                         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 )
     {
-      error = Raster_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     /* check glyph image format */
     if ( slot->format != render->glyph_format )
     {
-      error = Raster_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     {
       /* 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 )
-        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      */
     {
       /* 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' )
-        return Raster_Err_Cannot_Render_Glyph;
+        return FT_THROW( Cannot_Render_Glyph );
     }
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
     if ( width > FT_USHORT_MAX || height > FT_USHORT_MAX )
     {
-      error = Raster_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
index 2883e3f..5e9f7cc 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
 #include "rastpic.h"
 #include "rasterrs.h"
 
+
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from ftraster.c */
   void
   FT_Init_Class_ft_standard_raster( FT_Raster_Funcs*  funcs );
 
+
   void
   ft_raster1_renderer_class_pic_free( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
-    FT_Memory  memory = library->memory;
+    FT_Memory          memory        = library->memory;
 
 
     if ( pic_container->raster )
     {
-      RasterPIC* container = (RasterPIC*)pic_container->raster;
+      RasterPIC*  container = (RasterPIC*)pic_container->raster;
+
+
       if ( --container->ref_count )
         return;
       FT_FREE( container );
   FT_Error
   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++;
       return error;
     FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->raster = container;
+
     container->ref_count = 1;
 
-    /* initialize pointer table - this is how the module usually expects this data */
+    /* 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 );
+
     return error;
   }
 
+
   /* re-route these init and free functions to the above functions */
   FT_Error
   ft_raster5_renderer_class_pic_init( FT_Library  library )
@@ -85,6 +90,7 @@
     return ft_raster1_renderer_class_pic_init( library );
   }
 
+
   void
   ft_raster5_renderer_class_pic_free( FT_Library  library )
   {
index 7822a24..e0ddba6 100644 (file)
@@ -24,19 +24,25 @@ FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
+
 #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 */
 
-  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;
 
-#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
diff --git a/src/sfnt/pngshim.c b/src/sfnt/pngshim.c
new file mode 100644 (file)
index 0000000..9bfcc2a
--- /dev/null
@@ -0,0 +1,377 @@
+/***************************************************************************/
+/*                                                                         */
+/*  pngshim.c                                                              */
+/*                                                                         */
+/*    PNG Bitmap glyph support.                                            */
+/*                                                                         */
+/*  Copyright 2013, 2014 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 = (FT_Error*)png_get_error_ptr( png );
+
+    FT_UNUSED( error_msg );
+
+
+    *error = FT_THROW( Out_Of_Memory );
+#ifdef PNG_SETJMP_SUPPORTED
+    ft_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 = (FT_Error*)png_get_error_ptr( png );
+
+
+      *e = FT_THROW( Invalid_Stream_Read );
+      png_error( png, NULL );
+
+      return;
+    }
+
+    memcpy( data, stream->cursor, length );
+
+    FT_FRAME_EXIT();
+  }
+
+
+  FT_LOCAL_DEF( FT_Error )
+  Load_SBit_Png( FT_GlyphSlot     slot,
+                 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_Bool          populate_map_and_metrics )
+  {
+    FT_Bitmap    *map   = &slot->bitmap;
+    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 = NULL; /* pacify compiler */
+
+
+    if ( x_offset < 0 ||
+         y_offset < 0 )
+    {
+      error = FT_THROW( Invalid_Argument );
+      goto Exit;
+    }
+
+    if ( !populate_map_and_metrics                            &&
+         ( (FT_UInt)x_offset + metrics->width  > map->width ||
+           (FT_UInt)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                                        ||
+         ( !populate_map_and_metrics                &&
+           ( (FT_Int)imgWidth  != metrics->width  ||
+             (FT_Int)imgHeight != metrics->height ) ) )
+      goto DestroyExit;
+
+    if ( populate_map_and_metrics )
+    {
+      FT_Long  size;
+
+
+      metrics->width  = (FT_Int)imgWidth;
+      metrics->height = (FT_Int)imgHeight;
+
+      map->width      = metrics->width;
+      map->rows       = metrics->height;
+      map->pixel_mode = FT_PIXEL_MODE_BGRA;
+      map->pitch      = map->width * 4;
+      map->num_grays  = 256;
+
+      /* reject too large bitmaps similarly to the rasterizer */
+      if ( map->rows > 0x7FFF || map->width > 0x7FFF )
+      {
+        error = FT_THROW( Array_Too_Large );
+        goto DestroyExit;
+      }
+
+      /* this doesn't overflow: 0x7FFF * 0x7FFF * 4 < 2^32 */
+      size = map->rows * map->pitch;
+
+      error = ft_glyphslot_alloc_bitmap( slot, size );
+      if ( error )
+        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 */
diff --git a/src/sfnt/pngshim.h b/src/sfnt/pngshim.h
new file mode 100644 (file)
index 0000000..dc9ecaf
--- /dev/null
@@ -0,0 +1,49 @@
+/***************************************************************************/
+/*                                                                         */
+/*  pngshim.h                                                              */
+/*                                                                         */
+/*    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.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __PNGSHIM_H__
+#define __PNGSHIM_H__
+
+
+#include <ft2build.h>
+#include "ttload.h"
+
+
+FT_BEGIN_HEADER
+
+#ifdef FT_CONFIG_OPTION_USE_PNG
+
+  FT_LOCAL( FT_Error )
+  Load_SBit_Png( FT_GlyphSlot     slot,
+                 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_Bool          populate_map_and_metrics );
+
+#endif
+
+FT_END_HEADER
+
+#endif /* __PNGSHIM_H__ */
+
+
+/* END */
index 02cee58..a6c956a 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2011 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,
@@ -34,15 +34,13 @@ SFNT_DRV_SRC := $(SFNT_DIR)/ttload.c   \
                 $(SFNT_DIR)/ttbdf.c    \
                 $(SFNT_DIR)/sfobjs.c   \
                 $(SFNT_DIR)/sfdriver.c \
-                $(SFNT_DIR)/sfntpic.c
+                $(SFNT_DIR)/sfntpic.c  \
+                $(SFNT_DIR)/pngshim.c
 
 # SFNT driver headers
 #
-# Note that ttsbit0.c gets #included by ttsbit.c.
-#
 SFNT_DRV_H := $(SFNT_DRV_SRC:%c=%h)  \
-              $(SFNT_DIR)/sferrors.h \
-              $(SFNT_DIR)/ttsbit0.c
+              $(SFNT_DIR)/sferrors.h
 
 
 # SFNT driver object(s)
index 847d83d..badb159 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    High-level SFNT driver interface (body).                             */
 /*                                                                         */
-/*  Copyright 1996-2007, 2009-2011 by                                      */
+/*  Copyright 1996-2007, 2009-2014 by                                      */
 /*  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
 
+
   /*************************************************************************/
   /*                                                                       */
   /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
 #define FT_COMPONENT  trace_sfdriver
 
 
- /*
-  *  SFNT TABLE SERVICE
-  *
-  */
 /*
+   *  SFNT TABLE SERVICE
+   *
+   */
 
   static void*
   get_sfnt_table( TT_Face      face,
 
     switch ( tag )
     {
-    case ft_sfnt_head:
+    case FT_SFNT_HEAD:
       table = &face->header;
       break;
 
-    case ft_sfnt_hhea:
+    case FT_SFNT_HHEA:
       table = &face->horizontal;
       break;
 
-    case ft_sfnt_vhea:
-      table = face->vertical_info ? &face->vertical : 0;
+    case FT_SFNT_VHEA:
+      table = face->vertical_info ? &face->vertical : NULL;
       break;
 
-    case ft_sfnt_os2:
-      table = face->os2.version == 0xFFFFU ? 0 : &face->os2;
+    case FT_SFNT_OS2:
+      table = face->os2.version == 0xFFFFU ? NULL : &face->os2;
       break;
 
-    case ft_sfnt_post:
+    case FT_SFNT_POST:
       table = &face->postscript;
       break;
 
-    case ft_sfnt_maxp:
+    case FT_SFNT_MAXP:
       table = &face->max_profile;
       break;
 
-    case ft_sfnt_pclt:
-      table = face->pclt.Version ? &face->pclt : 0;
+    case FT_SFNT_PCLT:
+      table = face->pclt.Version ? &face->pclt : NULL;
       break;
 
     default:
-      table = 0;
+      table = NULL;
     }
 
     return table;
                    FT_ULong  *length )
   {
     if ( !offset || !length )
-      return SFNT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     if ( !tag )
       *length = face->num_tables;
     else
     {
       if ( idx >= face->num_tables )
-        return SFNT_Err_Table_Missing;
+        return FT_THROW( Table_Missing );
 
       *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_TableInfoFunc)sfnt_table_info
-  )
+    (FT_SFNT_TableInfoFunc)sfnt_table_info )
 
 
 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
 
- /*
-  *  GLYPH DICT SERVICE
-  *
-  */
 /*
+   *  GLYPH DICT SERVICE
+   *
+   */
 
   static FT_Error
   sfnt_get_glyph_name( TT_Face     face,
   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;
-    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",
-         FT_UINT_MAX, root->num_glyphs ));
+                  FT_UINT_MAX, root->num_glyphs ));
 
     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_NameIndexFunc)sfnt_get_name_index
-  )
+    (FT_GlyphDict_NameIndexFunc)sfnt_get_name_index )
+
 
 #endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
 
 
- /*
-  *  POSTSCRIPT NAME SERVICE
-  *
-  */
 /*
+   *  POSTSCRIPT NAME SERVICE
+   *
+   */
 
   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_Error          error  = SFNT_Err_Ok;
+      FT_Error          error  = FT_Err_Ok;
 
       FT_UNUSED( error );
 
       {
         FT_Stream   stream = face->name_table.stream;
         FT_String*  r      = (FT_String*)result;
-        FT_Byte*    p      = (FT_Byte*)name->string;
+        FT_Byte*    p;
 
 
         if ( FT_STREAM_SEEK( name->stringOffset ) ||
       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 );
 
     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
    */
-  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
           *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 */
 
    */
 
 #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
-  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
-  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
-  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
 
 
   sfnt_get_interface( FT_Module    module,
                       const char*  module_interface )
   {
-    /* FT_SFNT_SERVICES_GET derefers `library' in PIC mode */
+    /* SFNT_SERVICES_GET dereferences `library' in PIC mode */
 #ifdef FT_CONFIG_OPTION_PIC
     FT_Library  library;
 
 #else
     FT_UNUSED( module );
 #endif
-    return ft_service_list_lookup( FT_SFNT_SERVICES_GET, module_interface );
-  }
-
-
-#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 );
+    return ft_service_list_lookup( SFNT_SERVICES_GET, module_interface );
   }
 
 
-  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 );
-
-    return SFNT_Err_Ok;
-  }
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-#define PUT_EMBEDDED_BITMAPS(a) a
+#define PUT_EMBEDDED_BITMAPS( a )  a
 #else
-#define PUT_EMBEDDED_BITMAPS(a) 0
+#define PUT_EMBEDDED_BITMAPS( a )  NULL
 #endif
+
 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
-#define PUT_PS_NAMES(a) a
+#define PUT_PS_NAMES( a )  a
 #else
-#define PUT_PS_NAMES(a) 0
+#define PUT_PS_NAMES( a )  NULL
 #endif
 
-  FT_DEFINE_SFNT_INTERFACE(sfnt_interface,
+  FT_DEFINE_SFNT_INTERFACE(
+    sfnt_interface,
     tt_face_goto_table,
 
     sfnt_init_face,
 
     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_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' */
-    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' */
-    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 */
-
     tt_face_get_kerning,
 
     /* since version 2.2 */
-
     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_sbit ),
+    PUT_EMBEDDED_BITMAPS( tt_face_free_sbit ),
 
-    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
   )
 
 
-  FT_DEFINE_MODULE(sfnt_module_class,
+  FT_DEFINE_MODULE(
+    sfnt_module_class,
 
     0,  /* not a font driver or renderer */
     sizeof ( FT_ModuleRec ),
     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_Requester)  sfnt_get_interface
-  )
+    (FT_Module_Requester)  sfnt_get_interface )
 
 
 /* END */
index 564a3fe..e981e1d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    SFNT error codes (specification only).                               */
 /*                                                                         */
-/*  Copyright 2001, 2004, 2012 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,       */
@@ -33,8 +33,6 @@
 #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__ */
index fc507b4..d62ed4e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -28,6 +28,7 @@
 #include "sfdriver.c"
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+#include "pngshim.c"
 #include "ttsbit.c"
 #endif
 
index 1372376..b3fb24b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
 #include "sfntpic.h"
 #include "sferrors.h"
 
+
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from sfdriver.c */
   FT_Error
   FT_Create_Class_sfnt_services( FT_Library           library,
-                                 FT_ServiceDescRec**  ouput_class );
-
+                                 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 */
   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
   sfnt_module_class_pic_free( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
-    FT_Memory  memory = library->memory;
+    FT_Memory          memory        = library->memory;
 
 
     if ( pic_container->sfnt )
         FT_Destroy_Class_sfnt_services( library,
                                         container->sfnt_services );
       container->sfnt_services = NULL;
+
       if ( container->tt_cmap_classes )
         FT_Destroy_Class_tt_cmap_classes( library,
                                           container->tt_cmap_classes );
       container->tt_cmap_classes = NULL;
+
       FT_FREE( container );
       pic_container->sfnt = NULL;
     }
 
 
   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_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 */
-    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;
 
-    /* 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_sfnt_services( library,
                                            &container->sfnt_services );
     if ( error )
       goto Exit;
+
     error = FT_Create_Class_tt_cmap_classes( library,
                                              &container->tt_cmap_classes );
     if ( error )
 #endif
     FT_Init_Class_sfnt_interface( library, &container->sfnt_interface );
 
-Exit:
+  Exit:
     if ( error )
       sfnt_module_class_pic_free( library );
     return error;
   }
 
-
-
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
index f7993d1..b09a914 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -24,57 +24,76 @@ 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 */
 
-/* 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
+
 #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"
 
-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_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
-    FT_Service_BDFRec sfnt_service_bdf;
+    FT_Service_BDFRec         sfnt_service_bdf;
 #endif
-    SFNT_Interface sfnt_interface;
+    SFNT_Interface            sfnt_interface;
+
   } 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
@@ -85,7 +104,7 @@ typedef struct sfntModulePIC_
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
-/* */
+  /* */
 
 FT_END_HEADER
 
index d7be631..70b988d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    SFNT object management (base).                                       */
 /*                                                                         */
-/*  Copyright 1996-2008, 2010-2011 by                                      */
+/*  Copyright 1996-2008, 2010-2014 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -27,6 +27,7 @@
 #include FT_TRUETYPE_TAGS_H
 #include FT_SERVICE_POSTSCRIPT_CMAPS_H
 #include FT_SFNT_NAMES_H
+#include FT_GZIP_H
 #include "sferrors.h"
 
 #ifdef TT_CONFIG_OPTION_BDF
     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;
     }
 
-    string[len] = 0;
+    string[n] = 0;
 
     return string;
   }
     for ( n = 0; n < len; n++ )
     {
       code = *read++;
+
+      if ( code == 0 )
+        break;
+
       if ( code < 32 || code > 127 )
         code = '?';
 
       string[n] = (char)code;
     }
 
-    string[len] = 0;
+    string[n] = 0;
 
     return string;
   }
                     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;
   }
 
 
+#define WRITE_USHORT( p, v )                \
+          do                                \
+          {                                 \
+            *(p)++ = (FT_Byte)( (v) >> 8 ); \
+            *(p)++ = (FT_Byte)( (v) >> 0 ); \
+                                            \
+          } while ( 0 )
+
+#define WRITE_ULONG( p, v )                  \
+          do                                 \
+          {                                  \
+            *(p)++ = (FT_Byte)( (v) >> 24 ); \
+            *(p)++ = (FT_Byte)( (v) >> 16 ); \
+            *(p)++ = (FT_Byte)( (v) >>  8 ); \
+            *(p)++ = (FT_Byte)( (v) >>  0 ); \
+                                             \
+          } while ( 0 )
+
+
+  static void
+  sfnt_stream_close( FT_Stream  stream )
+  {
+    FT_Memory  memory = stream->memory;
+
+
+    FT_FREE( stream->base );
+
+    stream->size  = 0;
+    stream->base  = 0;
+    stream->close = 0;
+  }
+
+
+  FT_CALLBACK_DEF( int )
+  compare_offsets( const void*  a,
+                   const void*  b )
+  {
+    WOFF_Table  table1 = *(WOFF_Table*)a;
+    WOFF_Table  table2 = *(WOFF_Table*)b;
+
+    FT_ULong  offset1 = table1->Offset;
+    FT_ULong  offset2 = table2->Offset;
+
+
+    if ( offset1 > offset2 )
+      return 1;
+    else if ( offset1 < offset2 )
+      return -1;
+    else
+      return 0;
+  }
+
+
+  /* Replace `face->root.stream' with a stream containing the extracted */
+  /* SFNT of a WOFF font.                                               */
+
+  static FT_Error
+  woff_open_font( FT_Stream  stream,
+                  TT_Face    face )
+  {
+    FT_Memory       memory = stream->memory;
+    FT_Error        error  = FT_Err_Ok;
+
+    WOFF_HeaderRec  woff;
+    WOFF_Table      tables  = NULL;
+    WOFF_Table*     indices = NULL;
+
+    FT_ULong        woff_offset;
+
+    FT_Byte*        sfnt        = NULL;
+    FT_Stream       sfnt_stream = NULL;
+
+    FT_Byte*        sfnt_header;
+    FT_ULong        sfnt_offset;
+
+    FT_Int          nn;
+    FT_ULong        old_tag = 0;
+
+    static const FT_Frame_Field  woff_header_fields[] =
+    {
+#undef  FT_STRUCTURE
+#define FT_STRUCTURE  WOFF_HeaderRec
+
+      FT_FRAME_START( 44 ),
+        FT_FRAME_ULONG ( signature ),
+        FT_FRAME_ULONG ( flavor ),
+        FT_FRAME_ULONG ( length ),
+        FT_FRAME_USHORT( num_tables ),
+        FT_FRAME_USHORT( reserved ),
+        FT_FRAME_ULONG ( totalSfntSize ),
+        FT_FRAME_USHORT( majorVersion ),
+        FT_FRAME_USHORT( minorVersion ),
+        FT_FRAME_ULONG ( metaOffset ),
+        FT_FRAME_ULONG ( metaLength ),
+        FT_FRAME_ULONG ( metaOrigLength ),
+        FT_FRAME_ULONG ( privOffset ),
+        FT_FRAME_ULONG ( privLength ),
+      FT_FRAME_END
+    };
+
+
+    FT_ASSERT( stream == face->root.stream );
+    FT_ASSERT( FT_STREAM_POS() == 0 );
+
+    if ( FT_STREAM_READ_FIELDS( woff_header_fields, &woff ) )
+      return error;
+
+    /* Make sure we don't recurse back here or hit TTC code. */
+    if ( woff.flavor == TTAG_wOFF || woff.flavor == TTAG_ttcf )
+      return FT_THROW( Invalid_Table );
+
+    /* Miscellaneous checks. */
+    if ( woff.length != stream->size                              ||
+         woff.num_tables == 0                                     ||
+         44 + woff.num_tables * 20UL >= woff.length               ||
+         12 + woff.num_tables * 16UL >= woff.totalSfntSize        ||
+         ( woff.totalSfntSize & 3 ) != 0                          ||
+         ( woff.metaOffset == 0 && ( woff.metaLength != 0     ||
+                                     woff.metaOrigLength != 0 ) ) ||
+         ( woff.metaLength != 0 && woff.metaOrigLength == 0 )     ||
+         ( woff.privOffset == 0 && woff.privLength != 0 )         )
+      return FT_THROW( Invalid_Table );
+
+    if ( FT_ALLOC( sfnt, woff.totalSfntSize ) ||
+         FT_NEW( sfnt_stream )                )
+      goto Exit;
+
+    sfnt_header = sfnt;
+
+    /* Write sfnt header. */
+    {
+      FT_UInt  searchRange, entrySelector, rangeShift, x;
+
+
+      x             = woff.num_tables;
+      entrySelector = 0;
+      while ( x )
+      {
+        x            >>= 1;
+        entrySelector += 1;
+      }
+      entrySelector--;
+
+      searchRange = ( 1 << entrySelector ) * 16;
+      rangeShift  = woff.num_tables * 16 - searchRange;
+
+      WRITE_ULONG ( sfnt_header, woff.flavor );
+      WRITE_USHORT( sfnt_header, woff.num_tables );
+      WRITE_USHORT( sfnt_header, searchRange );
+      WRITE_USHORT( sfnt_header, entrySelector );
+      WRITE_USHORT( sfnt_header, rangeShift );
+    }
+
+    /* While the entries in the sfnt header must be sorted by the */
+    /* tag value, the tables themselves are not.  We thus have to */
+    /* sort them by offset and check that they don't overlap.     */
+
+    if ( FT_NEW_ARRAY( tables, woff.num_tables )  ||
+         FT_NEW_ARRAY( indices, woff.num_tables ) )
+      goto Exit;
+
+    FT_TRACE2(( "\n"
+                "  tag    offset    compLen  origLen  checksum\n"
+                "  -------------------------------------------\n" ));
+
+    if ( FT_FRAME_ENTER( 20L * woff.num_tables ) )
+      goto Exit;
+
+    for ( nn = 0; nn < woff.num_tables; nn++ )
+    {
+      WOFF_Table  table = tables + nn;
+
+      table->Tag        = FT_GET_TAG4();
+      table->Offset     = FT_GET_ULONG();
+      table->CompLength = FT_GET_ULONG();
+      table->OrigLength = FT_GET_ULONG();
+      table->CheckSum   = FT_GET_ULONG();
+
+      FT_TRACE2(( "  %c%c%c%c  %08lx  %08lx  %08lx  %08lx\n",
+                  (FT_Char)( table->Tag >> 24 ),
+                  (FT_Char)( table->Tag >> 16 ),
+                  (FT_Char)( table->Tag >> 8  ),
+                  (FT_Char)( table->Tag       ),
+                  table->Offset,
+                  table->CompLength,
+                  table->OrigLength,
+                  table->CheckSum ));
+
+      if ( table->Tag <= old_tag )
+      {
+        FT_FRAME_EXIT();
+        error = FT_THROW( Invalid_Table );
+        goto Exit;
+      }
+
+      old_tag     = table->Tag;
+      indices[nn] = table;
+    }
+
+    FT_FRAME_EXIT();
+
+    /* Sort by offset. */
+
+    ft_qsort( indices,
+              woff.num_tables,
+              sizeof ( WOFF_Table ),
+              compare_offsets );
+
+    /* Check offsets and lengths. */
+
+    woff_offset = 44 + woff.num_tables * 20L;
+    sfnt_offset = 12 + woff.num_tables * 16L;
+
+    for ( nn = 0; nn < woff.num_tables; nn++ )
+    {
+      WOFF_Table  table = indices[nn];
+
+
+      if ( table->Offset != woff_offset                         ||
+           table->CompLength > woff.length                      ||
+           table->Offset > woff.length - table->CompLength      ||
+           table->OrigLength > woff.totalSfntSize               ||
+           sfnt_offset > woff.totalSfntSize - table->OrigLength ||
+           table->CompLength > table->OrigLength                )
+      {
+        error = FT_THROW( Invalid_Table );
+        goto Exit;
+      }
+
+      table->OrigOffset = sfnt_offset;
+
+      /* The offsets must be multiples of 4. */
+      woff_offset += ( table->CompLength + 3 ) & ~3;
+      sfnt_offset += ( table->OrigLength + 3 ) & ~3;
+    }
+
+    /*
+     * Final checks!
+     *
+     * We don't decode and check the metadata block.
+     * We don't check table checksums either.
+     * But other than those, I think we implement all
+     * `MUST' checks from the spec.
+     */
+
+    if ( woff.metaOffset )
+    {
+      if ( woff.metaOffset != woff_offset                  ||
+           woff.metaOffset + woff.metaLength > woff.length )
+      {
+        error = FT_THROW( Invalid_Table );
+        goto Exit;
+      }
+
+      /* We have padding only ... */
+      woff_offset += woff.metaLength;
+    }
+
+    if ( woff.privOffset )
+    {
+      /* ... if it isn't the last block. */
+      woff_offset = ( woff_offset + 3 ) & ~3;
+
+      if ( woff.privOffset != woff_offset                  ||
+           woff.privOffset + woff.privLength > woff.length )
+      {
+        error = FT_THROW( Invalid_Table );
+        goto Exit;
+      }
+
+      /* No padding for the last block. */
+      woff_offset += woff.privLength;
+    }
+
+    if ( sfnt_offset != woff.totalSfntSize ||
+         woff_offset != woff.length        )
+    {
+      error = FT_THROW( Invalid_Table );
+      goto Exit;
+    }
+
+    /* Write the tables. */
+
+    for ( nn = 0; nn < woff.num_tables; nn++ )
+    {
+      WOFF_Table  table = tables + nn;
+
+
+      /* Write SFNT table entry. */
+      WRITE_ULONG( sfnt_header, table->Tag );
+      WRITE_ULONG( sfnt_header, table->CheckSum );
+      WRITE_ULONG( sfnt_header, table->OrigOffset );
+      WRITE_ULONG( sfnt_header, table->OrigLength );
+
+      /* Write table data. */
+      if ( FT_STREAM_SEEK( table->Offset )     ||
+           FT_FRAME_ENTER( table->CompLength ) )
+        goto Exit;
+
+      if ( table->CompLength == table->OrigLength )
+      {
+        /* Uncompressed data; just copy. */
+        ft_memcpy( sfnt + table->OrigOffset,
+                   stream->cursor,
+                   table->OrigLength );
+      }
+      else
+      {
+#ifdef FT_CONFIG_OPTION_USE_ZLIB
+
+        /* Uncompress with zlib. */
+        FT_ULong  output_len = table->OrigLength;
+
+
+        error = FT_Gzip_Uncompress( memory,
+                                    sfnt + table->OrigOffset, &output_len,
+                                    stream->cursor, table->CompLength );
+        if ( error )
+          goto Exit;
+        if ( output_len != table->OrigLength )
+        {
+          error = FT_THROW( Invalid_Table );
+          goto Exit;
+        }
+
+#else /* !FT_CONFIG_OPTION_USE_ZLIB */
+
+        error = FT_THROW( Unimplemented_Feature );
+        goto Exit;
+
+#endif /* !FT_CONFIG_OPTION_USE_ZLIB */
+      }
+
+      FT_FRAME_EXIT();
+
+      /* We don't check whether the padding bytes in the WOFF file are     */
+      /* actually '\0'.  For the output, however, we do set them properly. */
+      sfnt_offset = table->OrigOffset + table->OrigLength;
+      while ( sfnt_offset & 3 )
+      {
+        sfnt[sfnt_offset] = '\0';
+        sfnt_offset++;
+      }
+    }
+
+    /* Ok!  Finally ready.  Swap out stream and return. */
+    FT_Stream_OpenMemory( sfnt_stream, sfnt, woff.totalSfntSize );
+    sfnt_stream->memory = stream->memory;
+    sfnt_stream->close  = sfnt_stream_close;
+
+    FT_Stream_Free(
+      face->root.stream,
+      ( face->root.face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) != 0 );
+
+    face->root.stream = sfnt_stream;
+
+    face->root.face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM;
+
+  Exit:
+    FT_FREE( tables );
+    FT_FREE( indices );
+
+    if ( error )
+    {
+      FT_FREE( sfnt );
+      FT_Stream_Close( sfnt_stream );
+      FT_FREE( sfnt_stream );
+    }
+
+    return error;
+  }
+
+
+#undef WRITE_USHORT
+#undef WRITE_ULONG
+
+
   /* Fill in face->ttc_header.  If the font is not a TTC, it is */
   /* synthesized into a TTC with one offset table.              */
   static FT_Error
     face->ttc_header.version = 0;
     face->ttc_header.count   = 0;
 
+  retry:
     offset = FT_STREAM_POS();
 
     if ( FT_READ_ULONG( tag ) )
       return error;
 
+    if ( tag == TTAG_wOFF )
+    {
+      FT_TRACE2(( "sfnt_open_font: file is a WOFF; synthesizing SFNT\n" ));
+
+      if ( FT_STREAM_SEEK( offset ) )
+        return error;
+
+      error = woff_open_font( stream, face );
+      if ( error )
+        return error;
+
+      /* Swap out stream and retry! */
+      stream = face->root.stream;
+      goto retry;
+    }
+
     if ( tag != 0x00010000UL &&
          tag != TTAG_ttcf    &&
          tag != TTAG_OTTO    &&
          tag != 0x00020000UL )
     {
       FT_TRACE2(( "  not a font using the SFNT container format\n" ));
-      return SFNT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
     }
 
     face->ttc_header.tag = TTAG_ttcf;
         return error;
 
       if ( face->ttc_header.count == 0 )
-        return SFNT_Err_Invalid_Table;
+        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 = */
       /* 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 SFNT_Err_Array_Too_Large;
+        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 ) )
       if ( !sfnt )
       {
         FT_ERROR(( "sfnt_init_face: cannot access `sfnt' module\n" ));
-        return SFNT_Err_Missing_Module;
+        return FT_THROW( Missing_Module );
       }
 
       face->sfnt       = sfnt;
     if ( error )
       return error;
 
+    /* Stream may have changed in sfnt_open_font. */
+    stream = face->root.stream;
+
     FT_TRACE2(( "sfnt_init_face: %08p, %ld\n", face, face_index ));
 
     if ( face_index < 0 )
       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;
   }
 
 
-#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 )
 
-#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 )
 
-#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 )
 
 
 #endif
     FT_Bool       has_outline;
     FT_Bool       is_apple_sbit;
-    FT_Bool       ignore_preferred_family = FALSE;
+    FT_Bool       is_apple_sbix;
+    FT_Bool       ignore_preferred_family    = FALSE;
     FT_Bool       ignore_preferred_subfamily = FALSE;
 
     SFNT_Service  sfnt = (SFNT_Service)face->sfnt;
 
     FT_UNUSED( face_index );
 
+
     /* Check parameters */
 
     {
 #endif
 
     is_apple_sbit = 0;
+    is_apple_sbix = !face->goto_table( face, TTAG_sbix, stream, 0 );
+
+    /* Apple 'sbix' color bitmaps are rendered scaled and then the 'glyf'
+     * outline rendered on top.  We don't support that yet, so just ignore
+     * the 'glyf' outline and advertise it as a bitmap-only font. */
+    if ( is_apple_sbix )
+      has_outline = FALSE;
 
     /* if this font doesn't contain outlines, we try to load */
     /* a `bhed' table                                        */
 
     /* load the font header (`head' table) if this isn't an Apple */
     /* sbit font file                                             */
-    if ( !is_apple_sbit )
+    if ( !is_apple_sbit || is_apple_sbix )
     {
       LOAD_( head );
       if ( error )
 
     if ( face->header.Units_Per_EM == 0 )
     {
-      error = SFNT_Err_Invalid_Table;
+      error = FT_THROW( Invalid_Table );
 
       goto Exit;
     }
       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 */
                  get_glyph_metrics                                 )
           {
             face->horizontal.number_Of_HMetrics = 0;
-            error = SFNT_Err_Ok;
+            error                               = FT_Err_Ok;
           }
 #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" ));
 
           has_outline = 0;
-          error       = SFNT_Err_Ok;
+          error       = FT_Err_Ok;
         }
         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 */
                  get_glyph_metrics                                 )
           {
             face->horizontal.number_Of_HMetrics = 0;
-            error = SFNT_Err_Ok;
+            error                               = FT_Err_Ok;
           }
 #endif
 
           face->vertical_info = 1;
       }
 
-      if ( error && error != SFNT_Err_Table_Missing )
+      if ( error && FT_ERR_NEQ( error, Table_Missing ) )
         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     */
-        if ( error == SFNT_Err_Table_Missing )
-          error = SFNT_Err_Ok;
+        if ( FT_ERR_EQ( error, Table_Missing ) )
+          error = FT_Err_Ok;
         else
           goto Exit;
       }
     LOAD_( pclt );
     if ( error )
     {
-      if ( error != SFNT_Err_Table_Missing )
+      if ( FT_ERR_NEQ( error, Table_Missing ) )
         goto Exit;
 
       face->pclt.Version = 0;
       /*                                                                   */
       /* Compute face flags.                                               */
       /*                                                                   */
+      if ( face->sbit_table_type == TT_SBIT_TABLE_TYPE_CBLC ||
+           face->sbit_table_type == TT_SBIT_TABLE_TYPE_SBIX )
+        flags |= FT_FACE_FLAG_COLOR;      /* color glyphs */
+
       if ( has_outline == TRUE )
         flags |= FT_FACE_FLAG_SCALABLE;   /* scalable outlines */
 
                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
         FT_UInt  i, count;
 
 
-#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
         count = face->sbit_num_strikes;
-#else
-        count = (FT_UInt)face->num_sbit_strikes;
-#endif
 
         if ( count > 0 )
         {
 
           if ( em_size == 0 || face->os2.version == 0xFFFFU )
           {
-            avgwidth = 0;
+            avgwidth = 1;
             em_size = 1;
           }
 
     }
 
     /* freeing the horizontal metrics */
-#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
     {
       FT_Stream  stream = FT_FACE_STREAM( face );
 
       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 )
index 18845c3..9401dae 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -74,7 +74,7 @@
          length < 8                             ||
          FT_FRAME_EXTRACT( length, bdf->table ) )
     {
-      error = SFNT_Err_Invalid_Table;
+      error = FT_THROW( Invalid_Table );
       goto Exit;
     }
 
   BadTable:
     FT_FRAME_RELEASE( bdf->table );
     FT_ZERO( bdf );
-    error = SFNT_Err_Invalid_Table;
+    error = FT_THROW( Invalid_Table );
     goto Exit;
   }
 
   {
     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;
     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;
             {
               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;
           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;
-            error             = SFNT_Err_Ok;
+            error             = FT_Err_Ok;
             goto Exit;
 
           default:
index 1dfd987..f54de70 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType character mapping table (cmap) support (body).              */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by      */
+/*  Copyright 2002-2010, 2012-2014 by                                      */
 /*  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;
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   tt_cmap0_validate( FT_Byte*      table,
                      FT_Validator  valid )
   {
-    FT_Byte*  p      = table + 2;
-    FT_UInt   length = TT_NEXT_USHORT( p );
+    FT_Byte*  p;
+    FT_UInt   length;
+
+
+    if ( table + 2 + 2 > valid->limit )
+      FT_INVALID_TOO_SHORT;
 
+    p      = table + 2;           /* skip format */
+    length = TT_NEXT_USHORT( p );
 
     if ( table + length > valid->limit || length < 262 )
       FT_INVALID_TOO_SHORT;
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     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,
-    (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 */
 
   tt_cmap2_validate( FT_Byte*      table,
                      FT_Validator  valid )
   {
-    FT_Byte*  p      = table + 2;           /* skip format */
-    FT_UInt   length = TT_PEEK_USHORT( p );
+    FT_Byte*  p;
+    FT_UInt   length;
+
     FT_UInt   n, max_subs;
-    FT_Byte*  keys;                         /* keys table */
-    FT_Byte*  subs;                         /* sub-headers */
-    FT_Byte*  glyph_ids;                    /* glyph ID array */
+    FT_Byte*  keys;        /* keys table     */
+    FT_Byte*  subs;        /* sub-headers    */
+    FT_Byte*  glyph_ids;   /* glyph ID array */
+
+
+    if ( table + 2 + 2 > valid->limit )
+      FT_INVALID_TOO_SHORT;
 
+    p      = table + 2;           /* skip format */
+    length = TT_NEXT_USHORT( p );
 
     if ( table + length > valid->limit || length < 6 + 512 )
       FT_INVALID_TOO_SHORT;
     /* parse sub-headers */
     for ( n = 0; n <= max_subs; n++ )
     {
-      FT_UInt   first_code, code_count, offset;
-      FT_Int    delta;
-      FT_Byte*  ids;
+      FT_UInt  first_code, code_count, offset;
+      FT_Int   delta;
 
 
       first_code = TT_NEXT_USHORT( p );
       /* check offset */
       if ( offset != 0 )
       {
+        FT_Byte*  ids;
+
+
         ids = p - 2 + offset;
         if ( ids < glyph_ids || ids + code_count*2 > table + length )
           FT_INVALID_OFFSET;
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     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,
-    (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 */
 
     cmap->cur_charcode = (FT_UInt32)0xFFFFFFFFUL;
     cmap->cur_gindex   = 0;
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   tt_cmap4_validate( FT_Byte*      table,
                      FT_Validator  valid )
   {
-    FT_Byte*  p      = table + 2;               /* skip format */
-    FT_UInt   length = TT_NEXT_USHORT( p );
+    FT_Byte*  p;
+    FT_UInt   length;
+
     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 ( table + 2 + 2 > valid->limit )
       FT_INVALID_TOO_SHORT;
 
+    p      = table + 2;           /* skip format */
+    length = TT_NEXT_USHORT( p );
+
     /* in certain fonts, the `length' field is invalid and goes */
     /* out of bound.  We try to correct this here...            */
     if ( table + length > valid->limit )
       length = (FT_UInt)( valid->limit - table );
     }
 
+    if ( length < 16 )
+      FT_INVALID_TOO_SHORT;
+
     p        = table + 6;
     num_segs = TT_NEXT_USHORT( p );   /* read segCountX2 */
 
     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,
-    (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 */
 
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     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,
-    (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 */
 
     p          = is32  + 8192;          /* skip `is32' array */
     num_groups = TT_NEXT_ULONG( p );
 
-    if ( p + num_groups * 12 > valid->limit )
+    /* p + num_groups * 12 > valid->limit ? */
+    if ( num_groups > (FT_UInt32)( valid->limit - p ) / 12 )
       FT_INVALID_TOO_SHORT;
 
     /* check groups, they must be in increasing order */
 
         if ( valid->level >= FT_VALIDATE_TIGHT )
         {
-          if ( start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) )
+          FT_UInt32  d = end - start;
+
+
+          /* start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) ? */
+          if ( d > TT_VALID_GLYPH_COUNT( valid )             ||
+               start_id >= TT_VALID_GLYPH_COUNT( valid ) - d )
             FT_INVALID_GLYPH_ID;
 
           count = (FT_UInt32)( end - start + 1 );
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     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,
-    (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 */
 
     count  = TT_NEXT_ULONG( p );
 
     if ( length > (FT_ULong)( valid->limit - table ) ||
-         length < 20 + count * 2                     )
+         /* length < 20 + count * 2 ? */
+         length < 20                                 ||
+         ( length - 20 ) / 2 < count                 )
       FT_INVALID_TOO_SHORT;
 
     /* check glyph indices */
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     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,
-    (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 */
 
 
     cmap->valid      = 0;
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   tt_cmap12_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 )
     num_groups = TT_NEXT_ULONG( p );
 
     if ( length > (FT_ULong)( valid->limit - table ) ||
-         length < 16 + 12 * num_groups               )
+         /* length < 16 + 12 * num_groups ? */
+         length < 16                                 ||
+         ( length - 16 ) / 12 < num_groups           )
       FT_INVALID_TOO_SHORT;
 
     /* check groups, they must be in increasing order */
 
         if ( valid->level >= FT_VALIDATE_TIGHT )
         {
-          if ( start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) )
+          FT_UInt32  d = end - start;
+
+
+          /* start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) ? */
+          if ( d > TT_VALID_GLYPH_COUNT( valid )             ||
+               start_id >= TT_VALID_GLYPH_COUNT( valid ) - d )
             FT_INVALID_GLYPH_ID;
         }
 
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
 
     char_code = cmap->cur_charcode + 1;
 
-    n = cmap->cur_group;
-
     for ( n = cmap->cur_group; n < cmap->num_groups; n++ )
     {
       p        = cmap->cmap.data + 16 + 12 * n;
     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,
-    (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 */
 
 
     cmap->valid      = 0;
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   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 )
     num_groups = TT_NEXT_ULONG( p );
 
     if ( length > (FT_ULong)( valid->limit - table ) ||
-         length < 16 + 12 * num_groups               )
+         /* length < 16 + 12 * num_groups ? */
+         length < 16                                 ||
+         ( length - 16 ) / 12 < num_groups           )
       FT_INVALID_TOO_SHORT;
 
     /* check groups, they must be in increasing order */
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
 
     char_code = cmap->cur_charcode + 1;
 
-    n = cmap->cur_group;
-
     for ( n = cmap->cur_group; n < cmap->num_groups; n++ )
     {
       p        = cmap->cmap.data + 16 + 12 * n;
 
       /* if `char_code' is not in any group, then `mid' is */
       /* the group nearest to `char_code'                  */
-      /*                                                   */
 
       if ( char_code > end )
       {
     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,
-    (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 */
 
                     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 )
     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;
   }
 
 
   tt_cmap14_validate( FT_Byte*      table,
                       FT_Validator  valid )
   {
-    FT_Byte*  p             = table + 2;
-    FT_ULong  length        = TT_NEXT_ULONG( p );
-    FT_ULong  num_selectors = TT_NEXT_ULONG( p );
+    FT_Byte*  p;
+    FT_ULong  length;
+    FT_ULong  num_selectors;
+
 
+    if ( table + 2 + 4 + 4 > valid->limit )
+      FT_INVALID_TOO_SHORT;
+
+    p             = table + 2;
+    length        = TT_NEXT_ULONG( p );
+    num_selectors = TT_NEXT_ULONG( p );
 
     if ( length > (FT_ULong)( valid->limit - table ) ||
-         length < 10 + 11 * num_selectors            )
+         /* length < 10 + 11 * num_selectors ? */
+         length < 10                                 ||
+         ( length - 10 ) / 11 < num_selectors        )
       FT_INVALID_TOO_SHORT;
 
     /* check selectors, they must be in increasing order */
           FT_ULong  lastBase  = 0;
 
 
-          if ( defp + numRanges * 4 > valid->limit )
+          /* defp + numRanges * 4 > valid->limit ? */
+          if ( numRanges > (FT_ULong)( valid->limit - defp ) / 4 )
             FT_INVALID_TOO_SHORT;
 
           for ( i = 0; i < numRanges; ++i )
         {
           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 ) )
+          /* numMappings * 4 > (FT_ULong)( valid->limit - ndp ) ? */
+          if ( numMappings > ( (FT_ULong)( valid->limit - ndp ) ) / 4 )
             FT_INVALID_TOO_SHORT;
 
           for ( i = 0; i < numMappings; ++i )
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     /* 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,
-                            FT_UInt32  variantSelector)
+                            FT_UInt32  variantSelector )
   {
     FT_Byte*  p = tt_cmap14_find_variant( cmap->data + 6, variantSelector );
     FT_ULong  defOff;
 
 
   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;
 
     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;
         q[0]  = uni;
         uni  += 1;
         q    += 1;
+
       } while ( --cnt != 0 );
     }
     q[0] = 0;
   {
     FT_Byte    *p  = tt_cmap14_find_variant( cmap->data + 6,
                                              variantSelector );
-    FT_UInt32  *ret;
     FT_Int      i;
     FT_ULong    defOff;
     FT_ULong    nondefOff;
       FT_Byte*   dp;
       FT_UInt    di, ni, k;
 
+      FT_UInt32  *ret;
+
 
       p  = cmap->data + nondefOff;
       dp = cmap->data + defOff;
   }
 
 
-  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,
-    (TT_CMap_Info_GetFunc)tt_cmap14_get_info
-  )
+    (TT_CMap_Info_GetFunc)tt_cmap14_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_14 */
 
 
   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*/
 
-  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 );
   }
 
-  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;
+
+    int  i = 0;
+
 
-#define TTCMAPCITEM(a) i++;
+#define TTCMAPCITEM( a ) i++;
 #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 */
-    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
-#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;
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 #endif /*FT_CONFIG_OPTION_PIC*/
 
 
     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 )
     {
-      p -= 2;
       FT_ERROR(( "tt_face_build_cmaps:"
                  " unsupported `cmap' table format = %d\n",
-                 TT_PEEK_USHORT( p ) ));
-      return SFNT_Err_Invalid_Table;
+                 TT_PEEK_USHORT( p - 2 ) ));
+      return FT_THROW( Invalid_Table );
     }
 
     num_cmaps = TT_NEXT_USHORT( p );
-#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",
-                 num_cmaps, FT_MAX_CHARMAP_CACHEABLE + 1 ));
-#endif
 
     for ( ; num_cmaps > 0 && p + 8 <= limit; num_cmaps-- )
     {
       {
         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;
 
 
           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,
 
             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 ) );
               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 ) )
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
index 94f7978..0fde167 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -55,47 +55,80 @@ FT_BEGIN_HEADER
 
   } TT_CMap_ClassRec;
 
+
 #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_;                                   \
+#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_
   {
     FT_ValidatorRec  validator;
@@ -104,7 +137,7 @@ FT_BEGIN_HEADER
   } 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
 
 
index 4c9c6a5..2ea2043 100644 (file)
 
 
 #ifdef TT_CONFIG_CMAP_FORMAT_0
-    TTCMAPCITEM(tt_cmap0_class_rec)
+  TTCMAPCITEM( tt_cmap0_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_2
-    TTCMAPCITEM(tt_cmap2_class_rec)
+  TTCMAPCITEM( tt_cmap2_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_4
-    TTCMAPCITEM(tt_cmap4_class_rec)
+  TTCMAPCITEM( tt_cmap4_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_6
-    TTCMAPCITEM(tt_cmap6_class_rec)
+  TTCMAPCITEM( tt_cmap6_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_8
-    TTCMAPCITEM(tt_cmap8_class_rec)
+  TTCMAPCITEM( tt_cmap8_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_10
-    TTCMAPCITEM(tt_cmap10_class_rec)
+  TTCMAPCITEM( tt_cmap10_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_12
-    TTCMAPCITEM(tt_cmap12_class_rec)
+  TTCMAPCITEM( tt_cmap12_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_13
-    TTCMAPCITEM(tt_cmap13_class_rec)
+  TTCMAPCITEM( tt_cmap13_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_14
-    TTCMAPCITEM(tt_cmap14_class_rec)
+  TTCMAPCITEM( tt_cmap14_class_rec )
 #endif
 
+
   /* END */
index 4688898..455e7b5 100644 (file)
@@ -5,7 +5,7 @@
 /*    Load the basic TrueType kerning table.  This doesn't handle          */
 /*    kerning data within the GPOS table at the moment.                    */
 /*                                                                         */
-/*  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,       */
@@ -61,7 +61,7 @@
     {
       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;
     }
 
@@ -99,7 +99,7 @@
       length   = FT_NEXT_USHORT( p );
       coverage = FT_NEXT_USHORT( p );
 
-      if ( length <= 6 )
+      if ( length <= 6 + 8 )
         break;
 
       p_next += length;
                        FT_UInt  right_glyph )
   {
     FT_Int    result = 0;
-    FT_UInt   count, mask = 1;
+    FT_UInt   count, mask;
     FT_Byte*  p       = face->kern_table;
     FT_Byte*  p_limit = p + face->kern_table_size;
 
           count--, mask <<= 1 )
     {
       FT_Byte* base     = p;
-      FT_Byte* next     = base;
+      FT_Byte* next;
       FT_UInt  version  = FT_NEXT_USHORT( p );
       FT_UInt  length   = FT_NEXT_USHORT( p );
       FT_UInt  coverage = FT_NEXT_USHORT( p );
index 5fb9aea..8338150 100644 (file)
@@ -5,8 +5,7 @@
 /*    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-2014 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
         goto Exit;
     }
     else
-      error = SFNT_Err_Table_Missing;
+      error = FT_THROW( Table_Missing );
 
   Exit:
     return error;
       }
 
       /* we ignore invalid tables */
-      if ( table.Offset + table.Length > stream->size )
+
+      /* table.Offset + table.Length > stream->size ? */
+      if ( table.Length > stream->size                ||
+           table.Offset > stream->size - table.Length )
       {
         FT_TRACE2(( "check_table_dir: table entry %d invalid\n", nn ));
         continue;
          */
         if ( table.Length < 0x36 )
         {
-          FT_TRACE2(( "check_table_dir: `head' table too small\n" ));
-          error = SFNT_Err_Table_Missing;
+          FT_TRACE2(( "check_table_dir:"
+                      " `head' or `bhed' table too small\n" ));
+          error = FT_THROW( Table_Missing );
           goto Exit;
         }
 
           goto Exit;
 
         if ( magic != 0x5F0F3CF5UL )
-        {
           FT_TRACE2(( "check_table_dir:"
-                      " no magic number found in `head' table\n"));
-          error = SFNT_Err_Table_Missing;
-          goto Exit;
-        }
+                      " invalid magic number in `head' or `bhed' table\n"));
 
         if ( FT_STREAM_SEEK( offset + ( nn + 1 ) * 16 ) )
           goto Exit;
     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 ) )
     {
-      error = SFNT_Err_Ok;
+      error = FT_Err_Ok;
       goto Exit;
     }
     else
 #else
       FT_TRACE2(( " neither `head' nor `sing' table found\n" ));
 #endif
-      error = SFNT_Err_Table_Missing;
+      error = FT_THROW( Table_Missing );
     }
 
   Exit:
 #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 */
     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;
     {
       entry->Tag      = FT_GET_TAG4();
       entry->CheckSum = FT_GET_ULONG();
-      entry->Offset   = FT_GET_LONG();
-      entry->Length   = FT_GET_LONG();
+      entry->Offset   = FT_GET_ULONG();
+      entry->Length   = FT_GET_ULONG();
 
       /* ignore invalid tables */
-      if ( entry->Offset + entry->Length > stream->size )
+
+      /* entry->Offset + entry->Length > stream->size ? */
+      if ( entry->Length > stream->size                 ||
+           entry->Offset > stream->size - entry->Length )
         continue;
       else
       {
       table = tt_face_lookup_table( face, tag );
       if ( !table )
       {
-        error = SFNT_Err_Table_Missing;
+        error = FT_THROW( Table_Missing );
         goto Exit;
       }
 
     {
       *length = size;
 
-      return SFNT_Err_Ok;
+      return FT_Err_Ok;
     }
 
     if ( length )
     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
       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 ),
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
-  /*    tt_face_load_names                                                 */
+  /*    tt_face_load_name                                                  */
   /*                                                                       */
   /* <Description>                                                         */
   /*    Loads the name records.                                            */
     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;
     }
 
     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
       FT_FRAME_END
     };
 
-    const FT_Frame_Field  os2_fields_extra[] =
+    /* `OS/2' version 1 and newer */
+    static const FT_Frame_Field  os2_fields_extra1[] =
     {
       FT_FRAME_START( 8 ),
         FT_FRAME_ULONG( ulCodePageRange1 ),
       FT_FRAME_END
     };
 
-    const FT_Frame_Field  os2_fields_extra2[] =
+    /* `OS/2' version 2 and newer */
+    static const FT_Frame_Field  os2_fields_extra2[] =
     {
       FT_FRAME_START( 10 ),
         FT_FRAME_SHORT ( sxHeight ),
       FT_FRAME_END
     };
 
+    /* `OS/2' version 5 and newer */
+    static const FT_Frame_Field  os2_fields_extra5[] =
+    {
+      FT_FRAME_START( 4 ),
+        FT_FRAME_USHORT( usLowerOpticalPointSize ),
+        FT_FRAME_USHORT( usUpperOpticalPointSize ),
+      FT_FRAME_END
+    };
+
 
     /* We now support old Mac fonts where the OS/2 table doesn't  */
     /* exist.  Simply put, we set the `version' field to 0xFFFF   */
     if ( FT_STREAM_READ_FIELDS( os2_fields, os2 ) )
       goto Exit;
 
-    os2->ulCodePageRange1 = 0;
-    os2->ulCodePageRange2 = 0;
-    os2->sxHeight         = 0;
-    os2->sCapHeight       = 0;
-    os2->usDefaultChar    = 0;
-    os2->usBreakChar      = 0;
-    os2->usMaxContext     = 0;
+    os2->ulCodePageRange1        = 0;
+    os2->ulCodePageRange2        = 0;
+    os2->sxHeight                = 0;
+    os2->sCapHeight              = 0;
+    os2->usDefaultChar           = 0;
+    os2->usBreakChar             = 0;
+    os2->usMaxContext            = 0;
+    os2->usLowerOpticalPointSize = 0;
+    os2->usUpperOpticalPointSize = 0xFFFF;
 
     if ( os2->version >= 0x0001 )
     {
       /* only version 1 tables */
-      if ( FT_STREAM_READ_FIELDS( os2_fields_extra, os2 ) )
+      if ( FT_STREAM_READ_FIELDS( os2_fields_extra1, os2 ) )
         goto Exit;
 
       if ( os2->version >= 0x0002 )
         /* only version 2 tables */
         if ( FT_STREAM_READ_FIELDS( os2_fields_extra2, os2 ) )
           goto Exit;
+
+        if ( os2->version >= 0x0005 )
+        {
+          /* only version 5 tables */
+          if ( FT_STREAM_READ_FIELDS( os2_fields_extra5, os2 ) )
+            goto Exit;
+        }
       }
     }
 
     FT_TRACE3(( "isFixedPitch:   %s\n", post->isFixedPitch
                                         ? "  yes" : "   no" ));
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
         FT_FRAME_USHORT( Style ),
         FT_FRAME_USHORT( TypeFamily ),
         FT_FRAME_USHORT( CapHeight ),
+        FT_FRAME_USHORT( SymbolSet ),
         FT_FRAME_BYTES ( TypeFace, 16 ),
         FT_FRAME_BYTES ( CharacterComplement, 8 ),
         FT_FRAME_BYTES ( FileName, 6 ),
     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 ));
 
-    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;
 
-    face->gasp.gaspRanges = gaspranges;
+    gaspranges = face->gasp.gaspRanges;
 
     for ( j = 0; j < num_ranges; j++ )
     {
index 73ac8b2..bb31957 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Load the metrics tables common to TTF and OTF fonts (body).          */
 /*                                                                         */
-/*  Copyright 2006-2009, 2011 by                                           */
+/*  Copyright 2006-2009, 2011-2014 by                                      */
 /*  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
 
 
-  /*
-   *  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>                                                            */
@@ -60,8 +53,6 @@
   /* <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,
     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;
 
-    const FT_Frame_Field  metrics_header_fields[] =
+    static const FT_Frame_Field  metrics_header_fields[] =
     {
 #undef  FT_STRUCTURE
 #define FT_STRUCTURE  TT_HoriHeader
   /*    tt_face_get_metrics                                                */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Returns the horizontal or vertical metrics in font units for a     */
-  /*    given glyph.  The metrics are the left side bearing (resp. top     */
-  /*    side bearing) and advance width (resp. advance height).            */
+  /*    Return the horizontal or vertical metrics in font units for a      */
+  /*    given glyph.  The values are the left side bearing (top side       */
+  /*    bearing for vertical metrics) and advance width (advance height    */
+  /*    for vertical metrics).                                             */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    header  :: A pointer to either the horizontal or vertical metrics  */
-  /*               structure.                                              */
+  /*    face     :: A pointer to the TrueType face structure.              */
+  /*                                                                       */
+  /*    vertical :: If set to TRUE, get vertical metrics.                  */
   /*                                                                       */
-  /*    idx     :: The glyph index.                                        */
+  /*    gindex   :: The glyph index.                                       */
   /*                                                                       */
   /* <Output>                                                              */
-  /*    bearing :: The bearing, either left side or top side.              */
+  /*    abearing :: The bearing, either left side or top side.             */
   /*                                                                       */
-  /*    advance :: The advance width resp. advance height.                 */
+  /*    aadvance :: The advance width or advance height, depending on      */
+  /*                the `vertical' flag.                                   */
   /*                                                                       */
-#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  FT_LOCAL_DEF( FT_Error )
+  FT_LOCAL_DEF( void )
   tt_face_get_metrics( TT_Face     face,
                        FT_Bool     vertical,
                        FT_UInt     gindex,
       *abearing = 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;
-  }
-
-#endif /* !FT_CONFIG_OPTION_OLD_INTERNALS */
-
 
 /* END */
index 8b91a11..fb04039 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Load the metrics tables common to TTF and OTF fonts (specification). */
 /*                                                                         */
-/*  Copyright 2006 by                                                      */
+/*  Copyright 2006, 2014 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -40,7 +40,7 @@ FT_BEGIN_HEADER
                      FT_Bool    vertical );
 
 
-  FT_LOCAL( FT_Error )
+  FT_LOCAL( void )
   tt_face_get_metrics( TT_Face     face,
                        FT_Bool     vertical,
                        FT_UInt     gindex,
index 6f4bb1d..99d8005 100644 (file)
@@ -5,7 +5,7 @@
 /*    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, 2014 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 #define MAC_NAME( x )  ( (FT_String*)tt_post_default_names[x] )
 
-  /* the 258 default Mac PS glyph names */
+  /* the 258 default Mac PS glyph names; see file `tools/glnames.py' */
 
   static const FT_String* const  tt_post_default_names[258] =
   {
     /*   0 */
-    ".notdef", ".null", "CR", "space", "exclam",
+    ".notdef", ".null", "nonmarkingreturn", "space", "exclam",
     "quotedbl", "numbersign", "dollar", "percent", "ampersand",
     /*  10 */
     "quotesingle", "parenleft", "parenright", "asterisk", "plus",
     "ae", "oslash", "questiondown", "exclamdown", "logicalnot",
     "radical", "florin", "approxequal", "Delta", "guillemotleft",
     /* 170 */
-    "guillemotright", "ellipsis", "nbspace", "Agrave", "Atilde",
+    "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde",
     "Otilde", "OE", "oe", "endash", "emdash",
     /* 180 */
     "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide",
     "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf",
     "onequarter", "threequarters", "franc", "Gbreve", "gbreve",
     /* 250 */
-    "Idot", "Scedilla", "scedilla", "Cacute", "cacute",
-    "Ccaron", "ccaron", "dmacron",
+    "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute",
+    "Ccaron", "ccaron", "dcroat",
   };
 
 
 
     if ( num_glyphs > face->max_profile.numGlyphs )
     {
-      error = SFNT_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       table->glyph_indices = glyph_indices;
       table->glyph_names   = name_strings;
     }
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
 
   Fail1:
     {
     /* 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;
     }
 
 
         if ( idx < 0 || idx > num_glyphs )
         {
-          error = SFNT_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Fail;
         }
       }
       table->offsets    = offset_table;
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
 
   Fail:
     FT_FREE( offset_table );
     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;
 
 
 
     if ( !face )
-      return SFNT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     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 )
-      return SFNT_Err_Unimplemented_Feature;
+      return FT_THROW( Unimplemented_Feature );
 #endif
 
     names = &face->postscript_names;
     /* nothing to do for format == 0x00030000L */
 
   End:
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
index 283ba7e..c2db96c 100644 (file)
@@ -4,10 +4,12 @@
 /*                                                                         */
 /*    TrueType and OpenType embedded bitmap support (body).                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 2005-2009, 2013, 2014 by                                     */
 /*  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     */
 /*                                                                         */
 /***************************************************************************/
 
-#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 FT_BITMAP_H
 #include "ttsbit.h"
 
 #include "sferrors.h"
 
+#include "ttmtx.h"
+#include "pngshim.h"
+
 
   /*************************************************************************/
   /*                                                                       */
 #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_sbit( TT_Face    face,
+                     FT_Stream  stream )
   {
-    FT_Byte*   line_buff;
-    FT_Int     line_incr;
-    FT_Int     height;
+    FT_Error  error;
+    FT_ULong  table_size;
 
-    FT_UShort  acc;
-    FT_UInt    loaded;
 
+    face->sbit_table       = NULL;
+    face->sbit_table_size  = 0;
+    face->sbit_table_type  = TT_SBIT_TABLE_TYPE_NONE;
+    face->sbit_num_strikes = 0;
 
-    /* first of all, compute starting write position */
-    line_incr = target->pitch;
-    line_buff = target->buffer;
+    error = face->goto_table( face, TTAG_CBLC, stream, &table_size );
+    if ( !error )
+      face->sbit_table_type = TT_SBIT_TABLE_TYPE_CBLC;
+    else
+    {
+      error = face->goto_table( face, TTAG_EBLC, stream, &table_size );
+      if ( error )
+        error = face->goto_table( face, TTAG_bloc, stream, &table_size );
+      if ( !error )
+        face->sbit_table_type = TT_SBIT_TABLE_TYPE_EBLC;
+    }
+
+    if ( error )
+    {
+      error = face->goto_table( face, TTAG_sbix, stream, &table_size );
+      if ( !error )
+        face->sbit_table_type = TT_SBIT_TABLE_TYPE_SBIX;
+    }
+    if ( error )
+      goto Exit;
 
-    if ( line_incr < 0 )
-      line_buff -= line_incr * ( target->rows - 1 );
+    if ( table_size < 8 )
+    {
+      FT_ERROR(( "tt_face_load_sbit_strikes: table too short\n" ));
+      error = FT_THROW( Invalid_File_Format );
+      goto Exit;
+    }
 
-    line_buff += ( x_offset >> 3 ) + y_offset * line_incr;
+    switch ( (FT_UInt)face->sbit_table_type )
+    {
+    case TT_SBIT_TABLE_TYPE_EBLC:
+    case TT_SBIT_TABLE_TYPE_CBLC:
+      {
+        FT_Byte*  p;
+        FT_Fixed  version;
+        FT_ULong  num_strikes;
+        FT_UInt   count;
 
-    /***********************************************************************/
-    /*                                                                     */
-    /* 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'.                                       */
-    /*                                                                     */
-    /***********************************************************************/
 
-    acc    = 0;  /* clear accumulator   */
-    loaded = 0;  /* no bits were loaded */
+        if ( FT_FRAME_EXTRACT( table_size, face->sbit_table ) )
+          goto Exit;
 
-    for ( height = source_height; height > 0; height-- )
-    {
-      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 );
+        face->sbit_table_size = table_size;
 
+        p = face->sbit_table;
 
-      /* first of all, read individual source bytes */
-      if ( count >= 8 )
-      {
-        count -= 8;
+        version     = FT_NEXT_ULONG( p );
+        num_strikes = FT_NEXT_ULONG( p );
+
+        if ( ( version & 0xFFFF0000UL ) != 0x00020000UL )
         {
-          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 );
+          error = FT_THROW( Unknown_File_Format );
+          goto Exit;
+        }
+
+        if ( num_strikes >= 0x10000UL )
+        {
+          error = FT_THROW( Invalid_File_Format );
+          goto Exit;
         }
 
-        /* restore `count' to correct value */
-        count += 8;
+        /*
+         *  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)( ( table_size - 8 ) / 48 );
+
+        face->sbit_num_strikes = count;
       }
+      break;
 
-      /* now write remaining bits (count < 8) */
-      if ( count > 0 )
+    case TT_SBIT_TABLE_TYPE_SBIX:
       {
-        FT_Byte  val;
+        FT_UShort  version;
+        FT_UShort  flags;
+        FT_ULong   num_strikes;
+        FT_UInt    count;
+
+
+        if ( FT_FRAME_ENTER( 8 ) )
+          goto Exit;
 
+        version     = FT_GET_USHORT();
+        flags       = FT_GET_USHORT();
+        num_strikes = FT_GET_ULONG();
 
-        /* ensure that there are at least `count' bits in the accumulator */
-        if ( (FT_Int)loaded < count )
+        FT_FRAME_EXIT();
+
+        if ( version < 1 )
         {
-          acc    |= (FT_UShort)((FT_UShort)*source++ << ( 8 - loaded ));
-          loaded += 8;
+          error = FT_THROW( Unknown_File_Format );
+          goto Exit;
         }
 
-        /* now write remaining bits */
-        val     = (FT_Byte)( ( (FT_Byte)( acc >> 8 ) ) & ~( 0xFF >> count ) );
-        cur[0] |= (FT_Byte)( val >> shift );
+        /* Bit 0 must always be `1'.                            */
+        /* Bit 1 controls the overlay of bitmaps with outlines. */
+        /* All other bits should be zero.                       */
+        if ( !( flags == 1 || flags == 3 ) ||
+             num_strikes >= 0x10000UL      )
+        {
+          error = FT_THROW( Invalid_File_Format );
+          goto Exit;
+        }
 
-        if ( count > space )
-          cur[1] |= (FT_Byte)( val << space );
+        /* we currently don't support bit 1; however, it is better to */
+        /* draw at least something...                                 */
+        if ( flags == 3 )
+          FT_TRACE1(( "tt_face_load_sbit_strikes:"
+                      " sbix overlay not supported yet\n"
+                      "                          "
+                      " expect bad rendering results\n" ));
+
+        /*
+         *  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 + 4UL * count > table_size )
+          count = (FT_UInt)( ( table_size - 8 ) / 4 );
+
+        if ( FT_STREAM_SEEK( FT_STREAM_POS() - 8 ) )
+          goto Exit;
 
-        acc   <<= count;
-        loaded -= count;
-      }
+        face->sbit_table_size = 8 + count * 4;
+        if ( FT_FRAME_EXTRACT( face->sbit_table_size, face->sbit_table ) )
+          goto Exit;
 
-      /* now, skip to next line */
-      if ( byte_padded )
-      {
-        acc    = 0;
-        loaded = 0;   /* clear accumulator on byte-padded lines */
+        face->sbit_num_strikes = count;
       }
+      break;
 
-      line_buff += line_incr;
+    default:
+      error = FT_THROW( Unknown_File_Format );
+      break;
     }
+
+    if ( !error )
+      FT_TRACE3(( "sbit_num_strikes: %u\n", face->sbit_num_strikes ));
+
+    return FT_Err_Ok;
+
+  Exit:
+    if ( error )
+    {
+      if ( face->sbit_table )
+        FT_FRAME_RELEASE( face->sbit_table );
+      face->sbit_table_size = 0;
+      face->sbit_table_type = TT_SBIT_TABLE_TYPE_NONE;
+    }
+
+    return error;
   }
 
 
-  static const FT_Frame_Field  sbit_metrics_fields[] =
+  FT_LOCAL_DEF( void )
+  tt_face_free_sbit( TT_Face  face )
   {
-#undef  FT_STRUCTURE
-#define FT_STRUCTURE  TT_SBit_MetricsRec
+    FT_Stream  stream = face->root.stream;
 
-    FT_FRAME_START( 8 ),
-      FT_FRAME_BYTE( height ),
-      FT_FRAME_BYTE( width ),
 
-      FT_FRAME_CHAR( horiBearingX ),
-      FT_FRAME_CHAR( horiBearingY ),
-      FT_FRAME_BYTE( horiAdvance ),
+    FT_FRAME_RELEASE( face->sbit_table );
+    face->sbit_table_size  = 0;
+    face->sbit_table_type  = TT_SBIT_TABLE_TYPE_NONE;
+    face->sbit_num_strikes = 0;
+  }
 
-      FT_FRAME_CHAR( vertBearingX ),
-      FT_FRAME_CHAR( vertBearingY ),
-      FT_FRAME_BYTE( vertAdvance ),
-    FT_FRAME_END
-  };
 
+  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 );
+  }
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <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 )
+
+  FT_LOCAL_DEF( FT_Error )
+  tt_face_load_strike_metrics( TT_Face           face,
+                               FT_ULong          strike_index,
+                               FT_Size_Metrics*  metrics )
   {
-    FT_Error  error;
+    if ( strike_index >= (FT_ULong)face->sbit_num_strikes )
+      return FT_THROW( Invalid_Argument );
 
+    switch ( (FT_UInt)face->sbit_table_type )
+    {
+    case TT_SBIT_TABLE_TYPE_EBLC:
+    case TT_SBIT_TABLE_TYPE_CBLC:
+      {
+        FT_Byte*  strike;
 
-    if ( FT_READ_ULONG( range->image_size ) )
-      return error;
 
-    return FT_STREAM_READ_FIELDS( sbit_metrics_fields, &range->metrics );
+        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;
+
+        /* 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;
+      }
+
+    case TT_SBIT_TABLE_TYPE_SBIX:
+      {
+        FT_Stream       stream = face->root.stream;
+        FT_UInt         offset, upem;
+        FT_UShort       ppem, resolution;
+        TT_HoriHeader  *hori;
+        FT_ULong        table_size;
+
+        FT_Error  error;
+        FT_Byte*  p;
+
+
+        p      = face->sbit_table + 8 + 4 * strike_index;
+        offset = FT_NEXT_ULONG( p );
+
+        error = face->goto_table( face, TTAG_sbix, stream, &table_size );
+        if ( error )
+          return error;
+
+        if ( offset + 4  > table_size )
+          return FT_THROW( Invalid_File_Format );
+
+        if ( FT_STREAM_SEEK( FT_STREAM_POS() + offset ) ||
+             FT_FRAME_ENTER( 4 )                        )
+          return error;
+
+        ppem       = FT_GET_USHORT();
+        resolution = FT_GET_USHORT();
+
+        FT_UNUSED( resolution ); /* What to do with this? */
+
+        FT_FRAME_EXIT();
+
+        upem = face->header.Units_Per_EM;
+        hori = &face->horizontal;
+
+        metrics->x_ppem = ppem;
+        metrics->y_ppem = ppem;
+
+        metrics->ascender    = ppem * hori->Ascender * 64 / upem;
+        metrics->descender   = ppem * hori->Descender * 64 / upem;
+        metrics->height      = ppem * ( hori->Ascender -
+                                        hori->Descender +
+                                        hori->Line_Gap ) * 64 / upem;
+        metrics->max_advance = ppem * hori->advance_Width_Max * 64 / upem;
+
+        return error;
+      }
+
+    default:
+      return FT_THROW( Unknown_File_Format );
+    }
   }
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <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.                             */
-  /*                                                                       */
+  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
-  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_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;
 
-    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;
+
+      /* decoder->strike_index_array +                               */
+      /*   8 * decoder->strike_index_count > face->sbit_table_size ? */
+      if ( decoder->strike_index_array > face->sbit_table_size           ||
+           decoder->strike_index_count >
+             ( face->sbit_table_size - decoder->strike_index_array ) / 8 )
+        error = FT_THROW( Invalid_File_Format );
+    }
 
   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_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;
 
-    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:
-      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 5:
-      error = Load_SBit_Const_Metrics( range, stream );
-      if ( !error )
-        error = Load_SBit_Range_Codes( range, stream, 0 );
+    case 8:
+      map->pixel_mode = FT_PIXEL_MODE_GRAY;
+      map->pitch      = map->width;
+      map->num_grays  = 256;
+      break;
+
+    case 32:
+      map->pixel_mode = FT_PIXEL_MODE_BGRA;
+      map->pitch      = map->width * 4;
+      map->num_grays  = 256;
       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;
   }
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <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[] =
-    {
-      /* 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 + 5 > limit )
+      goto Fail;
 
-    face->num_sbit_strikes = 0;
+    metrics->height       = p[0];
+    metrics->width        = p[1];
+    metrics->horiBearingX = (FT_Char)p[2];
+    metrics->horiBearingY = (FT_Char)p[3];
+    metrics->horiAdvance  = p[4];
 
-    /* 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;
+    p += 5;
+    if ( big )
+    {
+      if ( p + 3 > limit )
+        goto Fail;
 
-    table_base = FT_STREAM_POS();
-    if ( FT_FRAME_ENTER( 8L ) )
-      goto Exit;
+      metrics->vertBearingX = (FT_Char)p[0];
+      metrics->vertBearingY = (FT_Char)p[1];
+      metrics->vertAdvance  = p[2];
+
+      p += 3;
+    }
+    else
+    {
+      /* avoid uninitialized data in case there is no vertical info -- */
+      metrics->vertBearingX = 0;
+      metrics->vertBearingY = 0;
+      metrics->vertAdvance  = 0;
+    }
 
-    version     = FT_GET_LONG();
-    num_strikes = FT_GET_ULONG();
+    decoder->metrics_loaded = 1;
+    *pp = p;
+    return FT_Err_Ok;
 
-    FT_FRAME_EXIT();
+  Fail:
+    FT_TRACE1(( "tt_sbit_decoder_load_metrics: broken table\n" ));
+    return FT_THROW( Invalid_Argument );
+  }
 
-    /* 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;
 
-      goto Exit;
-    }
+  /* 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 );
 
-    /* allocate the strikes table */
-    if ( FT_NEW_ARRAY( face->sbit_strikes, num_strikes ) )
-      goto Exit;
+  typedef FT_Error  (*TT_SBitDecoder_LoadFunc)( TT_SBitDecoder  decoder,
+                                                FT_Byte*        p,
+                                                FT_Byte*        plimit,
+                                                FT_Int          x_pos,
+                                                FT_Int          y_pos );
 
-    face->num_sbit_strikes = num_strikes;
 
-    /* now read each strike table separately */
-    {
-      TT_SBit_Strike  strike = face->sbit_strikes;
-      FT_ULong        count  = num_strikes;
+  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 = FT_Err_Ok;
+    FT_Byte*    line;
+    FT_Int      bit_height, bit_width, pitch, width, height, line_bits, h;
+    FT_Bitmap*  bitmap;
 
 
-      if ( FT_FRAME_ENTER( 48L * num_strikes ) )
-        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;
 
-      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++;
-      }
+    width  = decoder->metrics->width;
+    height = decoder->metrics->height;
 
-      FT_FRAME_EXIT();
+    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_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:
+    if ( !error )
+      FT_TRACE3(( "tt_sbit_decoder_load_byte_aligned: loaded\n" ));
     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 )
-  {
-    FT_Memory       memory       = face->root.memory;
-    TT_SBit_Strike  strike       = face->sbit_strikes;
-    TT_SBit_Strike  strike_limit = strike + face->num_sbit_strikes;
-
-
-    if ( strike )
-    {
-      for ( ; strike < strike_limit; strike++ )
-      {
-        TT_SBit_Range  range       = strike->sbit_ranges;
-        TT_SBit_Range  range_limit = range + strike->num_ranges;
-
-
-        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 );
-    }
-    face->num_sbit_strikes = 0;
-  }
-
+  /*
+   * 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
+   *
+   */
 
-  FT_LOCAL_DEF( FT_Error )
-  tt_face_set_sbit_strike( TT_Face          face,
-                           FT_Size_Request  req,
-                           FT_ULong*        astrike_index )
+  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 )
   {
-    return FT_Match_Size( (FT_Face)face, req, 0, astrike_index );
-  }
+    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_LOCAL_DEF( FT_Error )
-  tt_face_load_strike_metrics( TT_Face           face,
-                               FT_ULong          strike_index,
-                               FT_Size_Metrics*  metrics )
-  {
-    TT_SBit_Strike  strike;
+    /* 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 ( strike_index >= face->num_sbit_strikes )
-      return SFNT_Err_Invalid_Argument;
+    line_bits = width * decoder->bit_depth;
 
-    strike = face->sbit_strikes + strike_index;
+    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;
+    }
 
-    metrics->x_ppem = strike->x_ppem;
-    metrics->y_ppem = strike->y_ppem;
+    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;
+    }
 
-    metrics->ascender  = strike->hori.ascender << 6;
-    metrics->descender = strike->hori.descender << 6;
+    /* now do the blit */
 
-    /* XXX: Is this correct? */
-    metrics->max_advance = ( strike->hori.min_origin_SB  +
-                             strike->hori.max_width      +
-                             strike->hori.min_advance_SB ) << 6;
+    /* adjust `line' to point to the first byte of the bitmap */
+    line  += y_pos * pitch + ( x_pos >> 3 );
+    x_pos &= 7;
 
-    metrics->height = metrics->ascender - metrics->descender;
+    /* the higher byte of `rval' is used as a buffer */
+    rval  = 0;
+    nbits = 0;
 
-    return SFNT_Err_Ok;
-  }
+    for ( h = height; h > 0; h--, line += pitch )
+    {
+      FT_Byte*  pwrite = line;
+      FT_Int    w      = line_bits;
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <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
-  find_sbit_range( FT_UInt          glyph_index,
-                   TT_SBit_Strike   strike,
-                   TT_SBit_Range   *arange,
-                   FT_ULong        *aglyph_offset )
-  {
-    TT_SBit_RangeRec  *range, *range_limit;
+      /* handle initial byte (in target bitmap) specially if necessary */
+      if ( x_pos )
+      {
+        w = ( line_bits < 8 - x_pos ) ? line_bits : 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;
+        }
 
-    /* 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;
+        *pwrite++ |= ( ( rval >> nbits ) & 0xFF ) &
+                     ( ~( 0xFF << w ) << ( 8 - w - x_pos ) );
+        rval     <<= 8;
 
-    /* scan all ranges in strike */
-    range       = strike->sbit_ranges;
-    range_limit = range + strike->num_ranges;
-    if ( !range )
-      goto Fail;
+        w = line_bits - w;
+      }
 
-    for ( ; range < range_limit; range++ )
-    {
-      if ( glyph_index >= (FT_UInt)range->first_glyph &&
-           glyph_index <= (FT_UInt)range->last_glyph  )
+      /* handle medial bytes */
+      for ( ; w >= 8; w -= 8 )
       {
-        FT_UShort  delta = (FT_UShort)( glyph_index - range->first_glyph );
+        rval      |= *p++;
+        *pwrite++ |= ( rval >> nbits ) & 0xFF;
 
+        rval <<= 8;
+      }
 
-        switch ( range->index_format )
+      /* handle final byte if necessary */
+      if ( w > 0 )
+      {
+        if ( nbits < w )
         {
-        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;
-              }
-            }
-          }
+          if ( p < limit )
+            rval |= *p++;
+          *pwrite |= ( ( rval >> nbits ) & 0xFF ) & ( 0xFF00U >> w );
+          nbits   += 8 - w;
 
-        /* fall-through */
-        default:
-          goto Fail;
+          rval <<= 8;
+        }
+        else
+        {
+          *pwrite |= ( ( rval >> nbits ) & 0xFF ) & ( 0xFF00U >> w );
+          nbits   -= w;
         }
-
-      Found:
-        /* return successfully! */
-        *arange  = range;
-        return SFNT_Err_Ok;
       }
     }
 
-  Fail:
-    *arange        = 0;
-    *aglyph_offset = 0;
-
-    return SFNT_Err_Invalid_Argument;
+  Exit:
+    if ( !error )
+      FT_TRACE3(( "tt_sbit_decoder_load_bit_aligned: loaded\n" ));
+    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 )
+  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;
-    TT_SBit_Strike  strike;
+    FT_Error  error = FT_Err_Ok;
+    FT_UInt   num_components, nn;
+
+    FT_Char  horiBearingX = (FT_Char)decoder->metrics->horiBearingX;
+    FT_Char  horiBearingY = (FT_Char)decoder->metrics->horiBearingY;
+    FT_Byte  horiAdvance  = (FT_Byte)decoder->metrics->horiAdvance;
+    FT_Char  vertBearingX = (FT_Char)decoder->metrics->vertBearingX;
+    FT_Char  vertBearingY = (FT_Char)decoder->metrics->vertBearingY;
+    FT_Byte  vertAdvance  = (FT_Byte)decoder->metrics->vertAdvance;
 
 
-    if ( !face->sbit_strikes                        ||
-         ( face->num_sbit_strikes <= strike_index ) )
+    if ( p + 2 > limit )
+      goto Fail;
+
+    num_components = FT_NEXT_USHORT( p );
+    if ( p + 4 * num_components > limit )
+    {
+      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 ));
+
+    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 );
+
 
-    strike = &face->sbit_strikes[strike_index];
+      /* NB: a recursive call */
+      error = tt_sbit_decoder_load_image( decoder, gindex,
+                                          x_pos + dx, y_pos + dy );
+      if ( error )
+        break;
+    }
 
-    error = find_sbit_range( glyph_index, strike,
-                             arange, aglyph_offset );
-    if ( error )
-      goto Fail;
+    FT_TRACE3(( "tt_sbit_decoder_load_compound: done\n" ));
 
-    *astrike = strike;
+    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;
 
-    return SFNT_Err_Ok;
+  Exit:
+    return error;
 
   Fail:
-    /* no embedded bitmap for this glyph in face */
-    *arange        = 0;
-    *astrike       = 0;
-    *aglyph_offset = 0;
-
-    return SFNT_Err_Invalid_Argument;
+    error = FT_THROW( Invalid_File_Format );
+    goto Exit;
   }
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <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 )
+#ifdef FT_CONFIG_OPTION_USE_PNG
+
+  static FT_Error
+  tt_sbit_decoder_load_png( TT_SBitDecoder  decoder,
+                            FT_Byte*        p,
+                            FT_Byte*        limit,
+                            FT_Int          x_pos,
+                            FT_Int          y_pos )
   {
-    FT_Error  error = SFNT_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
+    FT_ULong  png_len;
 
 
-    switch ( range->image_format )
+    if ( limit - p < 4 )
     {
-    case 1:
-    case 2:
-    case 8:
-      /* variable small metrics */
-      {
-        TT_SBit_SmallMetricsRec  smetrics;
+      FT_TRACE1(( "tt_sbit_decoder_load_png: broken bitmap\n" ));
+      error = FT_THROW( Invalid_File_Format );
+      goto Exit;
+    }
 
-        static const FT_Frame_Field  sbit_small_metrics_fields[] =
-        {
-#undef  FT_STRUCTURE
-#define FT_STRUCTURE  TT_SBit_SmallMetricsRec
+    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->face->root.glyph,
+                           x_pos,
+                           y_pos,
+                           decoder->bit_depth,
+                           decoder->metrics,
+                           decoder->stream->memory,
+                           p,
+                           png_len,
+                           FALSE );
+
+  Exit:
+    if ( !error )
+      FT_TRACE3(( "tt_sbit_decoder_load_png: loaded\n" ));
+    return error;
+  }
 
-          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
-        };
+#endif /* FT_CONFIG_OPTION_USE_PNG */
 
 
-        /* read small metrics */
-        if ( FT_STREAM_READ_FIELDS( sbit_small_metrics_fields, &smetrics ) )
-          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;
 
-        /* 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;
-      }
+
+    /* 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 17:
+      error = tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 0 );
       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;
 
-    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;
+      case 1:
+      case 6:
+        loader = tt_sbit_decoder_load_byte_aligned;
+        break;
 
+      case 2:
+      case 7:
+        {
+          /* Don't trust `glyph_format'.  For example, Apple's main Korean */
+          /* system font, `AppleMyungJo.ttf' (version 7.0d2e6), uses glyph */
+          /* format 7, but the data is format 6.  We check whether we have */
+          /* an excessive number of bytes in the image: If it is equal to  */
+          /* the value for a byte-aligned glyph, use the other loading     */
+          /* routine.                                                      */
+          /*                                                               */
+          /* Note that for some (width,height) combinations, where the     */
+          /* width is not a multiple of 8, the sizes for bit- and          */
+          /* byte-aligned data are equal, for example (7,7) or (15,6).  We */
+          /* then prefer what `glyph_format' specifies.                    */
+
+          FT_UInt  width  = decoder->metrics->width;
+          FT_UInt  height = decoder->metrics->height;
+
+          FT_UInt  bit_size  = ( width * height + 7 ) >> 3;
+          FT_UInt  byte_size = height * ( ( width + 7 ) >> 3 );
+
+
+          if ( bit_size < byte_size                  &&
+               byte_size == (FT_UInt)( p_limit - p ) )
+            loader = tt_sbit_decoder_load_byte_aligned;
+          else
+            loader = tt_sbit_decoder_load_bit_aligned;
+        }
+        break;
 
-        for ( ; cur < limit; cur++ )
-          if ( cur[0] )
-            goto Found_Top;
+      case 5:
+        loader = tt_sbit_decoder_load_bit_aligned;
+        break;
 
-        /* the current line was empty - skip to next one */
-        line  = limit;
-      }
+      case 8:
+        if ( p + 1 > p_limit )
+          goto Fail;
 
-    Found_Top:
-      /* check that we have at least one filled line */
-      if ( count >= rows )
-        goto Empty_Bitmap;
+        p += 1;  /* skip padding */
+        /* fall-through */
 
-      /* now, crop the empty upper lines */
-      if ( count > 0 )
-      {
-        line = (FT_Byte*)map->buffer;
+      case 9:
+        loader = tt_sbit_decoder_load_compound;
+        break;
 
-        FT_MEM_MOVE( line, line + count * line_len,
-                     ( rows - count ) * line_len );
+      case 17: /* small metrics, PNG image data   */
+      case 18: /* big metrics, PNG image data     */
+      case 19: /* metrics in EBLC, PNG image data */
+#ifdef FT_CONFIG_OPTION_USE_PNG
+        loader = tt_sbit_decoder_load_png;
+        break;
+#else
+        error = FT_THROW( Unimplemented_Feature );
+        goto Fail;
+#endif /* FT_CONFIG_OPTION_USE_PNG */
 
-        metrics->height       = (FT_Byte)( metrics->height - count );
-        metrics->horiBearingY = (FT_Char)( metrics->horiBearingY - count );
-        metrics->vertBearingY = (FT_Char)( metrics->vertBearingY - count );
+      default:
+        error = FT_THROW( Invalid_Table );
+        goto Fail;
+      }
 
-        map->rows -= count;
-        rows      -= count;
+      if ( !decoder->bitmap_allocated )
+      {
+        error = tt_sbit_decoder_alloc_bitmap( decoder );
+        if ( error )
+          goto Fail;
       }
+
+      error = loader( decoder, p, p_limit, x_pos, y_pos );
     }
 
-    /***********************************************************************/
-    /*                                                                     */
-    /* second, crop the lower lines                                        */
-    /*                                                                     */
-    {
-      line = (FT_Byte*)map->buffer + ( rows - 1 ) * line_len;
+  Fail:
+    FT_FRAME_RELEASE( data );
 
-      for ( count = 0; count < rows; count++ )
-      {
-        FT_Byte*  cur   = line;
-        FT_Byte*  limit = line + line_len;
+  Exit:
+    return error;
+  }
 
 
-        for ( ; cur < limit; cur++ )
-          if ( cur[0] )
-            goto Found_Bottom;
+  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.
+     */
 
-        /* the current line was empty - skip to previous one */
-        line -= line_len;
-      }
+    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;
 
-    Found_Bottom:
-      if ( count > 0 )
-      {
-        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
+    for ( ; num_ranges > 0; num_ranges-- )
     {
-      FT_Byte*  limit;
+      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 );
 
-      line  = (FT_Byte*)map->buffer;
-      limit = line + rows * line_len;
+    /* overflow check */
+    p = decoder->eblc_base + decoder->strike_index_array;
+    if ( image_offset > (FT_ULong)( p_limit - p ) )
+      goto Failure;
+
+    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 ( index_format )
+    {
+    case 1: /* 4-byte offsets relative to `image_offset' */
+      p += 4 * ( glyph_index - start );
+      if ( p + 8 > p_limit )
+        goto NoBitmap;
 
-      for ( ; line < limit; line += line_len )
-        if ( line[0] & 0x80 )
-          goto Found_Left;
+      image_start = FT_NEXT_ULONG( p );
+      image_end   = FT_NEXT_ULONG( p );
 
-      /* shift the whole glyph one pixel to the left */
-      line  = (FT_Byte*)map->buffer;
-      limit = line + rows * line_len;
+      if ( image_start == image_end )  /* missing glyph */
+        goto NoBitmap;
+      break;
 
-      for ( ; line < limit; line += line_len )
+    case 2: /* big metrics, constant image size */
       {
-        FT_Int    n, width = map->width;
-        FT_Byte   old;
-        FT_Byte*  cur = line;
+        FT_ULong  image_size;
 
 
-        old = (FT_Byte)(cur[0] << 1);
-        for ( n = 8; n < width; n += 8 )
-        {
-          FT_Byte  val;
+        if ( p + 12 > p_limit )
+          goto NoBitmap;
 
+        image_size = FT_NEXT_ULONG( p );
 
-          val    = cur[1];
-          cur[0] = (FT_Byte)( old | ( val >> 7 ) );
-          old    = (FT_Byte)( val << 1 );
-          cur++;
-        }
-        cur[0] = old;
+        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;
 
-      map->width--;
-      metrics->horiBearingX++;
-      metrics->vertBearingX++;
-      metrics->width--;
+    case 3: /* 2-byte offsets relative to 'image_offset' */
+      p += 2 * ( glyph_index - start );
+      if ( p + 4 > p_limit )
+        goto NoBitmap;
 
-    } while ( map->width > 0 );
+      image_start = FT_NEXT_USHORT( p );
+      image_end   = FT_NEXT_USHORT( p );
 
-  Found_Left:
+      if ( image_start == image_end )  /* missing glyph */
+        goto NoBitmap;
+      break;
 
-    /***********************************************************************/
-    /*                                                                     */
-    /* 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;
+    case 4: /* sparse glyph array with (glyph,offset) pairs */
+      {
+        FT_ULong  mm, num_glyphs;
 
 
-      line  = (FT_Byte*)map->buffer + ( right >> 3 );
-      limit = line + rows * line_len;
-      mask  = (FT_Byte)( 0x80 >> ( right & 7 ) );
+        if ( p + 4 > p_limit )
+          goto NoBitmap;
 
-      for ( ; line < limit; line += line_len )
-        if ( line[0] & mask )
-          goto Found_Right;
+        num_glyphs = FT_NEXT_ULONG( p );
 
-      /* crop the whole glyph to the right */
-      map->width--;
-      metrics->width--;
+        /* overflow check for p + ( num_glyphs + 1 ) * 4 */
+        if ( p + 4 > p_limit                                         ||
+             num_glyphs > (FT_ULong)( ( ( p_limit - p ) >> 2 ) - 1 ) )
+          goto NoBitmap;
 
-    } while ( map->width > 0 );
+        for ( mm = 0; mm < num_glyphs; mm++ )
+        {
+          FT_UInt  gindex = FT_NEXT_USHORT( p );
 
-  Found_Right:
-    /* all right, the bitmap was cropped */
-    return;
 
-  Empty_Bitmap:
-    map->width      = 0;
-    map->rows       = 0;
-    map->pitch      = 0;
-    map->pixel_mode = FT_PIXEL_MODE_MONO;
-  }
+          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 */
+    case 19:
+      {
+        FT_ULong  image_size, mm, num_glyphs;
 
-  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 )
-  {
-    FT_Error  error;
 
+        if ( p + 16 > p_limit )
+          goto NoBitmap;
 
-    /* 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  )
-    {
-      error = SFNT_Err_Invalid_Argument;
+        image_size = FT_NEXT_ULONG( p );
 
-      goto Exit;
-    }
+        if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) )
+          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;
+        num_glyphs = FT_NEXT_ULONG( p );
 
+        /* overflow check for p + 2 * num_glyphs */
+        if ( num_glyphs > (FT_ULong)( ( p_limit - p ) >> 1 ) )
+          goto NoBitmap;
 
-      /* compute size of glyph image */
-      switch ( image_format )
-      {
-      case 1:  /* byte-padded formats */
-      case 6:
+        for ( mm = 0; mm < num_glyphs; mm++ )
         {
-          FT_Int  line_length;
+          FT_UInt  gindex = FT_NEXT_USHORT( p );
 
 
-          switch ( pix_bits )
-          {
-          case 1:
-            line_length = ( glyph_width + 7 ) >> 3;
+          if ( gindex == glyph_index )
             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;
 
-      case 2:
-      case 5:
-      case 7:
-        line_bits  =   glyph_width  * pix_bits;
-        glyph_size = ( glyph_height * line_bits + 7 ) >> 3;
-        break;
+        if ( mm >= num_glyphs )
+          goto NoBitmap;
 
-      default:  /* invalid format */
-        return SFNT_Err_Invalid_File_Format;
+        image_start = image_size * mm;
+        image_end   = image_start + image_size;
       }
+      break;
 
-      /* Now read data and draw glyph into target pixmap       */
-      if ( FT_FRAME_ENTER( glyph_size ) )
-        goto Exit;
+    default:
+      goto NoBitmap;
+    }
 
-      /* 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 );
+    if ( image_start > image_end )
+      goto NoBitmap;
 
-      FT_FRAME_EXIT();
-    }
+    image_end  -= image_start;
+    image_start = image_offset + image_start;
 
-  Exit:
-    return error;
+    FT_TRACE3(( "tt_sbit_decoder_load_image:"
+                " found sbit (format %d) for glyph index %d\n",
+                image_format, glyph_index ));
+
+    return tt_sbit_decoder_load_bitmap( decoder,
+                                        image_format,
+                                        image_start,
+                                        image_end,
+                                        x_pos,
+                                        y_pos );
+
+  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 );
   }
 
 
   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 )
+  tt_face_load_sbix_image( TT_Face              face,
+                           FT_ULong             strike_index,
+                           FT_UInt              glyph_index,
+                           FT_Stream            stream,
+                           FT_Bitmap           *map,
+                           TT_SBit_MetricsRec  *metrics )
   {
-    FT_Memory   memory = stream->memory;
-    FT_Bitmap*  map    = &slot->bitmap;
-    FT_Error    error;
+    FT_UInt   sbix_pos, strike_offset, glyph_start, glyph_end;
+    FT_ULong  table_size;
+    FT_Int    originOffsetX, originOffsetY;
+    FT_Tag    graphicType;
+    FT_Int    recurse_depth = 0;
 
+    FT_Error  error;
+    FT_Byte*  p;
 
-    /* place stream at beginning of glyph data and read metrics */
-    if ( FT_STREAM_SEEK( ebdt_pos + glyph_offset ) )
-      goto Exit;
+    FT_UNUSED( map );
 
-    error = tt_load_sbit_metrics( stream, range, metrics );
-    if ( error )
-      goto Exit;
 
-    /* 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;
+    metrics->width  = 0;
+    metrics->height = 0;
 
+    p = face->sbit_table + 8 + 4 * strike_index;
+    strike_offset = FT_NEXT_ULONG( p );
 
-      map->width = metrics->width;
-      map->rows  = metrics->height;
+    error = face->goto_table( face, TTAG_sbix, stream, &table_size );
+    if ( error )
+      return error;
+    sbix_pos = FT_STREAM_POS();
 
-      switch ( strike->bit_depth )
-      {
-      case 1:
-        map->pixel_mode = FT_PIXEL_MODE_MONO;
-        map->pitch      = ( map->width + 7 ) >> 3;
-        break;
+  retry:
+    if ( glyph_index > (FT_UInt)face->root.num_glyphs )
+      return FT_THROW( Invalid_Argument );
 
-      case 2:
-        map->pixel_mode = FT_PIXEL_MODE_GRAY2;
-        map->pitch      = ( map->width + 3 ) >> 2;
-        break;
+    if ( strike_offset >= table_size                          ||
+         table_size - strike_offset < 4 + glyph_index * 4 + 8 )
+      return FT_THROW( Invalid_File_Format );
 
-      case 4:
-        map->pixel_mode = FT_PIXEL_MODE_GRAY4;
-        map->pitch      = ( map->width + 1 ) >> 1;
-        break;
+    if ( FT_STREAM_SEEK( sbix_pos + strike_offset + 4 + glyph_index * 4 ) ||
+         FT_FRAME_ENTER( 8 )                                              )
+      return error;
 
-      case 8:
-        map->pixel_mode = FT_PIXEL_MODE_GRAY;
-        map->pitch      = map->width;
-        break;
+    glyph_start = FT_GET_ULONG();
+    glyph_end   = FT_GET_ULONG();
 
-      default:
-        return SFNT_Err_Invalid_File_Format;
-      }
+    FT_FRAME_EXIT();
 
-      size = map->rows * map->pitch;
+    if ( glyph_start == glyph_end )
+      return FT_THROW( Invalid_Argument );
+    if ( glyph_start > glyph_end                ||
+         glyph_end - glyph_start < 8            ||
+         table_size - strike_offset < glyph_end )
+      return FT_THROW( Invalid_File_Format );
 
-      /* check that there is no empty image */
-      if ( size == 0 )
-        goto Exit;     /* exit successfully! */
+    if ( FT_STREAM_SEEK( sbix_pos + strike_offset + glyph_start ) ||
+         FT_FRAME_ENTER( glyph_end - glyph_start )                )
+      return error;
 
-      error = ft_glyphslot_alloc_bitmap( slot, size );
-      if (error)
-        goto Exit;
-    }
+    originOffsetX = FT_GET_SHORT();
+    originOffsetY = FT_GET_SHORT();
 
-    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 );
+    graphicType = FT_GET_TAG4();
 
-    case 8:  /* compound format */
-      if ( FT_STREAM_SKIP( 1L ) )
+    switch ( graphicType )
+    {
+    case FT_MAKE_TAG( 'd', 'u', 'p', 'e' ):
+      if ( recurse_depth < 4 )
       {
-        error = SFNT_Err_Invalid_Stream_Skip;
-        goto Exit;
+        glyph_index = FT_GET_USHORT();
+        FT_FRAME_EXIT();
+        recurse_depth++;
+        goto retry;
       }
-      /* fallthrough */
-
-    case 9:
+      error = FT_THROW( Invalid_File_Format );
       break;
 
-    default: /* invalid image format */
-      return SFNT_Err_Invalid_File_Format;
-    }
-
-    /* All right, we have a compound format.  First of all, read */
-    /* the array of elements.                                    */
-    {
-      TT_SBit_Component  components = NULL;
-      TT_SBit_Component  comp;
-      FT_UShort          num_components, count;
-
-
-      if ( FT_READ_USHORT( num_components )           ||
-           FT_NEW_ARRAY( components, num_components ) )
-        goto Exit;
-
-      count = num_components;
+    case FT_MAKE_TAG( 'p', 'n', 'g', ' ' ):
+#ifdef FT_CONFIG_OPTION_USE_PNG
+      error = Load_SBit_Png( face->root.glyph,
+                             0,
+                             0,
+                             32,
+                             metrics,
+                             stream->memory,
+                             stream->cursor,
+                             glyph_end - glyph_start - 8,
+                             TRUE );
+#else
+      error = FT_THROW( Unimplemented_Feature );
+#endif
+      break;
 
-      if ( FT_FRAME_ENTER( 4L * num_components ) )
-        goto Fail_Memory;
+    case FT_MAKE_TAG( 'j', 'p', 'g', ' ' ):
+    case FT_MAKE_TAG( 't', 'i', 'f', 'f' ):
+    case FT_MAKE_TAG( 'r', 'g', 'b', 'l' ): /* used on iOS 7.1 */
+      error = FT_THROW( Unknown_File_Format );
+      break;
 
-      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();
-      }
+    default:
+      error = FT_THROW( Unimplemented_Feature );
+      break;
+    }
 
-      FT_FRAME_EXIT();
+    FT_FRAME_EXIT();
 
-      /* 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 ( !error )
+    {
+      FT_Short   abearing;
+      FT_UShort  aadvance;
 
 
-        /* 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;
-      }
+      tt_face_get_metrics( face, FALSE, glyph_index, &abearing, &aadvance );
 
-    Fail_Memory:
-      FT_FREE( components );
+      metrics->horiBearingX = (FT_Short)originOffsetX;
+      metrics->horiBearingY = (FT_Short)( -originOffsetY + metrics->height );
+      metrics->horiAdvance  = (FT_Short)( aadvance *
+                                          face->root.size->metrics.x_ppem /
+                                          face->header.Units_Per_EM );
     }
 
-  Exit:
     return error;
   }
 
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <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,
                            FT_Bitmap           *map,
                            TT_SBit_MetricsRec  *metrics )
   {
-    FT_Error        error;
-    FT_ULong        ebdt_pos, glyph_offset;
+    FT_Error  error = FT_Err_Ok;
 
-    TT_SBit_Strike  strike;
-    TT_SBit_Range   range;
 
+    switch ( (FT_UInt)face->sbit_table_type )
+    {
+    case TT_SBIT_TABLE_TYPE_EBLC:
+    case TT_SBIT_TABLE_TYPE_CBLC:
+      {
+        TT_SBitDecoderRec  decoder[1];
 
-    /* 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;
+        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 );
+        }
+      }
+      break;
 
-    ebdt_pos = FT_STREAM_POS();
+    case TT_SBIT_TABLE_TYPE_SBIX:
+      error = tt_face_load_sbix_image( face,
+                                       strike_index,
+                                       glyph_index,
+                                       stream,
+                                       map,
+                                       metrics );
+      break;
 
-    error = Load_SBit_Image( strike, range, ebdt_pos, glyph_offset,
-                             face->root.glyph, 0, 0, stream, metrics, 0 );
-    if ( error )
-      goto Exit;
+    default:
+      error = FT_THROW( Unknown_File_Format );
+      break;
+    }
 
-    /* setup vertical metrics if needed */
-    if ( strike->flags & 1 )
+    /* Flatten color bitmaps if color was not requested. */
+    if ( !error                                &&
+         !( load_flags & FT_LOAD_COLOR )       &&
+         map->pixel_mode == FT_PIXEL_MODE_BGRA )
     {
-      /* in case of a horizontal strike only */
-      FT_Int  advance;
+      FT_Bitmap   new_map;
+      FT_Library  library = face->root.glyph->library;
 
 
-      advance = strike->hori.ascender - strike->hori.descender;
+      FT_Bitmap_New( &new_map );
 
-      /* some heuristic values */
+      /* Convert to 8bit grayscale. */
+      error = FT_Bitmap_Convert( library, map, &new_map, 1 );
+      if ( error )
+        FT_Bitmap_Done( library, &new_map );
+      else
+      {
+        map->pixel_mode = new_map.pixel_mode;
+        map->pitch      = new_map.pitch;
+        map->num_grays  = new_map.num_grays;
 
-      metrics->vertBearingX = (FT_Char)(-metrics->width / 2 );
-      metrics->vertBearingY = (FT_Char)( ( advance - metrics->height ) / 2 );
-      metrics->vertAdvance  = (FT_Char)( advance * 12 / 10 );
+        ft_glyphslot_set_bitmap( face->root.glyph, new_map.buffer );
+        face->root.glyph->internal->flags |= FT_GLYPH_OWN_BITMAP;
+      }
     }
 
-    /* Crop the bitmap now, unless specified otherwise */
-    if ( load_flags & FT_LOAD_CROP_BITMAP )
-      crop_bitmap( map, metrics );
-
-  Exit:
     return error;
   }
 
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
 
-/* END */
+/* EOF */
index 7ea2af1..695d0d8 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -28,11 +28,11 @@ FT_BEGIN_HEADER
 
 
   FT_LOCAL( FT_Error )
-  tt_face_load_eblc( TT_Face    face,
+  tt_face_load_sbit( TT_Face    face,
                      FT_Stream  stream );
 
   FT_LOCAL( void )
-  tt_face_free_eblc( TT_Face  face );
+  tt_face_free_sbit( TT_Face  face );
 
 
   FT_LOCAL( FT_Error )
@@ -45,22 +45,6 @@ FT_BEGIN_HEADER
                                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,
diff --git a/src/sfnt/ttsbit0.c b/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 */
index 4c0eea5..131ad27 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    A new `perfect' anti-aliasing renderer (body).                       */
 /*                                                                         */
-/*  Copyright 2000-2003, 2005-2012 by                                      */
+/*  Copyright 2000-2003, 2005-2014 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -24,8 +24,8 @@
   /*                                                                       */
   /* - copy `src/smooth/ftgrays.c' (this file) to your current directory   */
   /*                                                                       */
-  /* - copy `include/freetype/ftimage.h' and `src/smooth/ftgrays.h' to the */
-  /*   same directory                                                      */
+  /* - copy `include/ftimage.h' and `src/smooth/ftgrays.h' to the same     */
+  /*   directory                                                           */
   /*                                                                       */
   /* - compile `ftgrays' with the _STANDALONE_ macro defined, as in        */
   /*                                                                       */
 #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 FT_BEGIN_STMNT  do {
+#define FT_END_STMNT    } while ( 0 )
+
+
   /* define this to dump debugging information */
 /* #define FT_DEBUG_LEVEL_TRACE */
 
@@ -154,6 +162,21 @@ typedef ptrdiff_t  FT_PtrDist;
     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
@@ -165,11 +188,19 @@ typedef ptrdiff_t  FT_PtrDist;
 #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 */
+#define FT_THROW( e )   FT_ERR_CAT( ErrRaster_, e )
+
 
 #endif /* !FT_DEBUG_LEVEL_TRACE */
 
@@ -202,6 +233,7 @@ typedef ptrdiff_t  FT_PtrDist;
             raster_done_                                          \
          };
 
+
 #else /* !_STANDALONE_ */
 
 
@@ -215,13 +247,14 @@ typedef ptrdiff_t  FT_PtrDist;
 
 #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_Invalid_Argument  Smooth_Err_Invalid_Argument
+
 
 #endif /* !_STANDALONE_ */
 
+
 #ifndef FT_MEM_SET
 #define FT_MEM_SET( d, s, c )  ft_memset( d, s, c )
 #endif
@@ -280,6 +313,40 @@ typedef ptrdiff_t  FT_PtrDist;
 #endif
 
 
+  /* Compute `dividend / divisor' and return both its quotient and     */
+  /* remainder, cast to a specific type.  This macro also ensures that */
+  /* the remainder is always positive.                                 */
+#define FT_DIV_MOD( type, dividend, divisor, quotient, remainder ) \
+  FT_BEGIN_STMNT                                                   \
+    (quotient)  = (type)( (dividend) / (divisor) );                \
+    (remainder) = (type)( (dividend) % (divisor) );                \
+    if ( (remainder) < 0 )                                         \
+    {                                                              \
+      (quotient)--;                                                \
+      (remainder) += (type)(divisor);                              \
+    }                                                              \
+  FT_END_STMNT
+
+#ifdef  __arm__
+  /* Work around a bug specific to GCC which make the compiler fail to */
+  /* optimize a division and modulo operation on the same parameters   */
+  /* into a single call to `__aeabi_idivmod'.  See                     */
+  /*                                                                   */
+  /*  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43721                */
+#undef FT_DIV_MOD
+#define FT_DIV_MOD( type, dividend, divisor, quotient, remainder ) \
+  FT_BEGIN_STMNT                                                   \
+    (quotient)  = (type)( (dividend) / (divisor) );                \
+    (remainder) = (type)( (dividend) - (quotient) * (divisor) );   \
+    if ( (remainder) < 0 )                                         \
+    {                                                              \
+      (quotient)--;                                                \
+      (remainder) += (type)(divisor);                              \
+    }                                                              \
+  FT_END_STMNT
+#endif /* __arm__ */
+
+
   /*************************************************************************/
   /*                                                                       */
   /*   TYPE DEFINITIONS                                                    */
@@ -312,7 +379,7 @@ typedef ptrdiff_t  FT_PtrDist;
 #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
 
 
@@ -328,8 +395,18 @@ typedef ptrdiff_t  FT_PtrDist;
   } TCell;
 
 
+#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_
   {
+    ft_jmp_buf  jump_buffer;
+
     TCoord  ex, ey;
     TPos    min_ex, max_ex;
     TPos    min_ey, max_ey;
@@ -365,8 +442,6 @@ typedef ptrdiff_t  FT_PtrDist;
     int  band_size;
     int  band_shoot;
 
-    ft_jmp_buf  jump_buffer;
-
     void*       buffer;
     long        buffer_size;
 
@@ -375,6 +450,10 @@ typedef ptrdiff_t  FT_PtrDist;
 
   } gray_TWorker, *gray_PWorker;
 
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
+
 
 #ifndef FT_STATIC_RASTER
 #define ras  (*worker)
@@ -506,7 +585,7 @@ typedef ptrdiff_t  FT_PtrDist;
   static void
   gray_record_cell( RAS_ARG )
   {
-    if ( !ras.invalid && ( ras.area | ras.cover ) )
+    if ( ras.area | ras.cover )
     {
       PCell  cell = gray_find_cell( RAS_VAR );
 
@@ -555,10 +634,10 @@ typedef ptrdiff_t  FT_PtrDist;
 
       ras.area  = 0;
       ras.cover = 0;
+      ras.ex    = ex;
+      ras.ey    = ey;
     }
 
-    ras.ex      = ex;
-    ras.ey      = ey;
     ras.invalid = ( (unsigned)ey >= (unsigned)ras.count_ey ||
                               ex >= ras.count_ex           );
   }
@@ -600,7 +679,7 @@ typedef ptrdiff_t  FT_PtrDist;
                                  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;
 
@@ -644,13 +723,7 @@ typedef ptrdiff_t  FT_PtrDist;
       dx    = -dx;
     }
 
-    delta = (TCoord)( p / dx );
-    mod   = (TCoord)( p % dx );
-    if ( mod < 0 )
-    {
-      delta--;
-      mod += (TCoord)dx;
-    }
+    FT_DIV_MOD( TCoord, p, dx, delta, mod );
 
     ras.area  += (TArea)(( fx1 + first ) * delta);
     ras.cover += delta;
@@ -661,14 +734,11 @@ typedef ptrdiff_t  FT_PtrDist;
 
     if ( ex1 != ex2 )
     {
-      p    = ONE_PIXEL * ( y2 - y1 + delta );
-      lift = (TCoord)( p / dx );
-      rem  = (TCoord)( p % dx );
-      if ( rem < 0 )
-      {
-        lift--;
-        rem += (TCoord)dx;
-      }
+      TCoord  lift, rem;
+
+
+      p = ONE_PIXEL * ( y2 - y1 + delta );
+      FT_DIV_MOD( TCoord, p, dx, lift, rem );
 
       mod -= (int)dx;
 
@@ -718,9 +788,6 @@ typedef ptrdiff_t  FT_PtrDist;
     dx = to_x - ras.x;
     dy = to_y - ras.y;
 
-    /* XXX: we should do something about the trivial case where dx == 0, */
-    /*      as it happens very often!                                    */
-
     /* perform vertical clipping */
     {
       TCoord  min, max;
@@ -799,13 +866,7 @@ typedef ptrdiff_t  FT_PtrDist;
       dy    = -dy;
     }
 
-    delta = (int)( p / dy );
-    mod   = (int)( p % dy );
-    if ( mod < 0 )
-    {
-      delta--;
-      mod += (TCoord)dy;
-    }
+    FT_DIV_MOD( int, p, dy, delta, mod );
 
     x = ras.x + delta;
     gray_render_scanline( RAS_VAR_ ey1, ras.x, fy1, x, (TCoord)first );
@@ -816,13 +877,7 @@ typedef ptrdiff_t  FT_PtrDist;
     if ( ey1 != ey2 )
     {
       p     = ONE_PIXEL * dx;
-      lift  = (int)( p / dy );
-      rem   = (int)( p % dy );
-      if ( rem < 0 )
-      {
-        lift--;
-        rem += (int)dy;
-      }
+      FT_DIV_MOD( int, p, dy, lift, rem );
       mod -= (int)dy;
 
       while ( ey1 != ey2 )
@@ -1036,37 +1091,10 @@ typedef ptrdiff_t  FT_PtrDist;
 
 
         /* dx and dy are x and y components of the P0-P3 chord vector. */
-        dx = arc[3].x - arc[0].x;
-        dy = arc[3].y - arc[0].y;
-
-        /* L is an (under)estimate of the Euclidean distance P0-P3.       */
-        /*                                                                */
-        /* If dx >= dy, then r = sqrt(dx^2 + dy^2) can be overestimated   */
-        /* with least maximum error by                                    */
-        /*                                                                */
-        /*   r_upperbound = dx + (sqrt(2) - 1) * dy  ,                    */
-        /*                                                                */
-        /* where sqrt(2) - 1 can be (over)estimated by 107/256, giving an */
-        /* error of no more than 8.4%.                                    */
-        /*                                                                */
-        /* Similarly, some elementary calculus shows that r can be        */
-        /* underestimated with least maximum error by                     */
-        /*                                                                */
-        /*   r_lowerbound = sqrt(2 + sqrt(2)) / 2 * dx                    */
-        /*                  + sqrt(2 - sqrt(2)) / 2 * dy  .               */
-        /*                                                                */
-        /* 236/256 and 97/256 are (under)estimates of the two algebraic   */
-        /* numbers, giving an error of no more than 8.1%.                 */
-
-        dx_ = FT_ABS( dx );
-        dy_ = FT_ABS( dy );
-
-        /* This is the same as                     */
-        /*                                         */
-        /*   L = ( 236 * FT_MAX( dx_, dy_ )        */
-        /*       + 97 * FT_MIN( dx_, dy_ ) ) >> 8; */
-        L = ( dx_ > dy_ ? 236 * dx_ +  97 * dy_
-                        :  97 * dx_ + 236 * dy_ ) >> 8;
+        dx = dx_ = arc[3].x - arc[0].x;
+        dy = dy_ = arc[3].y - arc[0].y;
+
+        L = FT_HYPOT( dx_, dy_ );
 
         /* Avoid possible arithmetic overflow below by splitting. */
         if ( L > 32767 )
@@ -1091,11 +1119,11 @@ typedef ptrdiff_t  FT_PtrDist;
         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. */
@@ -1126,7 +1154,8 @@ typedef ptrdiff_t  FT_PtrDist;
 
 
     /* record current cell, if any */
-    gray_record_cell( RAS_VAR );
+    if ( !ras.invalid )
+      gray_record_cell( RAS_VAR );
 
     /* start to a new position */
     x = UPSCALE( to->x );
@@ -1227,9 +1256,7 @@ typedef ptrdiff_t  FT_PtrDist;
                        TPos    area,
                        TCoord  acount )
   {
-    FT_Span*  span;
-    int       count;
-    int       coverage;
+    int  coverage;
 
 
     /* compute the coverage line's coverage, depending on the    */
@@ -1271,6 +1298,10 @@ typedef ptrdiff_t  FT_PtrDist;
 
     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;
@@ -1309,7 +1340,6 @@ typedef ptrdiff_t  FT_PtrDist;
         ras.num_gray_spans = 0;
         ras.span_y         = (int)y;
 
-        count = 0;
         span  = ras.gray_spans;
       }
       else
@@ -1400,7 +1430,26 @@ typedef ptrdiff_t  FT_PtrDist;
       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" ));
+
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
   }
 
 
@@ -1466,8 +1515,11 @@ typedef ptrdiff_t  FT_PtrDist;
     TPos  delta;
 
 
-    if ( !outline || !func_interface )
-      return ErrRaster_Invalid_Argument;
+    if ( !outline )
+      return FT_THROW( Invalid_Outline );
+
+    if ( !func_interface )
+      return FT_THROW( Invalid_Argument );
 
     shift = func_interface->shift;
     delta = func_interface->delta;
@@ -1680,7 +1732,7 @@ typedef ptrdiff_t  FT_PtrDist;
     return error;
 
   Invalid_Outline:
-    return ErrRaster_Invalid_Outline;
+    return FT_THROW( Invalid_Outline );
   }
 
 #endif /* _STANDALONE_ */
@@ -1715,10 +1767,11 @@ typedef ptrdiff_t  FT_PtrDist;
     if ( ft_setjmp( ras.jump_buffer ) == 0 )
     {
       error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras );
-      gray_record_cell( RAS_VAR );
+      if ( !ras.invalid )
+        gray_record_cell( RAS_VAR );
     }
     else
-      error = ErrRaster_Memory_Overflow;
+      error = FT_THROW( Memory_Overflow );
 
     return error;
   }
@@ -1871,21 +1924,21 @@ typedef ptrdiff_t  FT_PtrDist;
 
 
     if ( !raster || !raster->buffer || !raster->buffer_size )
-      return ErrRaster_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     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 ErrRaster_Invalid_Outline;
+      return FT_THROW( Invalid_Outline );
 
     if ( outline->n_points !=
            outline->contours[outline->n_contours - 1] + 1 )
-      return ErrRaster_Invalid_Outline;
+      return FT_THROW( Invalid_Outline );
 
     worker = raster->worker;
 
@@ -1893,19 +1946,19 @@ typedef ptrdiff_t  FT_PtrDist;
     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 )
-        return ErrRaster_Invalid_Argument;
+        return FT_THROW( Invalid_Argument );
     }
 
     /* 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 ) )
@@ -2047,12 +2100,26 @@ typedef ptrdiff_t  FT_PtrDist;
   }
 
 
+  static int
+  gray_raster_set_mode( FT_Raster      raster,
+                        unsigned long  mode,
+                        void*          args )
+  {
+    FT_UNUSED( raster );
+    FT_UNUSED( mode );
+    FT_UNUSED( args );
+
+
+    return 0; /* nothing to do */
+  }
+
+
   FT_DEFINE_RASTER_FUNCS(ft_grays_raster,
     FT_GLYPH_FORMAT_OUTLINE,
 
     (FT_Raster_New_Func)     gray_raster_new,
     (FT_Raster_Reset_Func)   gray_raster_reset,
-    (FT_Raster_Set_Mode_Func)0,
+    (FT_Raster_Set_Mode_Func)gray_raster_set_mode,
     (FT_Raster_Render_Func)  gray_raster_render,
     (FT_Raster_Done_Func)    gray_raster_done
   )
index 00499cc..4e2dee5 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Anti-aliasing renderer interface (body).                             */
 /*                                                                         */
-/*  Copyright 2000-2006, 2009-2012 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,       */
                        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 )
     {
-      error = Smooth_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
                             FT_Render_Mode    required_mode )
   {
     FT_Error     error;
-    FT_Outline*  outline = NULL;
+    FT_Outline*  outline = &slot->outline;
+    FT_Bitmap*   bitmap  = &slot->bitmap;
+    FT_Memory    memory  = render->root.memory;
     FT_BBox      cbox;
+    FT_Pos       x_shift = 0;
+    FT_Pos       y_shift = 0;
+    FT_Pos       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;
-    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_Int       hmul    = mode == FT_RENDER_MODE_LCD;
+    FT_Int       vmul    = mode == FT_RENDER_MODE_LCD_V;
 
     FT_Raster_Params  params;
 
+    FT_Bool  have_outline_shifted = FALSE;
+    FT_Bool  have_buffer          = FALSE;
+
 
     /* 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 )
-      return Smooth_Err_Cannot_Render_Glyph;
-
-    outline = &slot->outline;
+    {
+      error = FT_THROW( Cannot_Render_Glyph );
+      goto Exit;
+    }
 
-    /* translate the outline to the new origin if needed */
     if ( origin )
-      FT_Outline_Translate( outline, origin->x, origin->y );
+    {
+      x_shift = origin->x;
+      y_shift = origin->y;
+    }
 
     /* compute the control box, and grid fit it */
+    /* taking into account the origin shift     */
     FT_Outline_Get_CBox( outline, &cbox );
 
-    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 + x_shift );
+    cbox.yMin = FT_PIX_FLOOR( cbox.yMin + y_shift );
+    cbox.xMax = FT_PIX_CEIL( cbox.xMax + x_shift );
+    cbox.yMax = FT_PIX_CEIL( cbox.yMax + y_shift );
 
-    if ( cbox.xMin < 0 && cbox.xMax > FT_INT_MAX + cbox.xMin )
-    {
-      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;
-    }
-    else
-      width  = ( cbox.xMax - cbox.xMin ) >> 6;
+    x_shift -= cbox.xMin;
+    y_shift -= cbox.yMin;
 
-    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;
-    }
-    else
-      height = ( cbox.yMax - cbox.yMin ) >> 6;
+    x_left  = cbox.xMin >> 6;
+    y_top   = cbox.yMax >> 6;
 
-    bitmap = &slot->bitmap;
-    memory = render->root.memory;
+    width  = (FT_ULong)( cbox.xMax - cbox.xMin ) >> 6;
+    height = (FT_ULong)( cbox.yMax - cbox.yMin ) >> 6;
 
 #ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
     width_org  = width;
     height_org = height;
 #endif
 
-    /* release old bitmap buffer */
-    if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
-    {
-      FT_FREE( bitmap->buffer );
-      slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
-    }
-
-    /* allocate new one */
     pitch = width;
     if ( hmul )
     {
-      width = width * 3;
-      pitch = FT_PAD_CEIL( width, 4 );
+      width *= 3;
+      pitch  = FT_PAD_CEIL( width, 4 );
     }
 
     if ( vmul )
       height *= 3;
 
-    x_shift = (FT_Int) cbox.xMin;
-    y_shift = (FT_Int) cbox.yMin;
-    x_left  = (FT_Int)( cbox.xMin >> 6 );
-    y_top   = (FT_Int)( cbox.yMax >> 6 );
-
 #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
 
     if ( slot->library->lcd_filter_func )
 
       if ( hmul )
       {
-        x_shift -= 64 * ( extra >> 1 );
+        x_shift += 64 * ( extra >> 1 );
+        x_left  -= extra >> 1;
         width   += 3 * extra;
         pitch    = FT_PAD_CEIL( width, 4 );
-        x_left  -= extra >> 1;
       }
 
       if ( vmul )
       {
-        y_shift -= 64 * ( extra >> 1 );
-        height  += 3 * extra;
+        y_shift += 64 * ( extra >> 1 );
         y_top   += extra >> 1;
+        height  += 3 * extra;
       }
     }
 
 #endif
 
-#if FT_UINT_MAX > 0xFFFFU
+    /*
+     * 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 ||
+         x_left < FT_INT_MIN || y_top < FT_INT_MIN )
+    {
+      error = FT_THROW( Invalid_Pixel_Size );
+      goto Exit;
+    }
 
-    /* Required check is ( pitch * height < FT_ULONG_MAX ),     */
-    /* but we care realistic cases only. Always pitch <= width. */
+    /* 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 ));
-      return Smooth_Err_Raster_Overflow;
+      error = FT_THROW( Raster_Overflow );
+      goto Exit;
     }
 
-#endif
+    /* release old bitmap buffer */
+    if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
+    {
+      FT_FREE( bitmap->buffer );
+      slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
+    }
+
+    /* allocate new one */
+    if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) )
+      goto Exit;
+    else
+      have_buffer = TRUE;
+
+    slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
+
+    slot->format      = FT_GLYPH_FORMAT_BITMAP;
+    slot->bitmap_left = (FT_Int)x_left;
+    slot->bitmap_top  = (FT_Int)y_top;
 
     bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
     bitmap->num_grays  = 256;
     bitmap->pitch      = pitch;
 
     /* translate outline to render it into the bitmap */
-    FT_Outline_Translate( outline, -x_shift, -y_shift );
-
-    if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) )
-      goto Exit;
-
-    slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
+    if ( x_shift || y_shift )
+    {
+      FT_Outline_Translate( outline, x_shift, y_shift );
+      have_outline_shifted = TRUE;
+    }
 
     /* set up parameters */
     params.target = bitmap;
           vec->y /= 3;
     }
 
+    if ( error )
+      goto Exit;
+
     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 );
+    if ( error )
+      goto Exit;
 
     /* expand it horizontally */
     if ( hmul )
 
 #endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
 
-    FT_Outline_Translate( outline, x_shift, y_shift );
+    /* everything is fine; don't deallocate buffer */
+    have_buffer = FALSE;
 
-    /*
-     * 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 )
-      goto Exit;
-
-    slot->format      = FT_GLYPH_FORMAT_BITMAP;
-    slot->bitmap_left = (FT_Int)x_left;
-    slot->bitmap_top  = (FT_Int)y_top;
+    error = FT_Err_Ok;
 
   Exit:
-    if ( outline && origin )
-      FT_Outline_Translate( outline, -origin->x, -origin->y );
+    if ( have_outline_shifted )
+      FT_Outline_Translate( outline, -x_shift, -y_shift );
+    if ( have_buffer )
+    {
+      FT_FREE( bitmap->buffer );
+      slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
+    }
 
     return error;
   }
index 601bcf9..67a2b83 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
 #include "ftspic.h"
 #include "ftsmerrs.h"
 
+
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from ftgrays.c */
   void
   FT_Init_Class_ft_grays_raster( FT_Raster_Funcs*  funcs );
 
+
   void
   ft_smooth_renderer_class_pic_free( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
-    FT_Memory  memory = library->memory;
+    FT_Memory          memory        = library->memory;
 
 
     if ( pic_container->smooth )
@@ -42,6 +44,7 @@
 
       if ( --container->ref_count )
         return;
+
       FT_FREE( container );
       pic_container->smooth = NULL;
     }
@@ -52,8 +55,8 @@
   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;
 
 
     }
 
     /* 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->smooth = container;
+
     container->ref_count = 1;
 
-    /* initialize pointer table - this is how the module usually expects this data */
+    /* 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 );
+
     return error;
   }
 
+
   /* 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 );
   }
 
-  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_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 );
   }
 
-  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 );
   }
index 4686f5e..334b51c 100644 (file)
@@ -25,18 +25,23 @@ 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 */
 
-  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;
 
-#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
diff --git a/src/tools/afblue.pl b/src/tools/afblue.pl
new file mode 100644 (file)
index 0000000..60fe696
--- /dev/null
@@ -0,0 +1,548 @@
+#! /usr/bin/perl -w
+# -*- Perl -*-
+#
+# afblue.pl
+#
+# Process a blue zone character data file.
+#
+# Copyright 2013, 2014 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.
+
+use strict;
+use warnings;
+use English '-no_match_vars';
+use open ':std', ':encoding(UTF-8)';
+
+
+my $prog = $PROGRAM_NAME;
+$prog =~ s| .* / ||x;      # Remove path.
+
+die "usage: $prog datafile < infile > outfile\n" if $#ARGV != 0;
+
+
+my $datafile = $ARGV[0];
+
+my %diversions;        # The extracted and massaged data from `datafile'.
+my @else_stack;        # Booleans to track else-clauses.
+my @name_stack;        # Stack of integers used for names of aux. variables.
+
+my $curr_enum;         # Name of the current enumeration.
+my $curr_array;        # Name of the current array.
+my $curr_max;          # Name of the current maximum value.
+
+my $curr_enum_element; # Name of the current enumeration element.
+my $curr_offset;       # The offset relative to current aux. variable.
+my $curr_elem_size;    # The size of the current string or block.
+
+my $have_sections = 0; # Boolean; set if start of a section has been seen.
+my $have_strings;      # Boolean; set if current section contains strings.
+my $have_blocks;       # Boolean; set if current section contains blocks.
+
+my $have_enum_element; # Boolean; set if we have an enumeration element.
+my $in_string;         # Boolean; set if a string has been parsed.
+
+my $num_sections = 0;  # Number of sections seen so far.
+
+my $last_aux;          # Name of last auxiliary variable.
+
+
+# Regular expressions.
+
+# [<ws>] <enum_name> <ws> <array_name> <ws> <max_name> [<ws>] ':' [<ws>] '\n'
+my $section_re = qr/ ^ \s* (\S+) \s+ (\S+) \s+ (\S+) \s* : \s* $ /x;
+
+# [<ws>] <enum_element_name> [<ws>] '\n'
+my $enum_element_re = qr/ ^ \s* ( [A-Za-z0-9_]+ ) \s* $ /x;
+
+# '#' <preprocessor directive> '\n'
+my $preprocessor_re = qr/ ^ \# /x;
+
+# [<ws>] '/' '/' <comment> '\n'
+my $comment_re = qr| ^ \s* // |x;
+
+# empty line
+my $whitespace_only_re = qr/ ^ \s* $ /x;
+
+# [<ws>] '"' <string> '"' [<ws>] '\n'  (<string> doesn't contain newlines)
+my $string_re = qr/ ^ \s*
+                       " ( (?> (?: (?> [^"\\]+ ) | \\. )* ) ) "
+                       \s* $ /x;
+
+# [<ws>] '{' <block> '}' [<ws>] '\n'  (<block> can contain newlines)
+my $block_start_re = qr/ ^ \s* \{ /x;
+
+# We need the capturing group for `split' to make it return the separator
+# tokens (i.e., the opening and closing brace) also.
+my $brace_re = qr/ ( [{}] ) /x;
+
+
+sub Warn
+{
+  my $message = shift;
+  warn "$datafile:$INPUT_LINE_NUMBER: warning: $message\n";
+}
+
+
+sub Die
+{
+  my $message = shift;
+  die "$datafile:$INPUT_LINE_NUMBER: error: $message\n";
+}
+
+
+my $warned_before = 0;
+
+sub warn_before
+{
+  Warn("data before first section gets ignored") unless $warned_before;
+  $warned_before = 1;
+}
+
+
+sub strip_newline
+{
+  chomp;
+  s/ \x0D $ //x;
+}
+
+
+sub end_curr_string
+{
+  # Append final null byte to string.
+  if ($have_strings)
+  {
+    push @{$diversions{$curr_array}}, "    '\\0',\n" if $in_string;
+
+    $curr_offset++;
+    $in_string = 0;
+  }
+}
+
+
+sub update_max_elem_size
+{
+  if ($curr_elem_size)
+  {
+    my $max = pop @{$diversions{$curr_max}};
+    $max = $curr_elem_size if $curr_elem_size > $max;
+    push @{$diversions{$curr_max}}, $max;
+  }
+}
+
+
+sub convert_non_ascii_char
+{
+  # A UTF-8 character outside of the printable ASCII range, with possibly a
+  # leading backslash character.
+  my $s = shift;
+
+  # Here we count characters, not bytes.
+  $curr_elem_size += length $s;
+
+  utf8::encode($s);
+  $s = uc unpack 'H*', $s;
+
+  $curr_offset += $s =~ s/\G(..)/'\\x$1', /sg;
+
+  return $s;
+}
+
+
+sub convert_ascii_chars
+{
+  # A series of ASCII characters in the printable range.
+  my $s = shift;
+
+  # We ignore spaces.
+  $s =~ s/ //g;
+
+  my $count = $s =~ s/\G(.)/'$1', /g;
+  $curr_offset += $count;
+  $curr_elem_size += $count;
+
+  return $s;
+}
+
+
+sub convert_literal
+{
+  my $s = shift;
+  my $orig = $s;
+
+  # ASCII printables and space
+  my $safe_re = '\x20-\x7E';
+  # ASCII printables and space, no backslash
+  my $safe_no_backslash_re = '\x20-\x5B\x5D-\x7E';
+
+  $s =~ s{
+           (?: \\? ( [^$safe_re] )
+               | ( (?: [$safe_no_backslash_re]
+                       | \\ [$safe_re] )+ ) )
+         }
+         {
+           defined($1) ? convert_non_ascii_char($1)
+                       : convert_ascii_chars($2)
+         }egx;
+
+   # We assume that `$orig' doesn't contain `*/'
+   return $s . " /* $orig */";
+}
+
+
+sub aux_name
+{
+  return "af_blue_" . $num_sections. "_" . join('_', @name_stack);
+}
+
+
+sub aux_name_next
+{
+  $name_stack[$#name_stack]++;
+  my $name = aux_name();
+  $name_stack[$#name_stack]--;
+
+  return $name;
+}
+
+
+sub enum_val_string
+{
+  # Build string that holds code to save the current offset in an
+  # enumeration element.
+  my $aux = shift;
+
+  my $add = ($last_aux eq "af_blue_" . $num_sections . "_0" )
+              ? ""
+              : "$last_aux + ";
+
+  return "    $aux = $add$curr_offset,\n";
+}
+
+
+
+# Process data file.
+
+open(DATA, $datafile) || die "$prog: can't open \`$datafile': $OS_ERROR\n";
+
+while (<DATA>)
+{
+  strip_newline();
+
+  next if /$comment_re/;
+  next if /$whitespace_only_re/;
+
+  if (/$section_re/)
+  {
+    Warn("previous section is empty") if ($have_sections
+                                          && !$have_strings
+                                          && !$have_blocks);
+
+    end_curr_string();
+    update_max_elem_size();
+
+    # Save captured groups from `section_re'.
+    $curr_enum = $1;
+    $curr_array = $2;
+    $curr_max = $3;
+
+    $curr_enum_element = "";
+    $curr_offset = 0;
+
+    Warn("overwriting already defined enumeration \`$curr_enum'")
+      if exists($diversions{$curr_enum});
+    Warn("overwriting already defined array \`$curr_array'")
+      if exists($diversions{$curr_array});
+    Warn("overwriting already defined maximum value \`$curr_max'")
+      if exists($diversions{$curr_max});
+
+    $diversions{$curr_enum} = [];
+    $diversions{$curr_array} = [];
+    $diversions{$curr_max} = [];
+
+    push @{$diversions{$curr_max}}, 0;
+
+    @name_stack = ();
+    push @name_stack, 0;
+
+    $have_sections = 1;
+    $have_strings = 0;
+    $have_blocks = 0;
+
+    $have_enum_element = 0;
+    $in_string = 0;
+
+    $num_sections++;
+    $curr_elem_size = 0;
+
+    $last_aux = aux_name();
+
+    next;
+  }
+
+  if (/$preprocessor_re/)
+  {
+    if ($have_sections)
+    {
+      # Having preprocessor conditionals complicates the computation of
+      # correct offset values.  We have to introduce auxiliary enumeration
+      # elements with the name `af_blue_<s>_<n1>_<n2>_...' that store
+      # offsets to be used in conditional clauses.  `<s>' is the number of
+      # sections seen so far, `<n1>' is the number of `#if' and `#endif'
+      # conditionals seen so far in the topmost level, `<n2>' the number of
+      # `#if' and `#endif' conditionals seen so far one level deeper, etc.
+      # As a consequence, uneven values are used within a clause, and even
+      # values after a clause, since the C standard doesn't allow the
+      # redefinition of an enumeration value.  For example, the name
+      # `af_blue_5_1_6' is used to construct enumeration values in the fifth
+      # section after the third (second-level) if-clause within the first
+      # (top-level) if-clause.  After the first top-level clause has
+      # finished, `af_blue_5_2' is used.  The current offset is then
+      # relative to the value stored in the current auxiliary element.
+
+      if (/ ^ \# \s* if /x)
+      {
+        push @else_stack, 0;
+
+        $name_stack[$#name_stack]++;
+
+        push @{$diversions{$curr_enum}}, enum_val_string(aux_name());
+        $last_aux = aux_name();
+
+        push @name_stack, 0;
+
+        $curr_offset = 0;
+      }
+      elsif (/ ^ \# \s* elif /x)
+      {
+        Die("unbalanced #elif") unless @else_stack;
+
+        pop @name_stack;
+
+        push @{$diversions{$curr_enum}}, enum_val_string(aux_name_next());
+        $last_aux = aux_name();
+
+        push @name_stack, 0;
+
+        $curr_offset = 0;
+      }
+      elsif (/ ^ \# \s* else /x)
+      {
+        my $prev_else = pop @else_stack;
+        Die("unbalanced #else") unless defined($prev_else);
+        Die("#else already seen") if $prev_else;
+        push @else_stack, 1;
+
+        pop @name_stack;
+
+        push @{$diversions{$curr_enum}}, enum_val_string(aux_name_next());
+        $last_aux = aux_name();
+
+        push @name_stack, 0;
+
+        $curr_offset = 0;
+      }
+      elsif (/ ^ (\# \s*) endif /x)
+      {
+        my $prev_else = pop @else_stack;
+        Die("unbalanced #endif") unless defined($prev_else);
+
+        pop @name_stack;
+
+        # If there is no else-clause for an if-clause, we add one.  This is
+        # necessary to have correct offsets.
+        if (!$prev_else)
+        {
+          # Use amount of whitespace from `endif'.
+          push @{$diversions{$curr_enum}}, enum_val_string(aux_name_next())
+                                           . $1 . "else\n";
+          $last_aux = aux_name();
+
+          $curr_offset = 0;
+        }
+
+        $name_stack[$#name_stack]++;
+
+        push @{$diversions{$curr_enum}}, enum_val_string(aux_name());
+        $last_aux = aux_name();
+
+        $curr_offset = 0;
+      }
+
+      # Handle (probably continued) preprocessor lines.
+    CONTINUED_LOOP:
+      {
+        do
+        {
+          strip_newline();
+
+          push @{$diversions{$curr_enum}}, $ARG . "\n";
+          push @{$diversions{$curr_array}}, $ARG . "\n";
+
+          last CONTINUED_LOOP unless / \\ $ /x;
+
+        } while (<DATA>);
+      }
+    }
+    else
+    {
+      warn_before();
+    }
+
+    next;
+  }
+
+  if (/$enum_element_re/)
+  {
+    end_curr_string();
+    update_max_elem_size();
+
+    $curr_enum_element = $1;
+    $have_enum_element = 1;
+    $curr_elem_size = 0;
+
+    next;
+  }
+
+  if (/$string_re/)
+  {
+    if ($have_sections)
+    {
+      Die("strings and blocks can't be mixed in a section") if $have_blocks;
+
+      # Save captured group from `string_re'.
+      my $string = $1;
+
+      if ($have_enum_element)
+      {
+        push @{$diversions{$curr_enum}}, enum_val_string($curr_enum_element);
+        $have_enum_element = 0;
+      }
+
+      $string = convert_literal($string);
+
+      push @{$diversions{$curr_array}}, "    $string\n";
+
+      $have_strings = 1;
+      $in_string = 1;
+    }
+    else
+    {
+      warn_before();
+    }
+
+    next;
+  }
+
+  if (/$block_start_re/)
+  {
+    if ($have_sections)
+    {
+      Die("strings and blocks can't be mixed in a section") if $have_strings;
+
+      my $depth = 0;
+      my $block = "";
+      my $block_end = 0;
+
+      # Count braces while getting the block.
+    BRACE_LOOP:
+      {
+        do
+        {
+          strip_newline();
+
+          foreach my $substring (split(/$brace_re/))
+          {
+            if ($block_end)
+            {
+              Die("invalid data after last matching closing brace")
+                if $substring !~ /$whitespace_only_re/;
+            }
+
+            $block .= $substring;
+
+            if ($substring eq '{')
+            {
+              $depth++;
+            }
+            elsif ($substring eq '}')
+            {
+              $depth--;
+
+              $block_end = 1 if $depth == 0;
+            }
+          }
+
+          # If we are here, we have run out of substrings, so get next line
+          # or exit.
+          last BRACE_LOOP if $block_end;
+
+          $block .= "\n";
+
+        } while (<DATA>);
+      }
+
+      if ($have_enum_element)
+      {
+        push @{$diversions{$curr_enum}}, enum_val_string($curr_enum_element);
+        $have_enum_element = 0;
+      }
+
+      push @{$diversions{$curr_array}}, $block . ",\n";
+
+      $curr_offset++;
+      $curr_elem_size++;
+
+      $have_blocks = 1;
+    }
+    else
+    {
+      warn_before();
+    }
+
+    next;
+  }
+
+  # Garbage.  We weren't able to parse the data.
+  Die("syntax error");
+}
+
+# Finalize data.
+end_curr_string();
+update_max_elem_size();
+
+
+# Filter stdin to stdout, replacing `@...@' templates.
+
+sub emit_diversion
+{
+  my $diversion_name = shift;
+  return (exists($diversions{$1})) ? "@{$diversions{$1}}"
+                                   : "@" . $diversion_name . "@";
+}
+
+
+$LIST_SEPARATOR = '';
+
+my $s1 = "This file has been generated by the Perl script \`$prog',";
+my $s1len = length $s1;
+my $s2 = "using data from file \`$datafile'.";
+my $s2len = length $s2;
+my $slen = ($s1len > $s2len) ? $s1len : $s2len;
+
+print "/* " . $s1 . " " x ($slen - $s1len) . " */\n"
+      . "/* " . $s2 . " " x ($slen - $s2len) . " */\n"
+      . "\n";
+
+while (<STDIN>)
+{
+  s/ @ ( [A-Za-z0-9_]+? ) @ / emit_diversion($1) /egx;
+  print;
+}
+
+# EOF
index 3dc6559..c85df72 100644 (file)
@@ -10,7 +10,7 @@
  * accepted if you are using GCC for compilation (and probably by
  * other compilers too).
  *
- * Author: David Turner, 2005, 2006, 2008-2012
+ * Author: David Turner, 2005, 2006, 2008-2013
  *
  * This code is explicitly placed into the public domain.
  *
@@ -22,7 +22,7 @@
 #include <ctype.h>
 
 #define  PROGRAM_NAME     "apinames"
-#define  PROGRAM_VERSION  "0.1"
+#define  PROGRAM_VERSION  "0.2"
 
 #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_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;
 
@@ -154,8 +155,6 @@ names_dump( FILE*         out,
 
     case OUTPUT_WATCOM_LBC:
       {
-        /* we must omit the .dll suffix from the library name */
-        char         temp[512];
         const char*  dot;
 
 
@@ -166,10 +165,12 @@ names_dump( FILE*         out,
           exit( 4 );
         }
 
+        /* we must omit the .dll suffix from the library name */
         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 ) )
@@ -187,6 +188,16 @@ names_dump( FILE*         out,
       }
       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 );
@@ -311,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"
+   "           -wN    : output NetWare Import File\n"
    "\n";
 
   fprintf( stderr,
@@ -394,6 +406,10 @@ int  main( int argc, const char* const*  argv )
             format = OUTPUT_WATCOM_LBC;
             break;
 
+          case 'N':
+            format = OUTPUT_NETWARE_IMP;
+            break;
+
           case 0:
             break;
 
index d0f342e..ce6500c 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 #
 # Check trace components in FreeType 2 source.
-# Author: suzuki toshiya, 2009
+# Author: suzuki toshiya, 2009, 2013
 #
 # This code is explicitly into the public domain.
 
@@ -15,7 +15,7 @@ USED_COMPONENT  = {}
 KNOWN_COMPONENT = {}
 
 SRC_FILE_DIRS   = [ "src" ]
-TRACE_DEF_FILES = [ "include/freetype/internal/fttrace.h" ]
+TRACE_DEF_FILES = [ "include/internal/fttrace.h" ]
 
 
 # --------------------------------------------------------------
index 3f80c5f..6742c90 100644 (file)
@@ -2,65 +2,20 @@
 import sys, math
 
 #units  = 64*65536.0   # don't change !!
-units  = 256
+units  = 180 * 2**16
 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"
 
-# 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
@@ -68,12 +23,11 @@ for n in r:
     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 "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 ""
 
index b398955..adea6f1 100644 (file)
@@ -1,57 +1,81 @@
-#  Content (c) 2002, 2004, 2006, 2007, 2008, 2009
-#    David Turner <david@freetype.org>
 #
-#  This file contains routines used to parse the content of documentation
-#  comment blocks and build more structured objects out of them.
+#  content.py
 #
+#    Parse comment blocks to build content blocks (library file).
+#
+#  Copyright 2002, 2004, 2006-2009, 2012-2014 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
+#  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 routines to parse documentation comment blocks,
+# building more structured objects out of them.
+#
+
 
 from sources import *
-from utils import *
+from utils   import *
+
 import string, re
 
 
-# this regular expression is used to detect code sequences. these
-# are simply code fragments embedded in '{' and '}' like in:
 #
-#  {
-#    x = y + z;
-#    if ( zookoo == 2 )
-#    {
-#      foobar();
-#    }
-#  }
+# Regular expressions to detect code sequences.  `Code sequences' are simply
+# code fragments embedded in '{' and '}', as demonstrated in the following
+# example.
+#
+#   {
+#     x = y + z;
+#     if ( zookoo == 2 )
+#     {
+#       foobar();
+#     }
+#   }
 #
-# note that indentation of the starting and ending accolades must be
-# exactly the same. the code sequence can contain accolades at greater
-# indentation
+# Note that the indentation of the first opening brace and the last closing
+# brace must be exactly the same.  The code sequence itself should have a
+# larger indentation than the surrounding braces.
 #
 re_code_start = re.compile( r"(\s*){\s*$" )
 re_code_end   = re.compile( r"(\s*)}\s*$" )
 
 
-# this regular expression is used to isolate identifiers from
-# other text
 #
-re_identifier = re.compile( r'(\w*)' )
-
-
-# we collect macros ending in `_H'; while outputting the object data, we use
-# this info together with the object's file location to emit the appropriate
-# header file macro and name before the object itself
+# A regular expression to isolate identifiers from other text.
 #
-re_header_macro = re.compile( r'^#define\s{1,}(\w{1,}_H)\s{1,}<(.*)>' )
+re_identifier = re.compile( r'((?:\w|-)*)' )
 
 
-#############################################################################
 #
-# The DocCode class is used to store source code lines.
+# We collect macro names ending in `_H' (group 1), as defined in
+# `config/ftheader.h'.  While outputting the object data, we use this info
+# together with the object's file location (group 2) to emit the appropriate
+# header file macro and its associated file name before the object itself.
 #
-#   'self.lines' contains a set of source code lines that will be dumped as
-#   HTML in a <PRE> tag.
+# Example:
 #
-#   The object is filled line by line by the parser; it strips the leading
-#   "margin" space from each input line before storing it in 'self.lines'.
+#   #define FT_FREETYPE_H <freetype.h>
 #
+re_header_macro = re.compile( r'^#define\s{1,}(\w{1,}_H)\s{1,}<(.*)>' )
+
+
+################################################################
+##
+##  DOC CODE CLASS
+##
+##  The `DocCode' class is used to store source code lines.
+##
+##  `self.lines' contains a set of source code lines that will be dumped as
+##  HTML in a <PRE> tag.
+##
+##  The object is filled line by line by the parser; it strips the leading
+##  `margin' space from each input line before storing it in `self.lines'.
+##
 class  DocCode:
 
     def  __init__( self, margin, lines ):
@@ -77,12 +101,14 @@ class  DocCode:
 
 
 
-#############################################################################
-#
-# The DocPara class is used to store "normal" text paragraph.
-#
-#   'self.words' contains the list of words that make up the paragraph
-#
+################################################################
+##
+##  DOC PARA CLASS
+##
+##  `Normal' text paragraphs are stored in the `DocPara' class.
+##
+##  `self.words' contains the list of words that make up the paragraph.
+##
 class  DocPara:
 
     def  __init__( self, lines ):
@@ -123,17 +149,18 @@ class  DocPara:
         return result
 
 
-
-#############################################################################
-#
-#  The DocField class is used to store a list containing either DocPara or
-#  DocCode objects. Each DocField also has an optional "name" which is used
-#  when the object corresponds to a field or value definition
-#
+################################################################
+##
+##  DOC FIELD CLASS
+##
+##  The `DocField' class stores a list containing either `DocPara' or
+##  `DocCode' objects.  Each DocField object also has an optional `name'
+##  that is used when the object corresponds to a field or value definition.
+##
 class  DocField:
 
     def  __init__( self, name, lines ):
-        self.name  = name  # can be None for normal paragraphs/sources
+        self.name  = name  # can be `None' for normal paragraphs/sources
         self.items = []    # list of items
 
         mode_none  = 0     # start parsing mode
@@ -143,14 +170,14 @@ class  DocField:
         margin     = -1    # current code sequence indentation
         cur_lines  = []
 
-        # now analyze the markup lines to see if they contain paragraphs,
-        # code sequences or fields definitions
+        # analyze the markup lines to check whether they contain paragraphs,
+        # code sequences, or fields definitions
         #
         start = 0
         mode  = mode_none
 
         for l in lines:
-            # are we parsing a code sequence ?
+            # are we parsing a code sequence?
             if mode == mode_code:
                 m = re_code_end.match( l )
                 if m and len( m.group( 1 ) ) <= margin:
@@ -161,10 +188,10 @@ class  DocField:
                     cur_lines = []
                     mode      = mode_none
                 else:
-                    # nope, continue the code sequence
+                    # otherwise continue the code sequence
                     cur_lines.append( l[margin:] )
             else:
-                # start of code sequence ?
+                # start of code sequence?
                 m = re_code_start.match( l )
                 if m:
                     # save current lines
@@ -222,13 +249,29 @@ class  DocField:
         return result
 
 
-
-# this regular expression is used to detect field definitions
 #
-re_field = re.compile( r"\s*(\w*|\w(\w|\.)*\w)\s*::" )
-
-
-
+# A regular expression to detect field definitions.
+#
+# Examples:
+#
+#   foo     ::
+#   foo.bar ::
+#
+re_field = re.compile( r"""
+                         \s*
+                           (
+                             \w*
+                           |
+                             \w (\w | \.)* \w
+                           )
+                         \s* ::
+                       """, re.VERBOSE )
+
+
+################################################################
+##
+##  DOC MARKUP CLASS
+##
 class  DocMarkup:
 
     def  __init__( self, tag, lines ):
@@ -242,7 +285,7 @@ class  DocMarkup:
         for l in lines:
             m = re_field.match( l )
             if m:
-                # we detected the start of a new field definition
+                # We detected the start of a new field definition.
 
                 # first, save the current one
                 if cur_lines:
@@ -268,15 +311,6 @@ class  DocMarkup:
         except:
             return None
 
-    def  get_start( self ):
-        try:
-            result = ""
-            for word in self.fields[0].items[0].words:
-                result = result + " " + word
-            return result[1:]
-        except:
-            return "ERROR"
-
     def  dump( self, margin ):
         print " " * margin + "<" + self.tag + ">"
         for f in self.fields:
@@ -284,7 +318,10 @@ class  DocMarkup:
         print " " * margin + "</" + self.tag + ">"
 
 
-
+################################################################
+##
+##  DOC CHAPTER CLASS
+##
 class  DocChapter:
 
     def  __init__( self, block ):
@@ -300,7 +337,10 @@ class  DocChapter:
             self.order = []
 
 
-
+################################################################
+##
+##  DOC SECTION CLASS
+##
 class  DocSection:
 
     def  __init__( self, name = "Other" ):
@@ -329,18 +369,21 @@ class  DocSection:
                 self.title       = title
                 self.abstract    = block.get_markup_words( "abstract" )
                 self.description = block.get_markup_items( "description" )
-                self.order       = block.get_markup_words( "order" )
+                self.order       = block.get_markup_words_all( "order" )
                 return
 
     def  reorder( self ):
         self.block_names = sort_order_list( self.block_names, self.order )
 
 
-
+################################################################
+##
+##  CONTENT PROCESSOR CLASS
+##
 class  ContentProcessor:
 
     def  __init__( self ):
-        """initialize a block content processor"""
+        """Initialize a block content processor."""
         self.reset()
 
         self.sections = {}    # dictionary of documentation sections
@@ -351,8 +394,8 @@ class  ContentProcessor:
         self.headers  = {}    # dictionary of header macros
 
     def  set_section( self, section_name ):
-        """set current section during parsing"""
-        if not self.sections.has_key( section_name ):
+        """Set current section during parsing."""
+        if not section_name in self.sections:
             section = DocSection( section_name )
             self.sections[section_name] = section
             self.section                = section
@@ -363,15 +406,14 @@ class  ContentProcessor:
         chapter = DocChapter( block )
         self.chapters.append( chapter )
 
-
     def  reset( self ):
-        """reset the content processor for a new block"""
+        """Reset the content processor for a new block."""
         self.markups      = []
         self.markup       = None
         self.markup_lines = []
 
     def  add_markup( self ):
-        """add a new markup section"""
+        """Add a new markup section."""
         if self.markup and self.markup_lines:
 
             # get rid of last line of markup if it's empty
@@ -387,8 +429,8 @@ class  ContentProcessor:
             self.markup_lines = []
 
     def  process_content( self, content ):
-        """process a block content and return a list of DocMarkup objects
-           corresponding to it"""
+        """Process a block content and return a list of DocMarkup objects
+           corresponding to it."""
         markup       = None
         markup_lines = []
         first        = 1
@@ -446,7 +488,7 @@ class  ContentProcessor:
         # listed there
         for chap in self.chapters:
             for sec in chap.order:
-                if self.sections.has_key( sec ):
+                if sec in self.sections:
                     section = self.sections[sec]
                     section.chapter = chap
                     section.reorder()
@@ -461,6 +503,7 @@ class  ContentProcessor:
         others = []
         for sec in self.sections.values():
             if not sec.chapter:
+                sec.reorder()
                 others.append( sec )
 
         # create a new special chapter for all remaining sections
@@ -472,7 +515,10 @@ class  ContentProcessor:
             self.chapters.append( chap )
 
 
-
+################################################################
+##
+##  DOC BLOCK CLASS
+##
 class  DocBlock:
 
     def  __init__( self, source, follow, processor ):
@@ -549,24 +595,31 @@ class  DocBlock:
         return self.source.location()
 
     def  get_markup( self, tag_name ):
-        """return the DocMarkup corresponding to a given tag in a block"""
+        """Return the DocMarkup corresponding to a given tag in a block."""
         for m in self.markups:
             if m.tag == string.lower( tag_name ):
                 return m
         return None
 
-    def  get_markup_name( self, tag_name ):
-        """return the name of a given primary markup in a block"""
+    def  get_markup_words( self, tag_name ):
         try:
             m = self.get_markup( tag_name )
-            return m.get_name()
+            return m.fields[0].items[0].words
         except:
-            return None
+            return []
 
-    def  get_markup_words( self, tag_name ):
+    def  get_markup_words_all( self, tag_name ):
         try:
             m = self.get_markup( tag_name )
-            return m.fields[0].items[0].words
+            words = []
+            for item in m.fields[0].items:
+                # We honour empty lines in an `<Order>' section element by
+                # adding the sentinel `/empty/'.  The formatter should then
+                # convert it to an appropriate representation in the
+                # `section_enter' function.
+                words += item.words
+                words.append( "/empty/" )
+            return words
         except:
             return []
 
index 1d9de9f..4fb1abf 100644 (file)
@@ -1,16 +1,26 @@
 #!/usr/bin/env python
 #
-#  DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org>
+#  docmaker.py
 #
-# This program is a re-write of the original DocMaker took used
-# to generate the API Reference of the FreeType font engine
-# by converting in-source comments into structured HTML.
+#    Convert source code markup to HTML documentation.
 #
-# This new version is capable of outputting XML data, as well
-# as accepts more liberal formatting options.
+#  Copyright 2002, 2004, 2008, 2013, 2014 by
+#  David Turner.
 #
-# It also uses regular expression matching and substitution
-# to speed things significantly.
+#  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 program is a re-write of the original DocMaker tool used to generate
+# the API Reference of the FreeType font rendering engine by converting
+# in-source comments into structured HTML.
+#
+# This new version is capable of outputting XML data as well as accepting
+# more liberal formatting options.  It also uses regular expression matching
+# and substitution to speed up operation significantly.
 #
 
 from sources   import *
@@ -39,13 +49,13 @@ def  usage():
 
 
 def  main( argv ):
-    """main program loop"""
+    """Main program loop."""
 
     global output_dir
 
     try:
-        opts, args = getopt.getopt( sys.argv[1:], \
-                                    "ht:o:p:",    \
+        opts, args = getopt.getopt( sys.argv[1:],
+                                    "ht:o:p:",
                                     ["help", "title=", "output=", "prefix="] )
     except getopt.GetoptError:
         usage()
@@ -56,7 +66,6 @@ def  main( argv ):
         sys.exit( 1 )
 
     # process options
-    #
     project_title  = "Project"
     project_prefix = None
     output_dir     = None
@@ -90,7 +99,9 @@ def  main( argv ):
     # process sections
     content_processor.finish()
 
-    formatter = HtmlFormatter( content_processor, project_title, project_prefix )
+    formatter = HtmlFormatter( content_processor,
+                               project_title,
+                               project_prefix )
 
     formatter.toc_dump()
     formatter.index_dump()
@@ -98,9 +109,7 @@ def  main( argv ):
 
 
 # if called from the command line
-#
 if __name__ == '__main__':
     main( sys.argv )
 
-
 # eof
index f62ce67..7152c01 100644 (file)
@@ -1,19 +1,37 @@
-#  Formatter (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
 #
+#  formatter.py
+#
+#    Convert parsed content blocks to a structured document (library file).
+#
+#  Copyright 2002, 2004, 2007, 2008, 2014 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
+#  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 is the base Formatter class.  Its purpose is to convert a content
+# processor's data into specific documents (i.e., table of contents, global
+# index, and individual API reference indices).
+#
+# You need to sub-class it to output anything sensible.  For example, the
+# file `tohtml.py' contains the definition of the `HtmlFormatter' sub-class
+# to output HTML.
+#
+
 
 from sources import *
 from content import *
 from utils   import *
 
-# This is the base Formatter class.  Its purpose is to convert
-# a content processor's data into specific documents (i.e., table of
-# contents, global index, and individual API reference indices).
-#
-# You need to sub-class it to output anything sensible.  For example,
-# the file tohtml.py contains the definition of the HtmlFormatter sub-class
-# used to output -- you guessed it -- HTML.
-#
 
+################################################################
+##
+##  FORMATTER CLASS
+##
 class  Formatter:
 
     def  __init__( self, processor ):
@@ -36,20 +54,22 @@ class  Formatter:
                             self.add_identifier( field.name, block )
 
         self.block_index = self.identifiers.keys()
-        self.block_index.sort( index_sort )
+        self.block_index.sort( key = index_key )
 
     def  add_identifier( self, name, block ):
-        if self.identifiers.has_key( name ):
+        if name in self.identifiers:
             # duplicate name!
-            sys.stderr.write(                                           \
-               "WARNING: duplicate definition for '" + name + "' in " + \
-               block.location() + ", previous definition in " +         \
-               self.identifiers[name].location() + "\n" )
+            sys.stderr.write( "WARNING: duplicate definition for"
+                              + " '" + name + "' "
+                              + "in " + block.location() + ", "
+                              + "previous definition in "
+                              + self.identifiers[name].location()
+                              + "\n" )
         else:
             self.identifiers[name] = block
 
     #
-    #  Formatting the table of contents
+    # formatting the table of contents
     #
     def  toc_enter( self ):
         pass
@@ -97,7 +117,7 @@ class  Formatter:
             close_output( output )
 
     #
-    #  Formatting the index
+    # formatting the index
     #
     def  index_enter( self ):
         pass
@@ -128,7 +148,7 @@ class  Formatter:
             close_output( output )
 
     #
-    #  Formatting a section
+    # formatting a section
     #
     def  section_enter( self, section ):
         pass
@@ -162,7 +182,22 @@ class  Formatter:
         self.section_enter( section )
 
         for name in section.block_names:
-            block = self.identifiers[name]
+            skip_entry = 0
+            try:
+                block = self.identifiers[name]
+                # `block_names' can contain field names also,
+                # which we filter out
+                for markup in block.markups:
+                    if markup.tag == 'values':
+                        for field in markup.fields:
+                            if field.name == name:
+                                skip_entry = 1
+            except:
+                skip_entry = 1   # this happens e.g. for `/empty/' entries
+
+            if skip_entry:
+              continue
+
             self.block_enter( block )
 
             for markup in block.markups[1:]:   # always ignore first markup!
index 7b68c07..61ecc22 100644 (file)
@@ -1,62 +1,70 @@
-#  Sources (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009
-#    David Turner <david@freetype.org>
 #
+#  sources.py
 #
-# this file contains definitions of classes needed to decompose
-# C sources files into a series of multi-line "blocks". There are
-# two kinds of blocks:
+#    Convert source code comments to multi-line blocks (library file).
 #
-#   - normal blocks, which contain source code or ordinary comments
+#  Copyright 2002-2004, 2006-2009, 2012-2014 by
+#  David Turner.
 #
-#   - documentation blocks, which have restricted formatting, and
-#     whose text always start with a documentation markup tag like
-#     "<Function>", "<Type>", etc..
+#  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 library file contains definitions of classes needed to decompose C
+# source code files into a series of multi-line `blocks'.  There are two
+# kinds of blocks.
 #
-# the routines used to process the content of documentation blocks
-# are not contained here, but in "content.py"
+#   - Normal blocks, which contain source code or ordinary comments.
 #
-# the classes and methods found here only deal with text parsing
-# and basic documentation block extraction
+#   - Documentation blocks, which have restricted formatting, and whose text
+#     always start with a documentation markup tag like `<Function>',
+#     `<Type>', etc.
+#
+# The routines to process the content of documentation blocks are contained
+# in file `content.py'; the classes and methods found here only deal with
+# text parsing and basic documentation block extraction.
 #
 
-import fileinput, re, sys, os, string
 
+import fileinput, re, sys, os, string
 
 
 ################################################################
 ##
-##  BLOCK FORMAT PATTERN
+##  SOURCE BLOCK FORMAT CLASS
+##
+##  A simple class containing compiled regular expressions to detect
+##  potential documentation format block comments within C source code.
 ##
-##   A simple class containing compiled regular expressions used
-##   to detect potential documentation format block comments within
-##   C source code
+##  The `column' pattern must contain a group to `unbox' the content of
+##  documentation comment blocks.
 ##
-##   note that the 'column' pattern must contain a group that will
-##   be used to "unbox" the content of documentation comment blocks
+##  Later on, paragraphs are converted to long lines, which simplifies the
+##  regular expressions that act upon the text.
 ##
 class  SourceBlockFormat:
 
     def  __init__( self, id, start, column, end ):
-        """create a block pattern, used to recognize special documentation blocks"""
+        """Create a block pattern, used to recognize special documentation
+           blocks."""
         self.id     = id
         self.start  = re.compile( start, re.VERBOSE )
         self.column = re.compile( column, re.VERBOSE )
         self.end    = re.compile( end, re.VERBOSE )
 
 
-
 #
-# format 1 documentation comment blocks look like the following:
+# Format 1 documentation comment blocks.
 #
-#    /************************************/
+#    /************************************/ (at least 2 asterisks)
 #    /*                                  */
 #    /*                                  */
 #    /*                                  */
-#    /************************************/
+#    /************************************/ (at least 2 asterisks)
 #
-# we define a few regular expressions here to detect them
-#
-
 start = r'''
   \s*      # any number of whitespace
   /\*{2,}/ # followed by '/' and at least two asterisks then '/'
@@ -75,16 +83,13 @@ re_source_block_format1 = SourceBlockFormat( 1, start, column, start )
 
 
 #
-# format 2 documentation comment blocks look like the following:
+# Format 2 documentation comment blocks.
 #
 #    /************************************ (at least 2 asterisks)
 #     *
+#     *                                    (1 asterisk)
 #     *
-#     *
-#     *
-#     **/       (1 or more asterisks at the end)
-#
-# we define a few regular expressions here to detect them
+#     */                                   (1 or more asterisks)
 #
 start = r'''
   \s*     # any number of whitespace
@@ -93,9 +98,9 @@ start = r'''
 '''
 
 column = r'''
-  \s*        # any number of whitespace
-  \*{1}(?!/) # followed by precisely one asterisk not followed by `/'
-  (.*)       # then anything (group1)
+  \s*           # any number of whitespace
+  \*{1}(?![*/]) # followed by precisely one asterisk not followed by `/'
+  (.*)          # then anything (group1)
 '''
 
 end = r'''
@@ -107,51 +112,101 @@ re_source_block_format2 = SourceBlockFormat( 2, start, column, end )
 
 
 #
-# the list of supported documentation block formats, we could add new ones
-# relatively easily
+# The list of supported documentation block formats.  We could add new ones
+# quite easily.
 #
 re_source_block_formats = [re_source_block_format1, re_source_block_format2]
 
 
 #
-# the following regular expressions corresponds to markup tags
-# within the documentation comment blocks. they're equivalent
-# despite their different syntax
+# The following regular expressions correspond to markup tags within the
+# documentation comment blocks.  They are equivalent despite their different
+# syntax.
+#
+# A markup tag consists of letters or character `-', to be found in group 1.
 #
-# notice how each markup tag _must_ begin a new line
+# Notice that a markup tag _must_ begin a new paragraph.
 #
-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
-# easily
+# The list of supported markup tags.  We could add new ones quite easily.
 #
 re_markup_tags = [re_markup_tag1, re_markup_tag2]
 
+
+#
+# A regular expression to detect a cross reference, after markup tags have
+# been stripped off.  Group 1 is the reference, group 2 the rest of the
+# line.
 #
-# used to detect a cross-reference, after markup tags have been stripped
+# A cross reference consists of letters, digits, or characters `-' and `_'.
 #
-re_crossref = re.compile( r'@(\w*)(.*)' )
+re_crossref = re.compile( r'@((?:\w|-)*)(.*)' )    #  @foo
 
 #
-# used to detect italic and bold styles in paragraph text
+# Two regular expressions to detect italic and bold markup, respectively.
+# Group 1 is the markup, group 2 the rest of the line.
 #
-re_italic = re.compile( r"_(\w(\w|')*)_(.*)" )     #  _italic_
-re_bold   = re.compile( r"\*(\w(\w|')*)\*(.*)" )   #  *bold*
+# Note that the markup is limited to words consisting of letters, digits,
+# the character `_', or an apostrophe (but not as the first character).
+#
+re_italic = re.compile( r"_(\w(?:\w|')*)_(.*)" )     #  _italic_
+re_bold   = re.compile( r"\*(\w(?:\w|')*)\*(.*)" )   #  *bold*
 
 #
-# used to detect the end of commented source lines
+# This regular expression code to identify an URL has been taken from
+#
+#   http://mail.python.org/pipermail/tutor/2002-September/017228.html
 #
-re_source_sep = re.compile( r'\s*/\*\s*\*/' )
+# (with slight modifications).
+#
+urls = r'(?:https?|telnet|gopher|file|wais|ftp)'
+ltrs = r'\w'
+gunk = r'/#~:.?+=&%@!\-'
+punc = r'.:?\-'
+any  = "%(ltrs)s%(gunk)s%(punc)s" % { 'ltrs' : ltrs,
+                                      'gunk' : gunk,
+                                      'punc' : punc }
+url  = r"""
+         (
+           \b                    # start at word boundary
+           %(urls)s :            # need resource and a colon
+           [%(any)s] +?          # followed by one or more of any valid
+                                 # character, but be conservative and
+                                 # take only what you need to...
+           (?=                   # [look-ahead non-consumptive assertion]
+             [%(punc)s]*         # either 0 or more punctuation
+             (?:                 # [non-grouping parentheses]
+               [^%(any)s] | $    # followed by a non-url char
+                                 # or end of the string
+             )
+           )
+         )
+        """ % {'urls' : urls,
+               'any'  : any,
+               'punc' : punc }
+
+re_url = re.compile( url, re.VERBOSE | re.MULTILINE )
 
 #
-# used to perform cross-reference within source output
+# A regular expression that stops collection of comments for the current
+# block.
+#
+re_source_sep = re.compile( r'\s*/\*\s*\*/' )   #  /* */
+
+#
+# A regular expression to find possible C identifiers while outputting
+# source code verbatim, covering things like `*foo' or `(bar'.  Group 1 is
+# the prefix, group 2 the identifier -- since we scan lines from left to
+# right, sequentially splitting the source code into prefix and identifier
+# is fully sufficient for our purposes.
 #
 re_source_crossref = re.compile( r'(\W*)(\w*)' )
 
 #
-# a list of reserved source keywords
+# A regular expression that matches a list of reserved C source keywords.
 #
 re_source_keywords = re.compile( '''\\b ( typedef   |
                                           struct    |
@@ -179,24 +234,16 @@ re_source_keywords = re.compile( '''\\b ( typedef   |
 ##
 ##  SOURCE BLOCK CLASS
 ##
-##   A SourceProcessor is in charge of reading a C source file
-##   and decomposing it into a series of different "SourceBlocks".
-##   each one of these blocks can be made of the following data:
-##
-##   - A documentation comment block that starts with "/**" and
-##     whose exact format will be discussed later
+##  There are two important fields in a `SourceBlock' object.
 ##
-##   - normal sources lines, including comments
+##    self.lines
+##      A list of text lines for the corresponding block.
 ##
-##   the important fields in a text block are the following ones:
-##
-##     self.lines   : a list of text lines for the corresponding block
-##
-##     self.content : for documentation comment blocks only, this is the
-##                    block content that has been "unboxed" from its
-##                    decoration. This is None for all other blocks
-##                    (i.e. sources or ordinary comments with no starting
-##                     markup tag)
+##    self.content
+##      For documentation comment blocks only, this is the block content
+##      that has been `unboxed' from its decoration.  This is `None' for all
+##      other blocks (i.e., sources or ordinary comments with no starting
+##      markup tag)
 ##
 class  SourceBlock:
 
@@ -233,7 +280,7 @@ class  SourceBlock:
     def  location( self ):
         return "(" + self.filename + ":" + repr( self.lineno ) + ")"
 
-    # debugging only - not used in normal operations
+    # debugging only -- not used in normal operations
     def  dump( self ):
         if self.content:
             print "{{{content start---"
@@ -250,39 +297,38 @@ class  SourceBlock:
             print line
 
 
-
 ################################################################
 ##
 ##  SOURCE PROCESSOR CLASS
 ##
-##   The SourceProcessor is in charge of reading a C source file
-##   and decomposing it into a series of different "SourceBlock"
-##   objects.
+##  The `SourceProcessor' is in charge of reading a C source file and
+##  decomposing it into a series of different `SourceBlock' objects.
 ##
-##   each one of these blocks can be made of the following data:
+##  A SourceBlock object consists of the following data.
 ##
-##   - A documentation comment block that starts with "/**" and
-##     whose exact format will be discussed later
+##    - A documentation comment block using one of the layouts above.  Its
+##      exact format will be discussed later.
 ##
-##   - normal sources lines, include comments
+##    - Normal sources lines, including comments.
 ##
 ##
 class  SourceProcessor:
 
     def  __init__( self ):
-        """initialize a source processor"""
+        """Initialize a source processor."""
         self.blocks   = []
         self.filename = None
         self.format   = None
         self.lines    = []
 
     def  reset( self ):
-        """reset a block processor, clean all its blocks"""
+        """Reset a block processor and clean up all its blocks."""
         self.blocks = []
         self.format = None
 
     def  parse_file( self, filename ):
-        """parse a C source file, and add its blocks to the processor's list"""
+        """Parse a C source file and add its blocks to the processor's
+           list."""
         self.reset()
 
         self.filename = filename
@@ -301,16 +347,16 @@ class  SourceProcessor:
                 self.process_normal_line( line )
             else:
                 if self.format.end.match( line ):
-                    # that's a normal block end, add it to 'lines' and
-                    # create a new block
+                    # A normal block end.  Add it to `lines' and create a
+                    # new block
                     self.lines.append( line )
                     self.add_block_lines()
                 elif self.format.column.match( line ):
-                    # that's a normal column line, add it to 'lines'
+                    # A normal column line.  Add it to `lines'.
                     self.lines.append( line )
                 else:
-                    # humm.. this is an unexpected block end,
-                    # create a new block, but don't process the line
+                    # An unexpected block end.  Create a new block, but
+                    # don't process the line.
                     self.add_block_lines()
 
                     # we need to process the line again
@@ -320,7 +366,8 @@ class  SourceProcessor:
         self.add_block_lines()
 
     def  process_normal_line( self, line ):
-        """process a normal line and check whether it is the start of a new block"""
+        """Process a normal line and check whether it is the start of a new
+           block."""
         for f in re_source_block_formats:
             if f.start.match( line ):
                 self.add_block_lines()
@@ -330,9 +377,12 @@ class  SourceProcessor:
         self.lines.append( line )
 
     def  add_block_lines( self ):
-        """add the current accumulated lines and create a new block"""
+        """Add the current accumulated lines and create a new block."""
         if self.lines != []:
-            block = SourceBlock( self, self.filename, self.lineno, self.lines )
+            block = SourceBlock( self,
+                                 self.filename,
+                                 self.lineno,
+                                 self.lines )
 
             self.blocks.append( block )
             self.format = None
@@ -340,7 +390,7 @@ class  SourceProcessor:
 
     # debugging only, not used in normal operations
     def  dump( self ):
-        """print all blocks in a processor"""
+        """Print all blocks in a processor."""
         for b in self.blocks:
             b.dump()
 
index fffa120..05fc08a 100644 (file)
@@ -1,5 +1,19 @@
-#  ToHTML (c) 2002, 2003, 2005, 2006, 2007, 2008
-#    David Turner <david@freetype.org>
+#
+#  tohtml.py
+#
+#    A sub-class container of the `Formatter' class to produce HTML.
+#
+#  Copyright 2002, 2003, 2005-2008, 2013, 2014 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
+#  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 parent class is contained in file `formatter.py'.
+
 
 from sources import *
 from content import *
@@ -8,7 +22,7 @@ from formatter import *
 import time
 
 
-# The following defines the HTML header used by all generated pages.
+# The following strings define the HTML header used by all generated pages.
 html_header_1 = """\
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
@@ -21,62 +35,125 @@ html_header_1 = """\
 html_header_2 = """\
  API Reference</title>
 <style type="text/css">
+  a:link { color: #0000EF; }
+  a:visited { color: #51188E; }
+  a:hover { color: #FF0000; }
+
   body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
          color: #000000;
-         background: #FFFFFF; }
+         background: #FFFFFF;
+         width: 87%;
+         margin: auto; }
+
+  div.section { width: 75%;
+                margin: auto; }
+  div.section hr { margin: 4ex 0 1ex 0; }
+  div.section h4 { background-color: #EEEEFF;
+                   font-size: medium;
+                   font-style: oblique;
+                   font-weight: bold;
+                   margin: 3ex 0 1.5ex 9%;
+                   padding: 0.3ex 0 0.3ex 1%; }
+  div.section p { margin: 1.5ex 0 1.5ex 10%; }
+  div.section pre { margin: 3ex 0 3ex 9%;
+                    background-color: #D6E8FF;
+                    padding: 2ex 0 2ex 1%; }
+  div.section table.fields { width: 90%;
+                             margin: 1.5ex 0 1.5ex 10%; }
+  div.section table.toc { width: 95%;
+                          margin: 1.5ex 0 1.5ex 5%; }
+  div.timestamp { text-align: center;
+                  font-size: 69%;
+                  margin: 1.5ex 0 1.5ex 0; }
 
-  p { text-align: justify; }
   h1 { text-align: center; }
-  li { text-align: justify; }
-  td { padding: 0 0.5em 0 0.5em; }
-  td.left { padding: 0 0.5em 0 0.5em;
-            text-align: left; }
+  h3 { font-size: medium;
+       margin: 4ex 0 1.5ex 0; }
 
-  a:link { color: #0000EF; }
-  a:visited { color: #51188E; }
-  a:hover { color: #FF0000; }
+  p { text-align: justify; }
+
+  pre.colored { color: blue; }
 
   span.keyword { font-family: monospace;
                  text-align: left;
                  white-space: pre;
                  color: darkblue; }
 
-  pre.colored { color: blue; }
+  table.fields td.val { font-weight: bold;
+                        text-align: right;
+                        width: 30%;
+                        vertical-align: baseline;
+                        padding: 1ex 1em 1ex 0; }
+  table.fields td.desc { vertical-align: baseline;
+                         padding: 1ex 0 1ex 1em; }
+  table.fields td.desc p:first-child { margin: 0; }
+  table.fields td.desc p { margin: 1.5ex 0 0 0; }
+  table.index { margin: 6ex auto 6ex auto;
+                border: 0;
+                border-collapse: separate;
+                border-spacing: 1em 0.3ex; }
+  table.index tr { padding: 0; }
+  table.index td { padding: 0; }
+  table.index-toc-link { width: 100%;
+                         border: 0;
+                         border-spacing: 0;
+                         margin: 1ex 0 1ex 0; }
+  table.index-toc-link td.left { padding: 0 0.5em 0 0.5em;
+                                 font-size: 83%;
+                                 text-align: left; }
+  table.index-toc-link td.middle { padding: 0 0.5em 0 0.5em;
+                                   font-size: 83%;
+                                   text-align: center; }
+  table.index-toc-link td.right { padding: 0 0.5em 0 0.5em;
+                                  font-size: 83%;
+                                  text-align: right; }
+  table.synopsis { margin: 6ex auto 6ex auto;
+                   border: 0;
+                   border-collapse: separate;
+                   border-spacing: 2em 0.6ex; }
+  table.synopsis tr { padding: 0; }
+  table.synopsis td { padding: 0; }
+  table.toc td.link { width: 30%;
+                      text-align: right;
+                      vertical-align: baseline;
+                      padding: 1ex 1em 1ex 0; }
+  table.toc td.desc { vertical-align: baseline;
+                      padding: 1ex 0 1ex 1em;
+                      text-align: left; }
+  table.toc td.desc p:first-child { margin: 0;
+                                    text-align: left; }
+  table.toc td.desc p { margin: 1.5ex 0 0 0;
+                        text-align: left; }
 
-  ul.empty { list-style-type: none; }
 </style>
 </head>
 <body>
 """
 
-html_header_3 = """
-<table align=center><tr><td><font size=-1>[<a href="\
+html_header_3l = """
+<table class="index-toc-link"><tr><td class="left">[<a href="\
 """
 
-html_header_3i = """
-<table align=center><tr><td width="100%"></td>
-<td><font size=-1>[<a href="\
+html_header_3r = """
+<table class="index-toc-link"><tr><td class="right">[<a href="\
 """
 
 html_header_4 = """\
-">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="\
+">Index</a>]</td><td class="right">[<a href="\
 """
 
-html_header_5 = """\
-">TOC</a>]</font></td></tr></table>
-<center><h1>\
+html_header_5t = """\
+">TOC</a>]</td></tr></table>
+<h1>\
 """
 
-html_header_5t = """\
-">Index</a>]</font></td>
-<td width="100%"></td></tr></table>
-<center><h1>\
+html_header_5i = """\
+">Index</a>]</td></tr></table>
+<h1>\
 """
 
 html_header_6 = """\
- API Reference</h1></center>
+ API Reference</h1>
 """
 
 
@@ -87,8 +164,8 @@ html_footer = """\
 """
 
 # The header and footer used for each section.
-section_title_header = "<center><h1>"
-section_title_footer = "</h1></center>"
+section_title_header = "<h1>"
+section_title_footer = "</h1>"
 
 # The header and footer used for code segments.
 code_header = '<pre class="colored">'
@@ -99,66 +176,65 @@ para_header = "<p>"
 para_footer = "</p>"
 
 # Block header and footer.
-block_header        = '<table align=center width="75%"><tr><td>'
+block_header        = '<div class="section">'
 block_footer_start  = """\
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="\
+<hr>
+<table class="index-toc-link"><tr><td class="left">[<a href="\
 """
 block_footer_middle = """\
-">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="\
+">Index</a>]</td>\
+<td class="middle">[<a href="#">Top</a>]</td>\
+<td class="right">[<a href="\
 """
 block_footer_end    = """\
-">TOC</a>]</font></td></tr></table>
+">TOC</a>]</td></tr></table></div>
 """
 
 # Description header/footer.
-description_header = '<table align=center width="87%"><tr><td>'
-description_footer = "</td></tr></table><br>"
+description_header = ""
+description_footer = ""
 
 # Marker header/inter/footer combination.
-marker_header = '<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>'
-marker_inter  = "</b></em></td></tr><tr><td>"
-marker_footer = "</td></tr></table>"
+marker_header = "<h4>"
+marker_inter  = "</h4>"
+marker_footer = ""
 
 # Header location header/footer.
-header_location_header = '<table align=center width="87%"><tr><td>'
-header_location_footer = "</td></tr></table><br>"
+header_location_header = "<p>"
+header_location_footer = "</p>"
 
 # Source code extracts header/footer.
-source_header = '<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>\n'
-source_footer = "\n</pre></table><br>"
+source_header = "<pre>"
+source_footer = "</pre>"
 
 # Chapter header/inter/footer.
-chapter_header = '<br><table align=center width="75%"><tr><td><h2>'
-chapter_inter  = '</h2><ul class="empty"><li>'
-chapter_footer = '</li></ul></td></tr></table>'
+chapter_header = """\
+<div class="section">
+<h2>\
+"""
+chapter_inter  = '</h2>'
+chapter_footer = '</div>'
 
 # Index footer.
 index_footer_start = """\
 <hr>
-<table><tr><td width="100%"></td>
-<td><font size=-2>[<a href="\
+<table class="index-toc-link"><tr><td class="right">[<a href="\
 """
 index_footer_end = """\
-">TOC</a>]</font></td></tr></table>
+">TOC</a>]</td></tr></table>
 """
 
 # TOC footer.
 toc_footer_start = """\
 <hr>
-<table><tr><td><font size=-2>[<a href="\
+<table class="index-toc-link"><tr><td class="left">[<a href="\
 """
 toc_footer_end = """\
-">Index</a>]</font></td>
-<td width="100%"></td>
-</tr></table>
+">Index</a>]</td></tr></table>
 """
 
 
-# source language keyword coloration/styling
+# Source language keyword coloration and styling.
 keyword_prefix = '<span class="keyword">'
 keyword_suffix = '</span>'
 
@@ -166,95 +242,78 @@ section_synopsis_header = '<h2>Synopsis</h2>'
 section_synopsis_footer = ''
 
 
-# Translate a single line of source to HTML.  This will convert
-# a "<" into "&lt.", ">" into "&gt.", etc.
+# Translate a single line of source to HTML.  This converts `<', `>', and
+# `&' into `&lt;',`&gt;', and `&amp;'.
+#
 def  html_quote( line ):
-    result = string.replace( line, "&", "&amp;" )
-    result = string.replace( result, "<", "&lt;" )
-    result = string.replace( result, ">", "&gt;" )
+    result = string.replace( line,   "&", "&amp;" )
+    result = string.replace( result, "<", "&lt;"  )
+    result = string.replace( result, ">", "&gt;"  )
     return result
 
 
-# same as 'html_quote', but ignores left and right brackets
-def  html_quote0( line ):
-    return string.replace( line, "&", "&amp;" )
-
-
-def  dump_html_code( lines, prefix = "" ):
-    # clean the last empty lines
-    l = len( self.lines )
-    while l > 0 and string.strip( self.lines[l - 1] ) == "":
-        l = l - 1
-
-    # The code footer should be directly appended to the last code
-    # line to avoid an additional blank line.
-    print prefix + code_header,
-    for line in self.lines[0 : l + 1]:
-        print '\n' + prefix + html_quote( line ),
-    print prefix + code_footer,
-
-
-
+################################################################
+##
+##  HTML FORMATTER CLASS
+##
 class  HtmlFormatter( Formatter ):
 
     def  __init__( self, processor, project_title, file_prefix ):
         Formatter.__init__( self, processor )
 
-        global html_header_1, html_header_2, html_header_3
-        global html_header_4, html_header_5, html_footer
+        global html_header_1
+        global html_header_2
+        global html_header_3l, html_header_3r
+        global html_header_4
+        global html_header_5t, html_header_5i
+        global html_header_6
+        global html_footer
 
         if file_prefix:
             file_prefix = file_prefix + "-"
         else:
             file_prefix = ""
 
-        self.headers           = processor.headers
-        self.project_title     = project_title
-        self.file_prefix       = file_prefix
-        self.html_header       = html_header_1 + project_title +              \
-                                 html_header_2 +                              \
-                                 html_header_3 + file_prefix + "index.html" + \
-                                 html_header_4 + file_prefix + "toc.html" +   \
-                                 html_header_5 + project_title +              \
-                                 html_header_6
-
-        self.html_index_header = html_header_1 + project_title +             \
-                                 html_header_2 +                             \
-                                 html_header_3i + file_prefix + "toc.html" + \
-                                 html_header_5 + project_title +             \
-                                 html_header_6
-
-        self.html_toc_header   = html_header_1 + project_title +              \
-                                 html_header_2 +                              \
-                                 html_header_3 + file_prefix + "index.html" + \
-                                 html_header_5t + project_title +             \
-                                 html_header_6
-
-        self.html_footer       = "<center><font size=""-2"">generated on " +     \
-                                 time.asctime( time.localtime( time.time() ) ) + \
-                                 "</font></center>" + html_footer
+        self.headers       = processor.headers
+        self.project_title = project_title
+        self.file_prefix   = file_prefix
+        self.html_header   = (
+          html_header_1 + project_title
+          + html_header_2
+          + html_header_3l + file_prefix + "index.html"
+          + html_header_4 + file_prefix + "toc.html"
+          + html_header_5t + project_title
+          + html_header_6 )
+        self.html_index_header = (
+          html_header_1 + project_title
+          + html_header_2
+          + html_header_3r + file_prefix + "toc.html"
+          + html_header_5t + project_title
+          + html_header_6 )
+        self.html_toc_header = (
+          html_header_1 + project_title
+          + html_header_2
+          + html_header_3l + file_prefix + "index.html"
+          + html_header_5i + project_title
+          + html_header_6 )
+        self.html_footer = (
+          '<div class="timestamp">generated on '
+          + time.asctime( time.localtime( time.time() ) )
+          + "</div>" + html_footer )
 
         self.columns = 3
 
     def  make_section_url( self, section ):
         return self.file_prefix + section.name + ".html"
 
-    def  make_block_url( self, block ):
-        return self.make_section_url( block.section ) + "#" + block.name
-
-    def  make_html_words( self, words ):
-        """ convert a series of simple words into some HTML text """
-        line = ""
-        if words:
-            line = html_quote( words[0] )
-            for w in words[1:]:
-                line = line + " " + html_quote( w )
-
-        return line
+    def  make_block_url( self, block, name = None ):
+        if name == None:
+            name = block.name
+        return self.make_section_url( block.section ) + "#" + name
 
     def  make_html_word( self, word ):
-        """analyze a simple word to detect cross-references and styling"""
-        # look for cross-references
+        """Analyze a simple word to detect cross-references and markup."""
+        # handle cross-references
         m = re_crossref.match( word )
         if m:
             try:
@@ -265,35 +324,38 @@ class  HtmlFormatter( Formatter ):
                 return '<a href="' + url + '">' + name + '</a>' + rest
             except:
                 # we detected a cross-reference to an unknown item
-                sys.stderr.write( \
-                   "WARNING: undefined cross reference '" + name + "'.\n" )
+                sys.stderr.write( "WARNING: undefined cross reference"
+                                  + " '" + name + "'.\n" )
                 return '?' + name + '?' + rest
 
-        # look for italics and bolds
+        # handle markup for italic and bold
         m = re_italic.match( word )
         if m:
             name = m.group( 1 )
-            rest = m.group( 3 )
+            rest = m.group( 2 )
             return '<i>' + name + '</i>' + rest
 
         m = re_bold.match( word )
         if m:
             name = m.group( 1 )
-            rest = m.group( 3 )
+            rest = m.group( 2 )
             return '<b>' + name + '</b>' + rest
 
         return html_quote( word )
 
     def  make_html_para( self, words ):
-        """ convert words of a paragraph into tagged HTML text, handle xrefs """
+        """Convert words of a paragraph into tagged HTML text.  Also handle
+           cross references."""
         line = ""
         if words:
             line = self.make_html_word( words[0] )
             for word in words[1:]:
                 line = line + " " + self.make_html_word( word )
+            # handle hyperlinks
+            line = re_url.sub( r'<a href="\1">\1</a>', line )
             # convert `...' quotations into real left and right single quotes
-            line = re.sub( r"(^|\W)`(.*?)'(\W|$)",  \
-                           r'\1&lsquo;\2&rsquo;\3', \
+            line = re.sub( r"(^|\W)`(.*?)'(\W|$)",
+                           r'\1&lsquo;\2&rsquo;\3',
                            line )
             # convert tilde into non-breakable space
             line = string.replace( line, "~", "&nbsp;" )
@@ -301,7 +363,7 @@ class  HtmlFormatter( Formatter ):
         return para_header + line + para_footer
 
     def  make_html_code( self, lines ):
-        """ convert a code sequence to HTML """
+        """Convert a code sequence to HTML."""
         line = code_header + '\n'
         for l in lines:
             line = line + html_quote( l ) + '\n'
@@ -309,7 +371,7 @@ class  HtmlFormatter( Formatter ):
         return line + code_footer
 
     def  make_html_items( self, items ):
-        """ convert a field's content into some valid HTML """
+        """Convert a field's content into HTML."""
         lines = []
         for item in items:
             if item.lines:
@@ -324,7 +386,9 @@ class  HtmlFormatter( Formatter ):
 
     def  print_html_field( self, field ):
         if field.name:
-            print "<table><tr valign=top><td><b>" + field.name + "</b></td><td>"
+            print( '<table><tr valign="top"><td><b>'
+                   + field.name
+                   + "</b></td><td>" )
 
         print self.make_html_items( field.items )
 
@@ -345,12 +409,24 @@ class  HtmlFormatter( Formatter ):
                     result = result + prefix + '<b>' + name + '</b>'
                 elif re_source_keywords.match( name ):
                     # this is a C keyword
-                    result = result + prefix + keyword_prefix + name + keyword_suffix
-                elif self.identifiers.has_key( name ):
+                    result = ( result + prefix
+                               + keyword_prefix + name + keyword_suffix )
+                elif name in self.identifiers:
                     # this is a known identifier
                     block = self.identifiers[name]
-                    result = result + prefix + '<a href="' + \
-                             self.make_block_url( block ) + '">' + name + '</a>'
+                    id = block.name
+
+                    # link to a field ID if possible
+                    for markup in block.markups:
+                        if markup.tag == 'values':
+                            for field in markup.fields:
+                                if field.name:
+                                    id = name
+
+                    result = ( result + prefix
+                               + '<a href="'
+                               + self.make_block_url( block, id )
+                               + '">' + name + '</a>' )
                 else:
                     result = result + html_quote( line[:length] )
 
@@ -362,15 +438,11 @@ class  HtmlFormatter( Formatter ):
         return result
 
     def  print_html_field_list( self, fields ):
-        print "<p></p>"
-        print "<table cellpadding=3 border=0>"
+        print '<table class="fields">'
         for field in fields:
-            if len( field.name ) > 22:
-              print "<tr valign=top><td colspan=0><b>" + field.name + "</b></td></tr>"
-              print "<tr valign=top><td></td><td>"
-            else:
-              print "<tr valign=top><td><b>" + field.name + "</b></td><td>"
-
+            print ( '<tr><td class="val" id="' + field.name + '">'
+                    + field.name
+                    + '</td><td class="desc">' )
             self.print_html_items( field.items )
             print "</td></tr>"
         print "</table>"
@@ -379,10 +451,9 @@ class  HtmlFormatter( Formatter ):
         table_fields = []
         for field in markup.fields:
             if field.name:
-                # we begin a new series of field or value definitions, we
-                # will record them in the 'table_fields' list before outputting
-                # all of them as a single table
-                #
+                # We begin a new series of field or value definitions.  We
+                # record them in the `table_fields' list before outputting
+                # all of them as a single table.
                 table_fields.append( field )
             else:
                 if table_fields:
@@ -395,7 +466,7 @@ class  HtmlFormatter( Formatter ):
             self.print_html_field_list( table_fields )
 
     #
-    #  Formatting the index
+    # formatting the index
     #
     def  index_enter( self ):
         print self.html_index_header
@@ -407,11 +478,11 @@ class  HtmlFormatter( Formatter ):
         self.index_items[name] = url
 
     def  index_exit( self ):
-        # block_index already contains the sorted list of index names
+        # `block_index' already contains the sorted list of index names
         count = len( self.block_index )
-        rows  = ( count + self.columns - 1 ) / self.columns
+        rows  = ( count + self.columns - 1 ) // self.columns
 
-        print "<table align=center border=0 cellpadding=0 cellspacing=0>"
+        print '<table class="index">'
         for r in range( rows ):
             line = "<tr>"
             for c in range( self.columns ):
@@ -419,7 +490,8 @@ class  HtmlFormatter( Formatter ):
                 if i < count:
                     bname = self.block_index[r + c * rows]
                     url   = self.index_items[bname]
-                    line = line + '<td><a href="' + url + '">' + bname + '</a></td>'
+                    line  = ( line + '<td><a href="' + url + '">'
+                              + bname + '</a></td>' )
                 else:
                     line = line + '<td></td>'
             line = line + "</tr>"
@@ -427,9 +499,9 @@ class  HtmlFormatter( Formatter ):
 
         print "</table>"
 
-        print index_footer_start +            \
-              self.file_prefix + "toc.html" + \
-              index_footer_end
+        print( index_footer_start
+               + self.file_prefix + "toc.html"
+               + index_footer_end )
 
         print self.html_footer
 
@@ -442,21 +514,20 @@ class  HtmlFormatter( Formatter ):
         Formatter.index_dump( self, index_filename )
 
     #
-    #  Formatting the table of content
+    # formatting the table of contents
     #
     def  toc_enter( self ):
         print self.html_toc_header
-        print "<center><h1>Table of Contents</h1></center>"
+        print "<h1>Table of Contents</h1>"
 
     def  toc_chapter_enter( self, chapter ):
-        print  chapter_header + string.join( chapter.title ) + chapter_inter
-        print "<table cellpadding=5>"
+        print chapter_header + string.join( chapter.title ) + chapter_inter
+        print '<table class="toc">'
 
     def  toc_section_enter( self, section ):
-        print '<tr valign=top><td class="left">'
-        print '<a href="' + self.make_section_url( section ) + '">' + \
-               section.title + '</a></td><td>'
-
+        print ( '<tr><td class="link">'
+                + '<a href="' + self.make_section_url( section ) + '">'
+                + section.title + '</a></td><td class="desc">' )
         print self.make_html_para( section.abstract )
 
     def  toc_section_exit( self, section ):
@@ -467,14 +538,14 @@ class  HtmlFormatter( Formatter ):
         print chapter_footer
 
     def  toc_index( self, index_filename ):
-        print chapter_header +                                      \
-              '<a href="' + index_filename + '">Global Index</a>' + \
-              chapter_inter + chapter_footer
+        print( chapter_header
+               + '<a href="' + index_filename + '">Global Index</a>'
+               + chapter_inter + chapter_footer )
 
     def  toc_exit( self ):
-        print toc_footer_start +                \
-              self.file_prefix + "index.html" + \
-              toc_footer_end
+        print( toc_footer_start
+               + self.file_prefix + "index.html"
+               + toc_footer_end )
 
         print self.html_footer
 
@@ -488,14 +559,12 @@ class  HtmlFormatter( Formatter ):
         Formatter.toc_dump( self, toc_filename, index_filename )
 
     #
-    #  Formatting sections
+    # formatting sections
     #
     def  section_enter( self, section ):
         print self.html_header
 
-        print section_title_header
-        print section.title
-        print section_title_footer
+        print section_title_header + section.title + section_title_footer
 
         maxwidth = 0
         for b in section.blocks.values():
@@ -503,32 +572,43 @@ class  HtmlFormatter( Formatter ):
                 maxwidth = len( b.name )
 
         width = 70  # XXX magic number
-        if maxwidth <> 0:
+        if maxwidth > 0:
             # print section synopsis
             print section_synopsis_header
-            print "<table align=center cellspacing=5 cellpadding=0 border=0>"
+            print '<table class="synopsis">'
 
-            columns = width / maxwidth
+            columns = width // maxwidth
             if columns < 1:
                 columns = 1
 
             count = len( section.block_names )
-            rows  = ( count + columns - 1 ) / columns
+            # don't handle last entry if it is empty
+            if section.block_names[-1] == "/empty/":
+                count -= 1
+            rows  = ( count + columns - 1 ) // columns
 
             for r in range( rows ):
                 line = "<tr>"
                 for c in range( columns ):
                     i = r + c * rows
-                    line = line + '<td></td><td>'
+                    line = line + '<td>'
                     if i < count:
                         name = section.block_names[i]
-                        line = line + '<a href="#' + name + '">' + name + '</a>'
+                        if name == "/empty/":
+                            # it can happen that a complete row is empty, and
+                            # without a proper `filler' the browser might
+                            # collapse the row to a much smaller height (or
+                            # even omit it completely)
+                            line = line + "&nbsp;"
+                        else:
+                            line = ( line + '<a href="#' + name + '">'
+                                     + name + '</a>' )
 
                     line = line + '</td>'
                 line = line + "</tr>"
                 print line
 
-            print "</table><br><br>"
+            print "</table>"
             print section_synopsis_footer
 
         print description_header
@@ -540,7 +620,7 @@ class  HtmlFormatter( Formatter ):
 
         # place html anchor if needed
         if block.name:
-            print '<h4><a name="' + block.name + '">' + block.name + '</a></h4>'
+            print( '<h3 id="' + block.name + '">' + block.name + '</h3>' )
 
         # dump the block C source lines now
         if block.code:
@@ -548,16 +628,17 @@ class  HtmlFormatter( Formatter ):
             for f in self.headers.keys():
                 if block.source.filename.find( f ) >= 0:
                     header = self.headers[f] + ' (' + f + ')'
-                    break;
-                
+                    break
+
 #           if not header:
-#               sys.stderr.write( \
-#                 'WARNING: No header macro for ' + block.source.filename + '.\n' )
+#               sys.stderr.write(
+#                 "WARNING: No header macro for"
+#                 + " '" + block.source.filename + "'.\n" )
 
             if header:
-                print header_location_header
-                print 'Defined in ' + header + '.'
-                print header_location_footer
+                print header_location_header
+                        + 'Defined in ' + header + '.'
+                        + header_location_footer )
 
             print source_header
             for l in block.code:
@@ -579,15 +660,16 @@ class  HtmlFormatter( Formatter ):
             print marker_footer
 
     def  block_exit( self, block ):
-        print block_footer_start + self.file_prefix + "index.html" + \
-              block_footer_middle + self.file_prefix + "toc.html" +  \
-              block_footer_end
+        print( block_footer_start + self.file_prefix + "index.html"
+               + block_footer_middle + self.file_prefix + "toc.html"
+               + block_footer_end )
 
     def  section_exit( self, section ):
         print html_footer
 
     def  section_dump_all( self ):
         for section in self.sections:
-            self.section_dump( section, self.file_prefix + section.name + '.html' )
+            self.section_dump( section,
+                               self.file_prefix + section.name + '.html' )
 
 # eof
index 1d96658..b35823a 100644 (file)
@@ -1,48 +1,42 @@
-#  Utils (c) 2002, 2004, 2007, 2008  David Turner <david@freetype.org>
 #
-
-import string, sys, os, glob
-
-# current output directory
+#  utils.py
 #
-output_dir = None
-
-
-# This function is used to sort the index.  It is a simple lexicographical
-# sort, except that it places capital letters before lowercase ones.
+#    Auxiliary functions for the `docmaker' tool (library file).
 #
-def  index_sort( s1, s2 ):
-    if not s1:
-        return -1
-
-    if not s2:
-        return 1
-
-    l1 = len( s1 )
-    l2 = len( s2 )
-    m1 = string.lower( s1 )
-    m2 = string.lower( s2 )
+#  Copyright 2002, 2004, 2007, 2008, 2014 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
+#  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.
 
-    for i in range( l1 ):
-        if i >= l2 or m1[i] > m2[i]:
-            return 1
 
-        if m1[i] < m2[i]:
-            return -1
+import string, sys, os, glob, itertools
 
-        if s1[i] < s2[i]:
-            return -1
 
-        if s1[i] > s2[i]:
-            return 1
+# current output directory
+#
+output_dir = None
 
-    if l2 > l1:
-        return -1
 
-    return 0
+# A function that generates a sorting key.  We want lexicographical order
+# (primary key) except that capital letters are sorted before lowercase
+# ones (secondary key).
+#
+# The primary key is implemented by lowercasing the input.  The secondary
+# key is simply the original data appended, character by character.  For
+# example, the sort key for `FT_x' is `fFtT__xx', while the sort key for
+# `ft_X' is `fftt__xX'.  Since ASCII codes of uppercase letters are
+# numerically smaller than the codes of lowercase letters, `fFtT__xx' gets
+# sorted before `fftt__xX'.
+#
+def  index_key( s ):
+    return string.join( itertools.chain( *zip( s.lower(), s ) ) )
 
 
-# Sort input_list, placing the elements of order_list in front.
+# Sort `input_list', placing the elements of `order_list' in front.
 #
 def  sort_order_list( input_list, order_list ):
     new_list = order_list[:]
@@ -52,9 +46,9 @@ def  sort_order_list( input_list, order_list ):
     return new_list
 
 
-# Open the standard output to a given project documentation file.  Use
-# "output_dir" to determine the filename location if necessary and save the
-# old stdout in a tuple that is returned by this function.
+# Divert standard output to a given project documentation file.  Use
+# `output_dir' to determine the filename location if necessary and save the
+# old stdout handle in a tuple that is returned by this function.
 #
 def  open_output( filename ):
     global output_dir
@@ -69,7 +63,7 @@ def  open_output( filename ):
     return ( new_file, old_stdout )
 
 
-# Close the output that was returned by "close_output".
+# Close the output that was returned by `open_output'.
 #
 def  close_output( output ):
     output[0].close()
@@ -83,15 +77,16 @@ def  check_output():
     if output_dir:
         if output_dir != "":
             if not os.path.isdir( output_dir ):
-                sys.stderr.write( "argument" + " '" + output_dir + "' " + \
-                                  "is not a valid directory" )
+                sys.stderr.write( "argument"
+                                  + " '" + output_dir + "' "
+                                  + "is not a valid directory" )
                 sys.exit( 2 )
         else:
             output_dir = None
 
 
 def  file_exists( pathname ):
-    """checks that a given file exists"""
+    """Check that a given file exists."""
     result = 1
     try:
         file = open( pathname, "r" )
@@ -104,12 +99,12 @@ def  file_exists( pathname ):
 
 
 def  make_file_list( args = None ):
-    """builds a list of input files from command-line arguments"""
+    """Build a list of input files from command-line arguments."""
     file_list = []
     # sys.stderr.write( repr( sys.argv[1 :] ) + '\n' )
 
     if not args:
-        args = sys.argv[1 :]
+        args = sys.argv[1:]
 
     for pathname in args:
         if string.find( pathname, '*' ) >= 0:
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.
-  --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.
index 4daac0d..9a5b632 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:
   {
     FT_Library  context;
     FT_Face     face;
-    int         i, num;
 
 
     if ( FT_Init_FreeType( &context ) )
       TestFace( face );
     else
     {
+      int  i, num;
+
+
       num = face->num_faces;
       FT_Done_Face( face );
 
   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;
 
     for ( i = 0; fontdirs[i] != NULL; ++i )
     {
+      DIR*            examples;
+      struct dirent*  ent;
+
+
       examples = opendir( fontdirs[i] );
       if ( examples == NULL )
       {
       fseek( new, getRandom( 0, item->len - 1 ), SEEK_SET );
 
       if ( item->isbinary )
-        putc( getRandom( 0, 0xff ), new );
+        putc( getRandom( 0, 0xFF ), new );
       else if ( item->isascii )
-        putc( getRandom( 0x20, 0x7e ), new );
+        putc( getRandom( 0x20, 0x7E ), new );
       else
       {
         int  hex = getRandom( 0, 15 );
         char**  argv )
   {
     char    **dirs, **exts;
-    char    *pt, *end;
     int     dcnt = 0, ecnt = 0, rset = false, allexts = false;
     int     i;
     time_t  now;
 
     for ( i = 1; i < argc; ++i )
     {
-      pt = argv[i];
+      char*  pt = argv[i];
+      char*  end;
+
+
       if ( pt[0] == '-' && pt[1] == '-' )
         ++pt;
 
     }
 
     if ( allexts )
+    {
+      free( exts );
       exts = NULL;
+    }
     else if ( ecnt == 0 )
+    {
+      free( exts );
       exts = default_ext_list;
+    }
 
     if ( dcnt == 0 )
+    {
+      free( dirs );
       dirs = default_dir_list;
+    }
 
     if ( testfile != NULL )
       ExecuteTest( testfile );         /* This should never return */
index f5f9936..24cd0c4 100644 (file)
 
 
     if ( argc < 2 )
-      return FT_Err_Invalid_Argument;
+      return FT_ERR( Invalid_Argument );
 
     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 )
   {
       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 ) );
+    printf( "cbox_hex = [%08X %08X %08X %08X]\n",
+             bbox.xMin, bbox.yMin, bbox.xMax, bbox.yMax );
 
 
     time0 = get_time();
       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 ) );
+    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 )
   {
 
     printf( "outline #2\n" );
     profile_outline( &dummy_outline_2, REPEAT );
+
+    printf( "outline #3\n" );
+    profile_outline( &dummy_outline_3, REPEAT );
+
     return 0;
   }
 
index 8c8a544..99ac1cf 100644 (file)
@@ -8,9 +8,8 @@
 #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;
   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 += 0x10000L )
     {
+      FT_Fixed  f1, f2;
+      double    d2;
+
+
       f1 = FT_Cos(i);
-      d1 = f1/65536.0;
       d2 = cos( i*SPI );
       f2 = (FT_Fixed)(d2*65536.0);
 
   }
 
 
-
   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 += 0x10000L )
     {
+      FT_Fixed  f1, f2;
+      double    d2;
+
+
       f1 = FT_Sin(i);
-      d1 = f1/65536.0;
       d2 = sin( i*SPI );
       f2 = (FT_Fixed)(d2*65536.0);
 
   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 - 0x2000000L; i += 0x10000L )
     {
+      FT_Fixed  f1, f2;
+      double    d2;
+
+
       f1 = FT_Tan(i);
-      d1 = f1/65536.0;
       d2 = tan( i*SPI );
       f2 = (FT_Fixed)(d2*65536.0);
 
   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 += 0x10000L )
     {
+      FT_Fixed  c2, s2;
+      double    l, a, c1, s1;
+      int       j;
+
+
       l  = 5.0;
       a  = i*SPI;
 
     }
   }
 
+
   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 += 0x10000L )
     {
+      FT_Vector  v;
+      double     a, c1, s1;
+      FT_Fixed   c2, s2;
+
+
       FT_Vector_Unit( &v, i );
       a  = ( i*SPI );
       c1 = cos(a);
   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 += 0x10000L )
     {
+      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 ) );
   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 += 0x10000L )
     {
+      double  ra, cra, sra;
+      int     i;
+
+
       ra  = rotate*SPI;
       cra = cos( ra );
       sra = sin( ra );
 
-      for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
+      for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L )
       {
+        FT_Fixed   c2, s2, c4, s4;
+        FT_Vector  v;
+        double     l, a, c1, s1, c3, s3;
+
+
         l  = 500.0;
         a  = i*SPI;
 
index 507ef16..d4b69f5 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2001, 2003, 2004, 2011 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,
@@ -31,7 +31,8 @@ TT_DRV_SRC := $(TT_DIR)/ttdriver.c \
               $(TT_DIR)/ttinterp.c \
               $(TT_DIR)/ttobjs.c   \
               $(TT_DIR)/ttpic.c    \
-              $(TT_DIR)/ttpload.c
+              $(TT_DIR)/ttpload.c  \
+              $(TT_DIR)/ttsubpix.c
 
 # TrueType driver headers
 #
index 4bd1209..576912b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
@@ -27,6 +27,7 @@
 
 #ifdef TT_USE_BYTECODE_INTERPRETER
 #include "ttinterp.c"
+#include "ttsubpix.c"
 #endif
 
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
index 3669d45..ecf4cdc 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType font driver implementation (body).                          */
 /*                                                                         */
-/*  Copyright 1996-2012 by                                                 */
+/*  Copyright 1996-2014 by                                                 */
 /*  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 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"
 #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_UShort  ah;
 
 
-        TT_Get_VMetrics( face, start + nn, &tsb, &ah );
+        /* since we don't need `tsb', we use zero for `yMax' parameter */
+        TT_Get_VMetrics( face, start + nn, 0, &tsb, &ah );
         advances[nn] = ah;
       }
     }
       }
     }
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
   /*************************************************************************/
   {
     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;
       /* use the scaled metrics, even when tt_size_reset fails */
       FT_Select_Metrics( size->face, strike_index );
 
-      tt_size_reset( ttsize );
+      tt_size_reset( ttsize ); /* ignore return value */
     }
     else
     {
                    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
 
 
     if ( !slot )
-      return TT_Err_Invalid_Slot_Handle;
+      return FT_THROW( Invalid_Slot_Handle );
 
     if ( !size )
-      return TT_Err_Invalid_Size_Handle;
+      return FT_THROW( Invalid_Size_Handle );
 
     if ( !face )
-      return TT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Face_Handle );
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
     if ( glyph_index >= (FT_UInt)face->num_glyphs &&
 #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 )
     {
   /*************************************************************************/
 
 #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_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 /* 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
-  FT_DEFINE_SERVICEDESCREC4(tt_services,
+  FT_DEFINE_SERVICEDESCREC5(
+    tt_services,
     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_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
-  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_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
 
+
   FT_CALLBACK_DEF( FT_Module_Interface )
   tt_get_interface( FT_Module    driver,    /* TT_Driver */
                     const char*  tt_interface )
     SFNT_Service         sfnt;
 
 
-    /* FT_TT_SERVICES_GET derefers `library' in PIC mode */
+    /* TT_SERVICES_GET dereferences `library' in PIC mode */
 #ifdef FT_CONFIG_OPTION_PIC
     if ( !driver )
       return NULL;
       return NULL;
 #endif
 
-    result = ft_service_list_lookup( FT_TT_SERVICES_GET, tt_interface );
+    result = ft_service_list_lookup( TT_SERVICES_GET, tt_interface );
     if ( result != NULL )
       return result;
 
   /* 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
-#define TT_HINTER_FLAG   0
+#define TT_HINTER_FLAG  0
 #endif
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-#define TT_SIZE_SELECT    tt_size_select
+#define TT_SIZE_SELECT  tt_size_select
 #else
-#define TT_SIZE_SELECT    0
+#define TT_SIZE_SELECT  0
 #endif
 
-  FT_DEFINE_DRIVER( tt_driver_class,
+  FT_DEFINE_DRIVER(
+    tt_driver_class,
 
       FT_MODULE_FONT_DRIVER     |
       FT_MODULE_DRIVER_SCALABLE |
     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 */
-
     tt_glyph_load,
 
     tt_get_kerning,
index ce8c888..c5841c3 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType Glyph Loader (body).                                        */
 /*                                                                         */
-/*  Copyright 1996-2012                                                    */
+/*  Copyright 1996-2014                                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -23,6 +23,7 @@
 #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"
@@ -32,6 +33,7 @@
 #endif
 
 #include "tterrors.h"
+#include "ttsubpix.h"
 
 
   /*************************************************************************/
   /*************************************************************************/
   /*                                                                       */
   /* 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    */
-  /* 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.                                 */
+  /* See macro `TT_LOADER_SET_PP' below for explanations.                  */
   /*                                                                       */
   FT_LOCAL_DEF( void )
   TT_Get_VMetrics( TT_Face     face,
                    FT_UInt     idx,
+                   FT_Pos      yMax,
                    FT_Short*   tsb,
                    FT_UShort*  ah )
   {
     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;
+      *tsb = (FT_Short)( face->os2.sTypoAscender - yMax );
       *ah  = face->os2.sTypoAscender - face->os2.sTypoDescender;
     }
+
     else
     {
-      *tsb = face->horizontal.Ascender;
+      *tsb = (FT_Short)( face->horizontal.Ascender - yMax );
       *ah  = face->horizontal.Ascender - face->horizontal.Descender;
     }
 
-#endif
-
     FT_TRACE5(( "  advance height (font units): %d\n", *ah ));
     FT_TRACE5(( "  top side bearing (font units): %d\n", *tsb ));
   }
 
 
-  static void
+  static FT_Error
   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_Error   error;
+    FT_Stream  stream = loader->stream;
 
     FT_Short   left_bearing = 0, top_bearing = 0;
     FT_UShort  advance_width = 0, advance_height = 0;
 
+    /* we must preserve the stream position          */
+    /* (which gets altered by the metrics functions) */
+    FT_ULong  pos = FT_STREAM_POS();
+
 
     TT_Get_HMetrics( face, glyph_index,
                      &left_bearing,
                      &advance_width );
     TT_Get_VMetrics( face, glyph_index,
+                     loader->bbox.yMax,
                      &top_bearing,
                      &advance_height );
 
+    if ( FT_STREAM_SEEK( pos ) )
+      return error;
+
     loader->left_bearing = left_bearing;
     loader->advance      = advance_width;
     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;
       loader->linear     = advance_width;
     }
+
+    return FT_Err_Ok;
   }
 
 
   }
 
 
-#undef  IS_HINTED
-#define IS_HINTED( flags )  ( ( flags & FT_LOAD_NO_HINTING ) == 0 )
-
-
   /*************************************************************************/
   /*                                                                       */
   /* The following functions are used by default with TrueType fonts.      */
     loader->cursor = stream->cursor;
     loader->limit  = stream->limit;
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
 
 
     if ( p + 10 > limit )
-      return TT_Err_Invalid_Outline;
+      return FT_THROW( Invalid_Outline );
 
     loader->n_contours = FT_NEXT_SHORT( p );
 
                                             loader->bbox.yMax ));
     loader->cursor = p;
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     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_points;
+    FT_ULong        tmp;
 
     FT_Byte         *flag, *flag_limit;
     FT_Byte         c, count;
 
     FT_TRACE5(( "  Instructions size: %u\n", n_ins ));
 
-    if ( n_ins > face->max_profile.maxSizeOfInstructions )
-    {
-      FT_TRACE0(( "TT_Load_Simple_Glyph: too many instructions (%d)\n",
-                  n_ins ));
-      error = TT_Err_Too_Many_Hints;
-      goto Fail;
-    }
-
+    /* check it */
     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;
     }
 
 
     if ( IS_HINTED( load->load_flags ) )
     {
+      /* we don't trust `maxSizeOfInstructions' in the `maxp' table */
+      /* and thus update the bytecode array size by ourselves       */
+
+      tmp   = load->exec->glyphSize;
+      error = Update_Max( load->exec->memory,
+                          &tmp,
+                          sizeof ( FT_Byte ),
+                          (void*)&load->exec->glyphIns,
+                          n_ins );
+
+      load->exec->glyphSize = (FT_UShort)tmp;
+      if ( error )
+        return error;
+
       load->glyph->control_len  = n_ins;
       load->glyph->control_data = load->exec->glyphIns;
 
     return error;
 
   Invalid_Outline:
-    error = TT_Err_Invalid_Outline;
+    error = FT_THROW( Invalid_Outline );
     goto Fail;
   }
 
     return error;
 
   Invalid_Composite:
-    error = TT_Err_Invalid_Composite;
+    error = FT_THROW( Invalid_Composite );
     goto Fail;
   }
 
   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;
 
 #ifdef TT_USE_BYTECODE_INTERPRETER
     FT_UInt       n_ins;
 #ifdef TT_USE_BYTECODE_INTERPRETER
     if ( loader->glyph->control_len > 0xFFFFL )
     {
-      FT_TRACE1(( "TT_Hint_Glyph: too long instructions " ));
-      FT_TRACE1(( "(0x%lx byte) is truncated\n",
+      FT_TRACE1(( "TT_Hint_Glyph: too long instructions" ));
+      FT_TRACE1(( " (0x%lx byte) is truncated\n",
                  loader->glyph->control_len ));
     }
     n_ins = (FT_UInt)( 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 */
+    /* round phantom points */
+    zone->cur[zone->n_points - 4].x =
+      FT_PIX_ROUND( zone->cur[zone->n_points - 4].x );
     zone->cur[zone->n_points - 3].x =
       FT_PIX_ROUND( zone->cur[zone->n_points - 3].x );
+    zone->cur[zone->n_points - 2].y =
+      FT_PIX_ROUND( zone->cur[zone->n_points - 2].y );
     zone->cur[zone->n_points - 1].y =
       FT_PIX_ROUND( zone->cur[zone->n_points - 1].y );
 
       FT_Outline      current_outline = gloader->current.outline;
 
 
-      error = TT_Set_CodeRange( loader->exec, tt_coderange_glyph,
-                                loader->exec->glyphIns, n_ins );
-      if ( error )
-        return error;
+      TT_Set_CodeRange( loader->exec, tt_coderange_glyph,
+                        loader->exec->glyphIns, n_ins );
 
       loader->exec->is_composite = is_composite;
       loader->exec->pts          = *zone;
 #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];
+
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
     {
-      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];
+      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 TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   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;
 
                      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;
 
+      FT_Bool  do_scale = FALSE;
 
-      for ( ; vec < limit; vec++ )
+
+#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
+
+#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;
 
-      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];
+          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 ) )
       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;
       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 */
-  /* fonts which don't set the xxx_COMPONENT_OFFSET bit.                  */
+      /* 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
 
 #if 0
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* This algorithm is what Apple documents.  But it doesn't work.         */
-  /*                                                                       */
+        /*******************************************************************/
+        /*                                                                 */
+        /* 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
         x = FT_MulFix( x, m );
         y = FT_MulFix( y, n );
 
-#else /* 0 */
+#else /* 1 */
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* 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 ) );
+        /*******************************************************************/
+        /*                                                                 */
+        /* This algorithm is a guess and works much better than the above. */
+        /*                                                                 */
+        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 );
         y = FT_MulFix( y, mac_yscale );
 
-#endif /* 0 */
+#endif /* 1 */
 
       }
 
                        base_vec + num_base_points,
                        x, y );
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
       max_ins = ((TT_Face)loader->face)->max_profile.maxSizeOfInstructions;
       if ( n_ins > max_ins )
       {
-        /* acroread ignores this field, so we only do a rough safety check */
+        /* don't trust `maxSizeOfInstructions'; */
+        /* only do a rough safety check         */
         if ( (FT_Int)n_ins > loader->byte_len )
         {
-          FT_TRACE1(( "TT_Process_Composite_Glyph: "
-                      "too many instructions (%d) for glyph with length %d\n",
+          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;
         error = Update_Max( loader->exec->memory,
                             &tmp,
                             sizeof ( FT_Byte ),
                             (void*)&loader->exec->glyphIns,
                             n_ins );
+
         loader->exec->glyphSize = (FT_UShort)tmp;
         if ( error )
           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;
 
     /* 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++ )
+    for ( i = 0; i < loader->zone.n_points; i++ )
       loader->zone.tags[i] &= ~FT_CURVE_TAG_TOUCH_BOTH;
 
     loader->zone.n_points += 4;
   }
 
 
-  /* Calculate the four phantom points.                     */
-  /* The first two stand for horizontal origin and advance. */
-  /* The last two stand for vertical origin and advance.    */
+  /*
+   * Calculate the phantom points
+   *
+   * Defining the right side bearing (rsb) as
+   *
+   *   rsb = aw - (lsb + xmax - xmin)
+   *
+   * (with `aw' the advance width, `lsb' the left side bearing, and `xmin'
+   * and `xmax' the glyph's minimum and maximum x value), the OpenType
+   * specification defines the initial position of horizontal phantom points
+   * as
+   *
+   *   pp1 = (round(xmin - lsb), 0)      ,
+   *   pp2 = (round(pp1 + aw), 0)        .
+   *
+   * Note that the rounding to the grid (in the device space) is not
+   * documented currently in the specification.
+   *
+   * However, the specification lacks the precise definition of vertical
+   * phantom points.  Greg Hitchcock provided the following explanation.
+   *
+   * - a `vmtx' table is present
+   *
+   *   For any glyph, the minimum and maximum y values (`ymin' and `ymax')
+   *   are given in the `glyf' table, the top side bearing (tsb) and advance
+   *   height (ah) are given in the `vmtx' table.  The bottom side bearing
+   *   (bsb) is then calculated as
+   *
+   *     bsb = ah - (tsb + ymax - ymin)       ,
+   *
+   *   and the initial position of vertical phantom points is
+   *
+   *     pp3 = (x, round(ymax + tsb))       ,
+   *     pp4 = (x, round(pp3 - ah))         .
+   *
+   *   See below for value `x'.
+   *
+   * - no `vmtx' table in the font
+   *
+   *   If there is an `OS/2' table, we set
+   *
+   *     DefaultAscender = sTypoAscender       ,
+   *     DefaultDescender = sTypoDescender     ,
+   *
+   *   otherwise we use data from the `hhea' table:
+   *
+   *     DefaultAscender = Ascender         ,
+   *     DefaultDescender = Descender       .
+   *
+   *   With these two variables we can now set
+   *
+   *     ah = DefaultAscender - sDefaultDescender    ,
+   *     tsb = DefaultAscender - yMax                ,
+   *
+   *   and proceed as if a `vmtx' table was present.
+   *
+   * Usually we have
+   *
+   *   x = aw / 2      ,                                                (1)
+   *
+   * but there is one compatibility case where it can be set to
+   *
+   *   x = -DefaultDescender -
+   *         ((DefaultAscender - DefaultDescender - aw) / 2)     .      (2)
+   *
+   * and another one with
+   *
+   *   x = 0     .                                                      (3)
+   *
+   * In Windows, the history of those values is quite complicated,
+   * depending on the hinting engine (that is, the graphics framework).
+   *
+   *   framework        from                 to       formula
+   *  ----------------------------------------------------------
+   *    GDI       Windows 98               current      (1)
+   *              (Windows 2000 for NT)
+   *    GDI+      Windows XP               Windows 7    (2)
+   *    GDI+      Windows 8                current      (3)
+   *    DWrite    Windows 7                current      (3)
+   *
+   * For simplicity, FreeType uses (1) for grayscale subpixel hinting and
+   * (3) for everything else.
+   *
+   */
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+#define TT_LOADER_SET_PP( loader )                                          \
+          do                                                                \
+          {                                                                 \
+            FT_Bool  subpixel_  = loader->exec ? loader->exec->subpixel     \
+                                               : 0;                         \
+            FT_Bool  grayscale_ = loader->exec ? loader->exec->grayscale    \
+                                               : 0;                         \
+            FT_Bool  use_aw_2_  = (FT_Bool)( subpixel_ && grayscale_ );     \
+                                                                            \
+                                                                            \
+            (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 = use_aw_2_ ? (loader)->advance / 2 : 0;        \
+            (loader)->pp3.y = (loader)->bbox.yMax + (loader)->top_bearing;  \
+            (loader)->pp4.x = use_aw_2_ ? (loader)->advance / 2 : 0;        \
+            (loader)->pp4.y = (loader)->pp3.y - (loader)->vadvance;         \
+          } while ( 0 )
+
+#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
 #define TT_LOADER_SET_PP( loader )                                          \
-          do {                                                              \
+          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)->pp3.y = (loader)->bbox.yMax + (loader)->top_bearing;  \
             (loader)->pp4.x = 0;                                            \
             (loader)->pp4.y = (loader)->pp3.y - (loader)->vadvance;         \
           } while ( 0 )
 
+#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
 
   /*************************************************************************/
   /*                                                                       */
                        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;
     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 )
     {
-      error = TT_Err_Invalid_Glyph_Index;
+      error = FT_THROW( Invalid_Glyph_Index );
       goto Exit;
     }
 
       y_scale = 0x10000L;
     }
 
-    tt_get_metrics( loader, glyph_index );
-
     /* Set `offset' to the start of the glyph relative to the start of */
     /* the `glyf' table, and `byte_len' to the length of the glyph in  */
     /* bytes.                                                          */
 #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;
       }
 
 
       /* read glyph header first */
       error = face->read_glyph_header( loader );
-      if ( error || header_only )
+      if ( error )
+        goto Exit;
+
+      /* the metrics must be computed after loading the glyph header */
+      /* since we need the glyph's `yMax' value in case the vertical */
+      /* metrics must be emulated                                    */
+      error = tt_get_metrics( loader, glyph_index );
+      if ( error )
+        goto Exit;
+
+      if ( header_only )
         goto Exit;
     }
 
       loader->bbox.yMin = 0;
       loader->bbox.yMax = 0;
 
+      error = tt_get_metrics( loader, glyph_index );
+      if ( error )
+        goto Exit;
+
       if ( header_only )
         goto Exit;
 
         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;
+        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
+#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
 
+      /* scale phantom points, if necessary; */
+      /* they get rounded in `TT_Hint_Glyph' */
       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 );
+        /* pp1.y and pp2.y are always zero */
+
+        loader->pp3.x = FT_MulFix( loader->pp3.x, x_scale );
         loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale );
+        loader->pp4.x = FT_MulFix( loader->pp4.x, x_scale );
         loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale );
       }
 
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
       goto Exit;
     }
 
-    /* must initialize points before (possibly) overriding */
-    /* glyph metrics from the incremental interface        */
+    /* must initialize phantom points before (possibly) overriding */
+    /* glyph metrics from the incremental interface                */
     TT_LOADER_SET_PP( loader );
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
                          face,
                          glyph_index,
                          &deltas,
-                         gloader->current.num_subglyphs + 4 )) != 0 )
+                         gloader->current.num_subglyphs + 4 ) ) != 0 )
           goto Exit;
 
         subglyph = gloader->current.subglyphs + gloader->base.num_subglyphs;
           }
         }
 
-        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;
+        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 */
 
+      /* scale phantom points, if necessary; */
+      /* they get rounded in `TT_Hint_Glyph' */
       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 );
+        /* pp1.y and pp2.y are always zero */
+
+        loader->pp3.x = FT_MulFix( loader->pp3.x, x_scale );
         loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale );
+        loader->pp4.x = FT_MulFix( loader->pp4.x, x_scale );
         loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale );
       }
 
           /* restore subglyph pointer */
           subglyph = gloader->base.subglyphs + num_base_subgs + n;
 
+          /* restore phantom points if necessary */
           if ( !( subglyph->flags & USE_MY_METRICS ) )
           {
             loader->pp1 = pp[0];
           /* (1): exists 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 );
+          error = TT_Process_Composite_Component( loader,
+                                                  subglyph,
+                                                  start_point,
+                                                  num_base_points );
+          if ( error )
+            goto Exit;
         }
 
         loader->stream   = old_stream;
         /* 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 );
-
+        {
+          error = TT_Process_Composite_Glyph( loader,
+                                              start_point,
+                                              start_contour );
+          if ( error )
+            goto Exit;
+        }
       }
     }
     else
     {
       /* invalid composite count (negative but not -1) */
-      error = TT_Err_Invalid_Outline;
+      error = FT_THROW( Invalid_Outline );
       goto Exit;
     }
 
   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;
-    TT_Face       face = (TT_Face)loader->face;
     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;
                                            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 */
                   FT_Int32      load_flags,
                   FT_Bool       glyf_table_only )
   {
+    FT_Error  error;
+
     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;
       TT_ExecContext  exec;
       FT_Bool         grayscale;
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+      TT_Driver  driver = (TT_Driver)FT_FACE_DRIVER( face );
 
-      if ( !size->cvt_ready )
-      {
-        FT_Error  error = tt_size_ready_bytecode( size, pedantic );
+      FT_Bool  subpixel = FALSE;
 
+#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->bytecode_ready < 0 || size->cvt_ready < 0 )
+      {
+        error = tt_size_ready_bytecode( size, pedantic );
         if ( error )
           return error;
       }
+      else if ( size->bytecode_ready )
+        return size->bytecode_ready;
+      else if ( size->cvt_ready )
+        return size->cvt_ready;
 
       /* 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;
+        return FT_THROW( Could_Not_Find_Context );
 
-      grayscale =
-        FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != FT_RENDER_MODE_MONO );
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
 
-      TT_Load_Context( exec, face, size );
+      if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
+      {
+        subpixel = FT_BOOL( ( FT_LOAD_TARGET_MODE( load_flags ) !=
+                              FT_RENDER_MODE_MONO               )  &&
+                            SPH_OPTION_SET_SUBPIXEL                );
+
+        if ( subpixel )
+          grayscale = FALSE;
+        else if ( SPH_OPTION_SET_GRAYSCALE )
+        {
+          grayscale = TRUE;
+          subpixel  = FALSE;
+        }
+        else
+          grayscale = FALSE;
+
+        if ( FT_IS_TRICKY( glyph->face ) )
+          subpixel = FALSE;
+
+        exec->ignore_x_mode      = subpixel || grayscale;
+        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 */
+
+      }
+      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_UInt  i;
+        grayscale = FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
+                             FT_RENDER_MODE_MONO );
+      }
 
+      error = TT_Load_Context( exec, face, size );
+      if ( error )
+        return error;
 
-        FT_TRACE4(( "tt_loader_init: grayscale change,"
-                    " re-executing `prep' table\n" ));
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+      if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
+      {
+        /* a change from mono to subpixel rendering (and vice versa) */
+        /* requires a re-execution of the CVT program                */
+        if ( subpixel != exec->subpixel )
+        {
+          FT_TRACE4(( "tt_loader_init: subpixel hinting change,"
+                      " re-executing `prep' table\n" ));
+
+          exec->subpixel = subpixel;
+          reexecute      = TRUE;
+        }
+
+        /* 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 hinting change,"
+                      " re-executing `prep' table\n" ));
+
+          exec->grayscale = grayscale;
+          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 );
-        tt_size_run_prep( size, pedantic );
+        error = tt_size_run_prep( size, pedantic );
+        if ( error )
+          return error;
       }
 
       /* see whether the cvt program has disabled hinting */
 #endif
 
     {
-      FT_Error  error = face->goto_table( face, TTAG_glyf, stream, 0 );
-
+      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->glyph  = (FT_GlyphSlot)glyph;
     loader->stream = stream;
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
                  FT_UInt       glyph_index,
                  FT_Int32      load_flags )
   {
-    TT_Face       face;
     FT_Error      error;
     TT_LoaderRec  loader;
 
 
-    face   = (TT_Face)glyph->face;
-    error  = TT_Err_Ok;
+    FT_TRACE1(( "TT_Load_Glyph: glyph index %d\n", glyph_index ));
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
 
       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 );
           (void)load_truetype_glyph( &loader, glyph_index, 0, TRUE );
           glyph->linearHoriAdvance = loader.linear;
-          glyph->linearVertAdvance = loader.top_bearing + loader.bbox.yMax -
-                                       loader.vadvance;
+          glyph->linearVertAdvance = loader.vadvance;
+
+          /* sanity checks: if `xxxAdvance' in the sbit metric */
+          /* structure isn't set, use `linearXXXAdvance'      */
+          if ( !glyph->metrics.horiAdvance && glyph->linearHoriAdvance )
+            glyph->metrics.horiAdvance =
+              FT_MulFix( glyph->linearHoriAdvance,
+                         size->root.metrics.x_scale );
+          if ( !glyph->metrics.vertAdvance && glyph->linearVertAdvance )
+            glyph->metrics.vertAdvance =
+              FT_MulFix( glyph->linearVertAdvance,
+                         size->root.metrics.y_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 )
-      return TT_Err_Invalid_Size_Handle;
+      return FT_THROW( Invalid_Size_Handle );
 
     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 )
 
 #endif /* TT_USE_BYTECODE_INTERPRETER */
 
-      compute_glyph_metrics( &loader, glyph_index );
+      error = compute_glyph_metrics( &loader, glyph_index );
     }
 
     /* Set the `high precision' bit flag.                           */
index 05f7588..3f1699e 100644 (file)
@@ -43,6 +43,7 @@ FT_BEGIN_HEADER
   FT_LOCAL( void )
   TT_Get_VMetrics( TT_Face     face,
                    FT_UInt     idx,
+                   FT_Pos      yMax,
                    FT_Short*   tsb,
                    FT_UShort*  ah );
 
index 69b702f..1b35539 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType GX Font Variation loader                                    */
 /*                                                                         */
-/*  Copyright 2004-2011 by                                                 */
+/*  Copyright 2004-2014 by                                                 */
 /*  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 )  \
-          ( (stream)->cursor - (stream)->base )
+          (FT_ULong)( (stream)->cursor - (stream)->base )
 #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.                                                */
   /*                                                                       */
-#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
     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_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_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;
     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;
     }
 
                       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 )
 
       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],
-                           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] < 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
-      {
-        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;
     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_MM_Var*           mmvar = NULL;
            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;
       }
 
       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 =
                    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;
 
     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 )
       {
-        error = TT_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Exit;
       }
 
         FT_FREE( face->cvt );
         face->cvt = NULL;
 
-        tt_face_load_cvt( face, face->root.stream );
+        error = tt_face_load_cvt( face, face->root.stream );
         break;
 
       case mcvt_modify:
         /* The original cvt table is in memory.  All we need to do is */
         /* apply the `cvar' table (if any).                           */
-        tt_face_vary_cvt( face, face->root.stream );
+        error = tt_face_vary_cvt( face, face->root.stream );
         break;
 
       case mcvt_retain:
                      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;
 
     if ( num_coords != mmvar->num_axis )
     {
-      error = TT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     {
       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 )
-      {
-        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
-      {
-        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 ( 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;
           }
     {
       FT_TRACE2(( "tt_face_vary_cvt: no blend specified\n" ));
 
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
       goto Exit;
     }
 
     {
       FT_TRACE2(( "tt_face_vary_cvt: no `cvt ' table\n" ));
 
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
       goto Exit;
     }
 
     {
       FT_TRACE2(( "is missing\n" ));
 
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
       goto Exit;
     }
 
     if ( FT_FRAME_ENTER( table_len ) )
     {
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
       goto Exit;
     }
 
     {
       FT_TRACE2(( "bad table version\n" ));
 
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
       goto FExit;
     }
 
 
 
     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 ) )
     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] -
       }
       else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount )
       {
-        error = TT_Err_Invalid_Table;
+        error = FT_THROW( Invalid_Table );
         goto Fail3;
       }
       else
index 3acb24a..eccd4aa 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType bytecode interpreter (body).                                */
 /*                                                                         */
-/*  Copyright 1996-2012                                                    */
+/*  Copyright 1996-2014                                                    */
 /*  by David Turner, Robert Wilhelm, and Werner Lemberg.                   */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include FT_INTERNAL_CALC_H
 #include FT_TRIGONOMETRY_H
 #include FT_SYSTEM_H
+#include FT_TRUETYPE_DRIVER_H
 
 #include "ttinterp.h"
-
 #include "tterrors.h"
+#include "ttsubpix.h"
 
 
 #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      */
@@ -52,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        */
-  /* limited to a maximal number of opcodes defined below.                 */
+  /* limited to a maximum number of opcodes defined below.                 */
   /*                                                                       */
 #define MAX_RUNNABLE_OPCODES  1000000L
 
 #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        */
 #define CUR_Func_round( d, c ) \
           CUR.func_round( EXEC_ARG_ d, c )
 
+#define CUR_Func_cur_ppem() \
+          CUR.func_cur_ppem( EXEC_ARG )
+
 #define CUR_Func_read_cvt( index ) \
           CUR.func_read_cvt( EXEC_ARG_ index )
 
 #define CURRENT_Ratio() \
           Current_Ratio( EXEC_ARG )
 
-#define CURRENT_Ppem() \
-          Current_Ppem( EXEC_ARG )
-
-#define CUR_Ppem() \
-          Cur_PPEM( EXEC_ARG )
-
 #define INS_SxVTL( a, b, c, d ) \
           Ins_SxVTL( EXEC_ARG_ a, b, c, d )
 
 #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
 
   /* <InOut>                                                               */
   /*    exec  :: The target execution context.                             */
   /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
-  FT_LOCAL_DEF( FT_Error )
+  FT_LOCAL_DEF( void )
   TT_Goto_CodeRange( TT_ExecContext  exec,
                      FT_Int          range,
                      FT_Long         IP )
     exec->codeSize = coderange->size;
     exec->IP       = IP;
     exec->curRange = range;
-
-    return TT_Err_Ok;
   }
 
 
   /* <InOut>                                                               */
   /*    exec   :: The target execution context.                            */
   /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
-  FT_LOCAL_DEF( FT_Error )
+  FT_LOCAL_DEF( void )
   TT_Set_CodeRange( TT_ExecContext  exec,
                     FT_Int          range,
                     void*           base,
 
     exec->codeRangeTable[range - 1].base = (FT_Byte*)base;
     exec->codeRangeTable[range - 1].size = length;
-
-    return TT_Err_Ok;
   }
 
 
   /* <InOut>                                                               */
   /*    exec  :: The target execution context.                             */
   /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    Does not set the Error variable.                                   */
-  /*                                                                       */
-  FT_LOCAL_DEF( FT_Error )
+  FT_LOCAL_DEF( void )
   TT_Clear_CodeRange( TT_ExecContext  exec,
                       FT_Int          range )
   {
 
     exec->codeRangeTable[range - 1].base = NULL;
     exec->codeRangeTable[range - 1].size = 0;
-
-    return TT_Err_Ok;
   }
 
 
   /*                                                                       */
   /*    memory :: A handle to the parent memory object.                    */
   /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
   /* <Note>                                                                */
   /*    Only the glyph loader and debugger should call this function.      */
   /*                                                                       */
-  FT_LOCAL_DEF( FT_Error )
+  FT_LOCAL_DEF( void )
   TT_Done_Context( TT_ExecContext  exec )
   {
     FT_Memory  memory = exec->memory;
     exec->face = NULL;
 
     FT_FREE( exec );
-
-    return TT_Err_Ok;
   }
 
 
     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 ));
       *size = new_max;
     }
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
 
     exec->instruction_trap = FALSE;
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   /* <InOut>                                                               */
   /*    size :: A handle to the target size object.                        */
   /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
   /* <Note>                                                                */
   /*    Only the glyph loader and debugger should call this function.      */
   /*                                                                       */
-  FT_LOCAL_DEF( FT_Error )
+  FT_LOCAL_DEF( void )
   TT_Save_Context( TT_ExecContext  exec,
                    TT_Size         size )
   {
 
     for ( i = 0; i < TT_MAX_CODE_RANGES; i++ )
       size->codeRangeTable[i] = exec->codeRangeTable[i];
-
-    return TT_Err_Ok;
   }
 
 
   TT_Run_Context( TT_ExecContext  exec,
                   FT_Bool         debug )
   {
-    FT_Error  error;
-
-
-    if ( ( error = TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 ) )
-           != TT_Err_Ok )
-      return error;
+    TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 );
 
     exec->zp0 = exec->pts;
     exec->zp1 = exec->pts;
     if ( !debug )
       return TT_RunIns( exec );
     else
-      return TT_Err_Ok;
+      return FT_Err_Ok;
 #endif
   }
 
   FT_EXPORT_DEF( TT_ExecContext )
   TT_New_Context( TT_Driver  driver )
   {
-    TT_ExecContext  exec;
-    FT_Memory       memory;
+    FT_Memory  memory;
+
 
+    if ( !driver )
+      goto Fail;
 
     memory = driver->root.root.memory;
-    exec   = driver->context;
 
     if ( !driver->context )
     {
-      FT_Error  error;
+      FT_Error        error;
+      TT_ExecContext  exec;
 
 
       /* allocate object */
 
 #undef PACK
 
-#if 1
+
+#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
+
+#if defined( __arm__ )                                 && \
+    ( defined( __thumb2__ ) || !defined( __thumb__ ) )
+
+#define TT_MulFix14  TT_MulFix14_arm
 
   static FT_Int32
+  TT_MulFix14_arm( FT_Int32  a,
+                   FT_Int    b )
+  {
+    FT_Int32  t, t2;
+
+
+#if defined( __CC_ARM ) || defined( __ARMCC__ )
+
+    __asm
+    {
+      smull t2, t,  b,  a           /* (lo=t2,hi=t) = a*b */
+      mov   a,  t,  asr #31         /* a   = (hi >> 31) */
+      add   a,  a,  #0x2000         /* a  += 0x2000 */
+      adds  t2, t2, a               /* t2 += a */
+      adc   t,  t,  #0              /* t  += carry */
+      mov   a,  t2, lsr #14         /* a   = t2 >> 14 */
+      orr   a,  a,  t,  lsl #18     /* a  |= t << 18 */
+    }
+
+#elif defined( __GNUC__ )
+
+    __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) */
+#if defined( __clang__ ) && defined( __thumb2__ )
+      "add.w  %0, %0, #0x2000\n\t"      /* %0 += 0x2000 */
+#else
+      "add    %0, %0, #0x2000\n\t"      /* %0 += 0x2000 */
+#endif
+      "adds   %1, %1, %0\n\t"           /* %1 += %0 */
+      "adc    %2, %2, #0\n\t"           /* %2 += carry */
+      "mov    %0, %1, lsr #14\n\t"      /* %0  = %1 >> 16 */
+      "orr    %0, %0, %2, lsl #18\n\t"  /* %0 |= %2 << 16 */
+      : "=r"(a), "=&r"(t2), "=&r"(t)
+      : "r"(a), "r"(b)
+      : "cc" );
+
+#endif
+
+    return a;
+  }
+
+#endif /* __arm__ && ( __thumb2__ || !__thumb__ ) */
+
+#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
+
+
+#if defined( __GNUC__ )                              && \
+    ( defined( __i386__ ) || defined( __x86_64__ ) )
+
+#define TT_MulFix14  TT_MulFix14_long_long
+
+  /* Temporarily disable the warning that C90 doesn't support `long long'. */
+#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406
+#pragma GCC diagnostic push
+#endif
+#pragma GCC diagnostic ignored "-Wlong-long"
+
+  /* This is declared `noinline' because inlining the function results */
+  /* in slower code.  The `pure' attribute indicates that the result   */
+  /* only depends on the parameters.                                   */
+  static __attribute__(( noinline ))
+         __attribute__(( pure )) FT_Int32
+  TT_MulFix14_long_long( FT_Int32  a,
+                         FT_Int    b )
+  {
+
+    long long  ret = (long long)a * b;
+
+    /* The following line assumes that right shifting of signed values */
+    /* will actually preserve the sign bit.  The exact behaviour is    */
+    /* undefined, but this is true on x86 and x86_64.                  */
+    long long  tmp = ret >> 63;
+
+
+    ret += 0x2000 + tmp;
+
+    return (FT_Int32)( ret >> 14 );
+  }
+
+#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406
+#pragma GCC diagnostic pop
+#endif
+
+#endif /* __GNUC__ && ( __i386__ || __x86_64__ ) */
+
+
+#ifndef TT_MulFix14
+
+  /* Compute (a*b)/2^14 with maximum accuracy and rounding.  */
+  /* This is optimized to be faster than calling FT_MulFix() */
+  /* for platforms where sizeof(int) == 2.                   */
+  static FT_Int32
   TT_MulFix14( FT_Int32  a,
                FT_Int    b )
   {
     return sign >= 0 ? (FT_Int32)mid : -(FT_Int32)mid;
   }
 
-#else
+#endif  /* !TT_MulFix14 */
 
-  /* compute (a*b)/2^14 with maximal accuracy and rounding */
-  static FT_Int32
-  TT_MulFix14( FT_Int32  a,
-               FT_Int    b )
-  {
-    FT_Int32   m, s, hi;
-    FT_UInt32  l, lo;
 
+#if defined( __GNUC__ )        && \
+    ( defined( __i386__ )   ||    \
+      defined( __x86_64__ ) ||    \
+      defined( __arm__ )    )
 
-    /* compute ax*bx as 64-bit value */
-    l  = (FT_UInt32)( ( a & 0xFFFFU ) * b );
-    m  = ( a >> 16 ) * b;
+#define TT_DotFix14  TT_DotFix14_long_long
 
-    lo = l + (FT_UInt32)( m << 16 );
-    hi = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo < l );
+#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406
+#pragma GCC diagnostic push
+#endif
+#pragma GCC diagnostic ignored "-Wlong-long"
 
-    /* divide the result by 2^14 with rounding */
-    s   = hi >> 31;
-    l   = lo + (FT_UInt32)s;
-    hi += s + ( l < lo );
-    lo  = l;
+  static __attribute__(( pure )) FT_Int32
+  TT_DotFix14_long_long( FT_Int32  ax,
+                         FT_Int32  ay,
+                         FT_Int    bx,
+                         FT_Int    by )
+  {
+    /* Temporarily disable the warning that C90 doesn't support */
+    /* `long long'.                                             */
 
-    l   = lo + 0x2000U;
-    hi += l < lo;
+    long long  temp1 = (long long)ax * bx;
+    long long  temp2 = (long long)ay * by;
+
+
+    temp1 += temp2;
+    temp2  = temp1 >> 63;
+    temp1 += 0x2000 + temp2;
+
+    return (FT_Int32)( temp1 >> 14 );
 
-    return ( hi << 18 ) | ( l >> 14 );
   }
+
+#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406
+#pragma GCC diagnostic pop
 #endif
 
+#endif /* __GNUC__ && (__arm__ || __i386__ || __x86_64__) */
+
 
-  /* compute (ax*bx+ay*by)/2^14 with maximal accuracy and rounding */
+#ifndef TT_DotFix14
+
+  /* compute (ax*bx+ay*by)/2^14 with maximum accuracy and rounding */
   static FT_Int32
   TT_DotFix14( FT_Int32  ax,
                FT_Int32  ay,
     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;
 
-    lo2 = l + (FT_UInt32)( m << 16 );
+    lo2 = l + ( (FT_UInt32)m << 16 );
     hi2 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo2 < l );
 
     /* add them */
     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
+#endif /* TT_DotFix14 */
 
 
   /*************************************************************************/
 
         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
+  FT_CALLBACK_DEF( FT_Long )
   Current_Ppem( EXEC_OP )
   {
-    return TT_MULFIX( CUR.tt_metrics.ppem, CURRENT_Ratio() );
+    return CUR.tt_metrics.ppem;
+  }
+
+
+  FT_CALLBACK_DEF( FT_Long )
+  Current_Ppem_Stretched( EXEC_OP )
+  {
+    return FT_MulFix( CUR.tt_metrics.ppem, CURRENT_Ratio() );
   }
 
 
   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 )
     {
-      CUR.error = TT_Err_Bad_Argument;
+      CUR.error = FT_THROW( Bad_Argument );
       return FAILURE;
     }
 
 
     if ( range->base == NULL )     /* invalid coderange */
     {
-      CUR.error = TT_Err_Invalid_CodeRange;
+      CUR.error = FT_THROW( Invalid_CodeRange );
       return FAILURE;
     }
 
 
     if ( aIP > range->size )
     {
-      CUR.error = TT_Err_Code_Overflow;
+      CUR.error = FT_THROW( Code_Overflow );
       return FAILURE;
     }
 
 
     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;
     }
 
     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;
     }
     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 )
-      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;
 
-    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;
   }
 
     if ( distance >= 0 )
     {
       val = distance + compensation;
-      if ( distance && val < 0 )
+      if ( val < 0 )
         val = 0;
     }
     else
 
     if ( distance >= 0 )
     {
-      val = distance + compensation + 32;
-      if ( distance && val > 0 )
-        val &= ~63;
-      else
+      val = FT_PIX_ROUND( distance + compensation );
+      if ( val < 0 )
         val = 0;
     }
     else
     if ( distance >= 0 )
     {
       val = FT_PIX_FLOOR( distance + compensation ) + 32;
-      if ( distance && val < 0 )
-        val = 0;
+      if ( val < 0 )
+        val = 32;
     }
     else
     {
       val = -( FT_PIX_FLOOR( compensation - distance ) + 32 );
       if ( val > 0 )
-        val = 0;
+        val = -32;
     }
 
     return val;
 
     if ( distance >= 0 )
     {
-      val = distance + compensation;
-      if ( distance && val > 0 )
-        val &= ~63;
-      else
+      val = FT_PIX_FLOOR( distance + compensation );
+      if ( val < 0 )
         val = 0;
     }
     else
     {
-      val = -( ( compensation - distance ) & -64 );
+      val = -FT_PIX_FLOOR( compensation - distance );
       if ( val > 0 )
         val = 0;
     }
 
     if ( distance >= 0 )
     {
-      val = distance + compensation + 63;
-      if ( distance && val > 0 )
-        val &= ~63;
-      else
+      val = FT_PIX_CEIL( distance + compensation );
+      if ( val < 0 )
         val = 0;
     }
     else
     {
-      val = - FT_PIX_CEIL( compensation - distance );
+      val = -FT_PIX_CEIL( compensation - distance );
       if ( val > 0 )
         val = 0;
     }
 
     if ( distance >= 0 )
     {
-      val = distance + compensation + 16;
-      if ( distance && val > 0 )
-        val &= ~31;
-      else
+      val = FT_PAD_ROUND( distance + compensation, 32 );
+      if ( val < 0 )
         val = 0;
     }
     else
     {
       val = ( distance - CUR.phase + CUR.threshold + compensation ) &
               -CUR.period;
-      if ( distance && val < 0 )
-        val = 0;
       val += CUR.phase;
+      if ( val < 0 )
+        val = CUR.phase;
     }
     else
     {
       val = -( ( CUR.threshold - CUR.phase - distance + compensation ) &
                -CUR.period );
-      if ( val > 0 )
-        val = 0;
       val -= CUR.phase;
+      if ( val > 0 )
+        val = -CUR.phase;
     }
 
     return val;
     {
       val = ( ( distance - CUR.phase + CUR.threshold + compensation ) /
                 CUR.period ) * CUR.period;
-      if ( distance && val < 0 )
-        val = 0;
       val += CUR.phase;
+      if ( val < 0 )
+        val = CUR.phase;
     }
     else
     {
       val = -( ( ( CUR.threshold - CUR.phase - distance + compensation ) /
                    CUR.period ) * CUR.period );
-      if ( val > 0 )
-        val = 0;
       val -= CUR.phase;
+      if ( val > 0 )
+        val = -CUR.phase;
     }
 
     return val;
   /*    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,
 
       if ( CUR.GS.dualVector.x == 0x4000 )
         CUR.func_dualproj = Project_x;
+      else if ( CUR.GS.dualVector.y == 0x4000 )
+        CUR.func_dualproj = Project_y;
       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;
 #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
-    {
-      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;
+    else if ( CUR.GS.projVector.y == 0x4000 )
+      CUR.func_project = (TT_Project_Func)Project_y;
     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;
+    else if ( CUR.GS.dualVector.y == 0x4000 )
+      CUR.func_dualproj = (TT_Project_Func)Project_y;
     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;
 
-    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;
       }
-      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'. */
 
-    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;
   /*    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;
-    FT_Bool     S1, S2;
 
     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;
       }
 
-      R->x = (FT_F2Dot14)FT_MulDiv( Vx, 0x4000L, W );
-      R->y = (FT_F2Dot14)FT_MulDiv( Vy, 0x4000L, W );
-
-      return SUCCESS;
+      Vx *= 0x4000;
+      Vy *= 0x4000;
     }
 
-    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      */
+    W = FT_Hypot( Vx, Vy );
 
-    if ( Vx < 0 )
-    {
-      Vx = -Vx;
-      S1 = TRUE;
-    }
-    else
-      S1 = FALSE;
-
-    if ( Vy < 0 )
-    {
-      Vy = -Vy;
-      S2 = TRUE;
-    }
-    else
-      S2 = FALSE;
-
-    while ( W < 0x10000000L )
-    {
-      /* We need to increase W by a minimal amount */
-      if ( Vx < Vy )
-        Vx++;
-      else
-        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;
   }
          BOUNDS( aIdx2, CUR.zp1.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return FAILURE;
     }
 
     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.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            \
     CUR.GS.auto_flip = FALSE;
 
 
-#define DO_SDB                             \
-    CUR.GS.delta_base = (FT_Short)args[0];
+#define DO_SDB                              \
+    CUR.GS.delta_base = (FT_UShort)args[0];
 
 
-#define DO_SDS                              \
-    CUR.GS.delta_shift = (FT_Short)args[0];
+#define DO_SDS                                 \
+    if ( (FT_ULong)args[0] > 6UL )             \
+      CUR.error = FT_THROW( Bad_Argument );    \
+    else                                       \
+      CUR.GS.delta_shift = (FT_UShort)args[0];
 
 
 #define DO_MD  /* nothing */
 
 
-#define DO_MPPEM              \
-    args[0] = CURRENT_Ppem();
+#define DO_MPPEM                   \
+    args[0] = CUR_Func_cur_ppem();
 
 
   /* Note: The pointSize should be irrelevant in a given font program; */
 
 #else
 
-#define DO_MPS                \
-    args[0] = CURRENT_Ppem();
+#define DO_MPS                     \
+    args[0] = CUR_Func_cur_ppem();
 
 #endif /* 0 */
 
     args[0] = CUR.top;
 
 
-#define DO_CINDEX                             \
-  {                                           \
-    FT_Long  L;                               \
-                                              \
-                                              \
-    L = args[0];                              \
-                                              \
-    if ( L <= 0 || L > CUR.args )             \
-    {                                         \
-      if ( CUR.pedantic_hinting )             \
-        CUR.error = TT_Err_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 = TT_Err_Bad_Argument;                          \
-      CUR.IP += args[0];                                          \
-      if ( CUR.IP < 0                                          || \
-           ( CUR.callTop > 0                                 &&   \
-             CUR.IP > CUR.callStack[CUR.callTop - 1].Cur_End ) )  \
-        CUR.error = TT_Err_Bad_Argument;                          \
-      CUR.step_ins = FALSE;                                       \
-    }
-
-
-#define DO_JMPR                                                 \
-    if ( args[0] == 0 && CUR.args == 0 )                        \
-      CUR.error = TT_Err_Bad_Argument;                          \
-    CUR.IP += args[0];                                          \
-    if ( CUR.IP < 0                                          || \
-         ( CUR.callTop > 0                                 &&   \
-           CUR.IP > CUR.callStack[CUR.callTop - 1].Cur_End ) )  \
-      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].Def->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].Def->end ) )  \
+      CUR.error = FT_THROW( Bad_Argument );                      \
     CUR.step_ins = FALSE;
 
 
-#define DO_JROF                                                   \
-    if ( args[1] == 0 )                                           \
-    {                                                             \
-      if ( args[0] == 0 && CUR.args == 0 )                        \
-        CUR.error = TT_Err_Bad_Argument;                          \
-      CUR.IP += args[0];                                          \
-      if ( CUR.IP < 0                                          || \
-           ( CUR.callTop > 0                                 &&   \
-             CUR.IP > CUR.callStack[CUR.callTop - 1].Cur_End ) )  \
-        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].Def->end ) )  \
+        CUR.error = FT_THROW( Bad_Argument );                      \
+      CUR.step_ins = FALSE;                                        \
     }
 
 
 
 #define DO_DIV                                               \
     if ( args[1] == 0 )                                      \
-      CUR.error = TT_Err_Divide_By_Zero;                     \
+      CUR.error = FT_THROW( Divide_By_Zero );                \
     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                                    \
-    args[0] = TT_MULDIV( args[0], args[1], 64L );
+    args[0] = FT_MulDiv( args[0], args[1], 64L );
 
 
 #define DO_ABS                   \
 #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                           \
    {                                    \
        args[0] = CUR.storage[I];        \
    }
 
+#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
 
 #define DO_WS                           \
    {                                    \
        }                                                        \
      }                                                          \
      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                                                   \
 
 
 #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 ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
     }
     else
     {
     }
 
   Fail_Overflow:
-    CUR.error = TT_Err_Code_Overflow;
+    CUR.error = FT_THROW( Code_Overflow );
     return FAILURE;
   }
 
     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.                       */
       /* 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++;
     /* 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;
     }
 
-    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;
 
+#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 )
     {
+
+#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 */
-        CUR.error = TT_Err_Nested_DEFS;
+        CUR.error = FT_THROW( Nested_DEFS );
         return;
 
       case 0x2D:   /* ENDF */
     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 */
     {
-      CUR.error = TT_Err_ENDF_In_Exec_Stream;
+      CUR.error = FT_THROW( ENDF_In_Exec_Stream );
       return;
     }
 
     if ( pRec->Cur_Count > 0 )
     {
       CUR.callTop++;
-      CUR.IP = pRec->Cur_Restart;
+      CUR.IP = pRec->Def->start;
     }
     else
       /* Loop through the current function */
     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 )
     {
-      CUR.error = TT_Err_Stack_Overflow;
+      CUR.error = FT_THROW( Stack_Overflow );
       return;
     }
 
     pCrec->Caller_Range = CUR.curRange;
     pCrec->Caller_IP    = CUR.IP + 1;
     pCrec->Cur_Count    = 1;
-    pCrec->Cur_Restart  = def->start;
-    pCrec->Cur_End      = def->end;
+    pCrec->Def          = def;
 
     CUR.callTop++;
 
                         def->start );
 
     CUR.step_ins = FALSE;
+
     return;
 
   Fail:
-    CUR.error = TT_Err_Invalid_Reference;
+    CUR.error = FT_THROW( Invalid_Reference );
   }
 
 
     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 )
     {
-      CUR.error = TT_Err_Stack_Overflow;
+      CUR.error = FT_THROW( Stack_Overflow );
       return;
     }
 
       pCrec->Caller_Range = CUR.curRange;
       pCrec->Caller_IP    = CUR.IP + 1;
       pCrec->Cur_Count    = (FT_Int)args[0];
-      pCrec->Cur_Restart  = def->start;
-      pCrec->Cur_End      = def->end;
+      pCrec->Def          = def;
 
       CUR.callTop++;
 
 
       CUR.step_ins = FALSE;
     }
+
     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 )
       {
-        CUR.error = TT_Err_Too_Many_Instruction_Defs;
+        CUR.error = FT_THROW( Too_Many_Instruction_Defs );
         return;
       }
       CUR.numIDefs++;
     /* 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;
     }
 
       {
       case 0x89:   /* IDEF */
       case 0x2C:   /* FDEF */
-        CUR.error = TT_Err_Nested_DEFS;
+        CUR.error = FT_THROW( Nested_DEFS );
         return;
       case 0x2D:   /* ENDF */
         return;
 
     if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
     {
-      CUR.error = TT_Err_Stack_Overflow;
+      CUR.error = FT_THROW( Stack_Overflow );
       return;
     }
 
 
     if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
     {
-      CUR.error = TT_Err_Stack_Overflow;
+      CUR.error = FT_THROW( Stack_Overflow );
       return;
     }
 
 
     if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
     {
-      CUR.error = TT_Err_Stack_Overflow;
+      CUR.error = FT_THROW( Stack_Overflow );
       return;
     }
 
 
     if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
     {
-      CUR.error = TT_Err_Stack_Overflow;
+      CUR.error = FT_THROW( Stack_Overflow );
       return;
     }
 
     if ( BOUNDSL( L, CUR.zp2.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       R = 0;
     }
     else
     if ( BOUNDS( L, CUR.zp2.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
          BOUNDS( K, CUR.zp1.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       D = 0;
     }
     else
           {
             /* this should be faster */
             D = CUR_Func_dualproj( vec1, vec2 );
-            D = TT_MULFIX( D, CUR.metrics.x_scale );
+            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 );
           }
       }
     }
 
+#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;
   }
 
          BOUNDS( p1, CUR.zp2.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
 
       A = v1->x - v2->x;
       B = v1->y - v2->y;
+
+      if ( A == 0 && B == 0 )
+      {
+        A    = 0x4000;
+        aOpc = 0;
+      }
     }
 
     if ( ( aOpc & 1 ) != 0 )
 
     default:
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
 
     default:
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
 
     default:
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
 
     default:
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
   /*************************************************************************/
   /*                                                                       */
   /* INSTCTRL[]:   INSTruction ConTRoL                                     */
-  /* Opcode range: 0x8e                                                    */
+  /* Opcode range: 0x8E                                                    */
   /* Stack:        int32 int32 -->                                         */
   /*                                                                       */
   static void
     if ( K < 1 || K > 2 )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
     if ( CUR.top < CUR.GS.loop )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Too_Few_Arguments;
+        CUR.error = FT_THROW( Too_Few_Arguments );
       goto Fail;
     }
 
       {
         if ( CUR.pedantic_hinting )
         {
-          CUR.error = TT_Err_Invalid_Reference;
+          CUR.error = FT_THROW( Invalid_Reference );
           return;
         }
       }
          BOUNDS( L, CUR.pts.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
          BOUNDS( L, CUR.pts.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
     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;
     }
     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;
     if ( CUR.top < CUR.GS.loop )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       goto Fail;
     }
 
       {
         if ( CUR.pedantic_hinting )
         {
-          CUR.error = TT_Err_Invalid_Reference;
+          CUR.error = FT_THROW( Invalid_Reference );
           return;
         }
       }
       else
+#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--;
   /*                                                                       */
   /* UNDOCUMENTED: According to Greg Hitchcock, there is one (virtual)     */
   /*               contour in the twilight zone, namely contour number     */
-  /*               zero.                                                   */
+  /*               zero which includes all points of it.                   */
   /*                                                                       */
   static void
   Ins_SHC( INS_ARG )
     if ( BOUNDS( contour, bounds ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
     if ( BOUNDS( args[0], 2 ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
   {
     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.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       goto Fail;
     }
 
     {
       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 = TT_MulFix14( (FT_UInt32)args[0], 0x4000 );
+        dy = (FT_UInt32)args[0];
       }
     }
     else
       {
         if ( CUR.pedantic_hinting )
         {
-          CUR.error = TT_Err_Invalid_Reference;
+          CUR.error = FT_THROW( Invalid_Reference );
           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 );
 
+#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
       CUR.GS.loop--;
     }
 
     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];
 
          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;
     }
 
     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;
   Ins_MDAP( INS_ARG )
   {
     FT_UShort   point;
-    FT_F26Dot6  cur_dist,
-                distance;
+    FT_F26Dot6  cur_dist;
+    FT_F26Dot6  distance;
 
 
     point = (FT_UShort)args[0];
     if ( BOUNDS( point, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
     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;
   {
     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 )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       goto Fail;
     }
 
 
     if ( CUR.GS.gep0 == 0 )   /* If in twilight zone */
     {
-      CUR.zp0.org[point].x = TT_MulFix14( (FT_UInt32)distance,
-                                          CUR.GS.freeVector.x );
+#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];
     }
+#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] );
 
-    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 = 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 );
   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];
 
          BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       goto Fail;
     }
 
       {
         /* 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;
 
 
-        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 );
       }
     /* 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] );
+    }
     else
       distance = ROUND_None(
                    org_dist,
     {
       if ( org_dist >= 0 )
       {
-        if ( distance < CUR.GS.minimum_distance )
-          distance = CUR.GS.minimum_distance;
+        if ( distance < minimum_distance )
+          distance = minimum_distance;
       }
       else
       {
-        if ( distance > -CUR.GS.minimum_distance )
-          distance = -CUR.GS.minimum_distance;
+        if ( distance > -minimum_distance )
+          distance = -minimum_distance;
       }
     }
 
     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 */
 
          BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       goto Fail;
     }
 
         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 )
     {
         /*      `ttinst2.doc', version 1.66, is thus incorrect since  */
         /*      it implies `>=' instead of `>'.                       */
 
-        if ( FT_ABS( cvt_dist - org_dist ) > CUR.GS.control_value_cutin )
+        if ( FT_ABS( cvt_dist - org_dist ) > control_value_cutin )
           cvt_dist = org_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] );
+    }
 
     /* minimum distance test */
 
     {
       if ( org_dist >= 0 )
       {
-        if ( distance < CUR.GS.minimum_distance )
-          distance = CUR.GS.minimum_distance;
+        if ( distance < minimum_distance )
+          distance = minimum_distance;
       }
       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 );
 
+#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;
 
     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 )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       goto Fail;
     }
 
       {
         if ( CUR.pedantic_hinting )
         {
-          CUR.error = TT_Err_Invalid_Reference;
+          CUR.error = FT_THROW( Invalid_Reference );
           return;
         }
       }
                 a0, a1,
                 b0, b1;
 
-    FT_F26Dot6  discriminant;
+    FT_F26Dot6  discriminant, dotproduct;
 
     FT_F26Dot6  dx,  dy,
                 dax, day,
          BOUNDS( point, CUR.zp2.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       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;
 
 
     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;
          BOUNDS( p2, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
     if ( CUR.top < CUR.GS.loop )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       goto Fail;
     }
 
     if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       goto Fail;
     }
 
         FT_Vector  vec;
 
 
-        vec.x = TT_MULFIX( CUR.zp1.orus[CUR.GS.rp2].x - orus_base->x,
+        vec.x = FT_MulFix( CUR.zp1.orus[CUR.GS.rp2].x - orus_base->x,
                            CUR.metrics.x_scale );
-        vec.y = TT_MULFIX( CUR.zp1.orus[CUR.GS.rp2].y - orus_base->y,
+        vec.y = FT_MulFix( CUR.zp1.orus[CUR.GS.rp2].y - orus_base->y,
                            CUR.metrics.y_scale );
 
         old_range = CUR_fast_dualproj( &vec );
       {
         if ( CUR.pedantic_hinting )
         {
-          CUR.error = TT_Err_Invalid_Reference;
+          CUR.error = FT_THROW( Invalid_Reference );
           return;
         }
         continue;
         FT_Vector  vec;
 
 
-        vec.x = TT_MULFIX( CUR.zp2.orus[point].x - orus_base->x,
+        vec.x = FT_MulFix( CUR.zp2.orus[point].x - orus_base->x,
                            CUR.metrics.x_scale );
-        vec.y = TT_MULFIX( CUR.zp2.orus[point].y - orus_base->y,
+        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 );
+      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:                                      */
+          /*                                                         */
+          /*   delta = org_dist - cur_dist          .                */
+          /*                                                         */
+          /* We move `point' by `new_dist - cur_dist' after leaving  */
+          /* this block, thus we have                                */
+          /*                                                         */
+          /*   new_dist - cur_dist = delta                   ,       */
+          /*   new_dist - cur_dist = org_dist - cur_dist     ,       */
+          /*              new_dist = org_dist                .       */
+
+          new_dist = org_dist;
+        }
+      }
       else
         new_dist = 0;
 
     if ( BOUNDS( point, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
           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 ) +
-              TT_MULFIX( worker->orus[i].x - orus1, scale );
+              FT_MulFix( worker->orus[i].x - orus1, scale );
         }
         worker->curs[i].x = x;
       }
     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;
   static void
   Ins_DELTAP( INS_ARG )
   {
-    FT_ULong   k, nump;
+    FT_ULong   nump, k;
     FT_UShort  A;
-    FT_ULong   C;
+    FT_ULong   C, P;
     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
       if ( CUR.args < n )
       {
         if ( CUR.pedantic_hinting )
-          CUR.error = TT_Err_Too_Few_Arguments;
+          CUR.error = FT_THROW( Too_Few_Arguments );
         n = CUR.args;
       }
 
     }
 #endif
 
+    P = (FT_ULong)CUR_Func_cur_ppem();
     nump = (FT_ULong)args[0];   /* some points theoretically may occur more
                                    than once, thus UShort isn't enough */
 
       if ( CUR.args < 2 )
       {
         if ( CUR.pedantic_hinting )
-          CUR.error = TT_Err_Too_Few_Arguments;
+          CUR.error = FT_THROW( Too_Few_Arguments );
         CUR.args = 0;
         goto Fail;
       }
 
         C += CUR.GS.delta_base;
 
-        if ( CURRENT_Ppem() == (FT_Long)C )
+        if ( P == C )
         {
           B = ( (FT_ULong)B & 0xF ) - 8;
           if ( B >= 0 )
             B++;
-          B = B * 64 / ( 1L << CUR.GS.delta_shift );
+          B *= 1L << ( 6 - CUR.GS.delta_shift );
+
+#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, or
+             *  - glyph is composite and freedom vector is not in subpixel
+             *    direction.
+             */
+            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, always skipping deltas in subpixel direction.     */
+            else if ( CUR.ignore_x_mode && CUR.GS.freeVector.y != 0 )
+            {
+              /* save the y value of the point now; compare after move */
+              B1 = (FT_UShort)CUR.zp0.cur[A].y;
+
+              /* Standard subpixel hinting: Allow y move for y-touched */
+              /* points.  This messes up DejaVu ...                    */
+              if ( !CUR.face->sph_compatibility_mode          &&
+                   ( CUR.zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) )
+                CUR_Func_move( &CUR.zp0, A, B );
+
+              /* compatibility mode */
+              else if ( CUR.face->sph_compatibility_mode                      &&
+                        !( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) )
+              {
+                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 = (FT_UShort)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 );
+            CUR_Func_move( &CUR.zp0, A, B );
         }
       }
       else
         if ( CUR.pedantic_hinting )
-          CUR.error = TT_Err_Invalid_Reference;
+          CUR.error = FT_THROW( Invalid_Reference );
     }
 
   Fail:
   Ins_DELTAC( INS_ARG )
   {
     FT_ULong  nump, k;
-    FT_ULong  A, C;
+    FT_ULong  A, C, P;
     FT_Long   B;
 
 
       if ( CUR.args < n )
       {
         if ( CUR.pedantic_hinting )
-          CUR.error = TT_Err_Too_Few_Arguments;
+          CUR.error = FT_THROW( Too_Few_Arguments );
         n = CUR.args;
       }
 
     }
 #endif
 
+    P    = (FT_ULong)CUR_Func_cur_ppem();
     nump = (FT_ULong)args[0];
 
     for ( k = 1; k <= nump; k++ )
       if ( CUR.args < 2 )
       {
         if ( CUR.pedantic_hinting )
-          CUR.error = TT_Err_Too_Few_Arguments;
+          CUR.error = FT_THROW( Too_Few_Arguments );
         CUR.args = 0;
         goto Fail;
       }
       {
         if ( CUR.pedantic_hinting )
         {
-          CUR.error = TT_Err_Invalid_Reference;
+          CUR.error = FT_THROW( Invalid_Reference );
           return;
         }
       }
 
         C += CUR.GS.delta_base;
 
-        if ( CURRENT_Ppem() == (FT_Long)C )
+        if ( P == C )
         {
           B = ( (FT_ULong)B & 0xF ) - 8;
           if ( B >= 0 )
             B++;
-          B = B * 64 / ( 1L << CUR.GS.delta_shift );
+          B *= 1L << ( 6 - CUR.GS.delta_shift );
 
           CUR_Func_move_cvt( A, B );
         }
 
     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;
 
-    /* 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;
 
-    /* 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;
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+    if ( SUBPIXEL_HINTING                                    &&
+         CUR.ignore_x_mode                                   &&
+         CUR.rasterizer_version >= TT_INTERPRETER_VERSION_35 )
+    {
+
+      if ( CUR.rasterizer_version >= 37 )
+      {
+        /********************************/
+        /* HINTING FOR SUBPIXEL         */
+        /* Selector Bit:  6             */
+        /* Return Bit(s): 13            */
+        /*                              */
+        if ( ( args[0] & 64 ) != 0 && CUR.subpixel )
+          K |= 1 << 13;
+
+        /********************************/
+        /* 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;
   }
 
 
         if ( CUR.callTop >= CUR.callSize )
         {
-          CUR.error = TT_Err_Stack_Overflow;
+          CUR.error = FT_THROW( Stack_Overflow );
           return;
         }
 
         call->Caller_Range = CUR.curRange;
         call->Caller_IP    = CUR.IP + 1;
         call->Cur_Count    = 1;
-        call->Cur_Restart  = def->start;
-        call->Cur_End      = def->end;
+        call->Def          = def;
 
         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_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
+    if ( !exc )
+      return FT_THROW( Invalid_Argument );
+
     cur = *exc;
 #endif
 
-    /* set CVT functions */
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    CUR.iup_called = FALSE;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+    /* set PPEM and CVT functions */
     CUR.tt_metrics.ratio = 0;
     if ( CUR.metrics.x_ppem != CUR.metrics.y_ppem )
     {
       /* non-square pixels, use the stretched routines */
+      CUR.func_cur_ppem  = Current_Ppem_Stretched;
       CUR.func_read_cvt  = Read_CVT_Stretched;
       CUR.func_write_cvt = Write_CVT_Stretched;
       CUR.func_move_cvt  = Move_CVT_Stretched;
     else
     {
       /* square pixels, use normal routines */
+      CUR.func_cur_ppem  = Current_Ppem;
       CUR.func_read_cvt  = Read_CVT;
       CUR.func_write_cvt = Write_CVT;
       CUR.func_move_cvt  = Move_CVT;
       /* One can also interpret it as the index of the last argument.    */
       if ( CUR.args < 0 )
       {
-        FT_UShort  i;
-
-
         if ( CUR.pedantic_hinting )
         {
-          CUR.error = TT_Err_Too_Few_Arguments;
+          CUR.error = FT_THROW( Too_Few_Arguments );
           goto LErrorLabel_;
         }
 
       /* 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;
-      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
 
           Ins_MDAP( EXEC_ARG_ args );
           break;
 
-
         case 0x30:  /* IUP */
         case 0x31:  /* IUP */
           Ins_IUP( EXEC_ARG_ args );
           break;
 
       Set_Invalid_Ref:
-            CUR.error = TT_Err_Invalid_Reference;
+            CUR.error = FT_THROW( Invalid_Reference );
           break;
 
         case 0x43:  /* RS */
 
 #endif /* TT_CONFIG_OPTION_INTERPRETER_SWITCH */
 
-      if ( CUR.error != TT_Err_Ok )
+      if ( 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;
 
                 if ( CUR.callTop >= CUR.callSize )
                 {
-                  CUR.error = TT_Err_Invalid_Reference;
+                  CUR.error = FT_THROW( Invalid_Reference );
                   goto LErrorLabel_;
                 }
 
                 callrec->Caller_Range = CUR.curRange;
                 callrec->Caller_IP    = CUR.IP + 1;
                 callrec->Cur_Count    = 1;
-                callrec->Cur_Restart  = def->start;
-                callrec->Cur_End      = def->end;
+                callrec->Def          = def;
 
                 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
       /* 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 )
         {
-          CUR.error = TT_Err_Code_Overflow;
+          CUR.error = FT_THROW( Code_Overflow );
           goto LErrorLabel_;
         }
         else
     *exc = cur;
 #endif
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
 
   LErrorCodeOverflow_:
-    CUR.error = TT_Err_Code_Overflow;
+    CUR.error = FT_THROW( Code_Overflow );
 
   LErrorLabel_:
 
     /* If any errors have occurred, function tables may be broken. */
     /* Force a re-execution of `prep' and `fpgm' tables if no      */
     /* bytecode debugger is run.                                   */
-    if ( CUR.error && !CUR.instruction_trap )
+    if ( CUR.error                          &&
+         !CUR.instruction_trap              &&
+         CUR.curRange == tt_coderange_glyph )
     {
       FT_TRACE1(( "  The interpreter returned error 0x%x\n", CUR.error ));
-      exc->size->cvt_ready      = FALSE;
+      exc->size->bytecode_ready = -1;
+      exc->size->cvt_ready      = -1;
     }
 
     return CUR.error;
index 6d0fc03..333decc 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType bytecode interpreter (specification).                       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010 by       */
+/*  Copyright 1996-2007, 2010, 2012-2014 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -81,6 +81,10 @@ FT_BEGIN_HEADER
   (*TT_Project_Func)( EXEC_OP_ FT_Pos   dx,
                                FT_Pos   dy );
 
+  /* getting current ppem.  Take care of non-square pixels if necessary */
+  typedef FT_Long
+  (*TT_Cur_Ppem_Func)( EXEC_OP );
+
   /* reading a cvt value.  Take care of non-square pixels if necessary */
   typedef FT_F26Dot6
   (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong  idx );
@@ -101,12 +105,54 @@ FT_BEGIN_HEADER
     FT_Int   Caller_Range;
     FT_Long  Caller_IP;
     FT_Long  Cur_Count;
-    FT_Long  Cur_Restart;
-    FT_Long  Cur_End;
+
+    TT_DefRecord  *Def; /* either FDEF or IDEF */
 
   } 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   */
@@ -186,11 +232,6 @@ FT_BEGIN_HEADER
     FT_F26Dot6         phase;      /* `SuperRounding'     */
     FT_F26Dot6         threshold;
 
-#if 0
-    /* this seems to be unused */
-    FT_Int             cur_ppem;   /* ppem along the current proj vector */
-#endif
-
     FT_Bool            instruction_trap; /* If `True', the interpreter will */
                                          /* exit after each instruction     */
 
@@ -212,30 +253,61 @@ FT_BEGIN_HEADER
     TT_Move_Func       func_move;      /* current point move function */
     TT_Move_Func       func_move_orig; /* move original position function */
 
+    TT_Cur_Ppem_Func   func_cur_ppem;  /* get current proj. ppem value  */
+
     TT_Get_CVT_Func    func_read_cvt;  /* read a cvt entry              */
     TT_Set_CVT_Func    func_write_cvt; /* write a cvt entry (in pixels) */
     TT_Set_CVT_Func    func_move_cvt;  /* incr a cvt entry (in pixels)  */
 
     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            subpixel;          /* Using subpixel 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;
 
 
-  FT_LOCAL( FT_Error )
+#ifdef TT_USE_BYTECODE_INTERPRETER
+  FT_LOCAL( void )
   TT_Goto_CodeRange( TT_ExecContext  exec,
                      FT_Int          range,
                      FT_Long         IP );
 
-  FT_LOCAL( FT_Error )
+  FT_LOCAL( void )
   TT_Set_CodeRange( TT_ExecContext  exec,
                     FT_Int          range,
                     void*           base,
                     FT_Long         length );
 
-  FT_LOCAL( FT_Error )
+  FT_LOCAL( void )
   TT_Clear_CodeRange( TT_ExecContext  exec,
                       FT_Int          range );
 
@@ -246,6 +318,7 @@ FT_BEGIN_HEADER
               FT_Long    multiplier,
               void*      _pbuff,
               FT_ULong   new_max );
+#endif /* TT_USE_BYTECODE_INTERPRETER */
 
 
   /*************************************************************************/
@@ -270,7 +343,9 @@ FT_BEGIN_HEADER
   FT_EXPORT( TT_ExecContext )
   TT_New_Context( TT_Driver  driver );
 
-  FT_LOCAL( FT_Error )
+
+#ifdef TT_USE_BYTECODE_INTERPRETER
+  FT_LOCAL( void )
   TT_Done_Context( TT_ExecContext  exec );
 
   FT_LOCAL( FT_Error )
@@ -278,13 +353,14 @@ FT_BEGIN_HEADER
                    TT_Face         face,
                    TT_Size         size );
 
-  FT_LOCAL( FT_Error )
+  FT_LOCAL( void )
   TT_Save_Context( TT_ExecContext  exec,
                    TT_Size         ins );
 
   FT_LOCAL( FT_Error )
   TT_Run_Context( TT_ExecContext  exec,
                   FT_Bool         debug );
+#endif /* TT_USE_BYTECODE_INTERPRETER */
 
 
   /*************************************************************************/
index 814c713..4707dfe 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Objects manager (body).                                              */
 /*                                                                         */
-/*  Copyright 1996-2011                                                    */
+/*  Copyright 1996-2013                                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -21,6 +21,7 @@
 #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"
   tt_check_trickyness_family( FT_String*  name )
   {
 
-#define TRICK_NAMES_MAX_CHARACTERS  16
-#define TRICK_NAMES_COUNT            8
+#define TRICK_NAMES_MAX_CHARACTERS  19
+#define TRICK_NAMES_COUNT            9
 
     static const char trick_names[TRICK_NAMES_COUNT]
                                  [TRICK_NAMES_MAX_CHARACTERS + 1] =
     {
-      "DFKaiSho-SB",     /* dfkaisb.ttf */
+      "DFKaiSho-SB",        /* dfkaisb.ttf */
       "DFKaiShu",
-      "DFKai-SB",        /* kaiu.ttf */
-      "HuaTianKaiTi?",   /* htkt2.ttf */
-      "HuaTianSongTi?",  /* htst3.ttf */
-      "MingLiU",         /* mingliu.ttf & mingliu.ttc */
-      "PMingLiU",        /* mingliu.ttc */
-      "MingLi43",        /* mingli.ttf */
+      "DFKai-SB",           /* kaiu.ttf */
+      "HuaTianKaiTi?",      /* htkt2.ttf */
+      "HuaTianSongTi?",     /* htst3.ttf */
+      "Ming(for ISO10646)", /* hkscsiic.ttf & iicore.ttf */
+      "MingLiU",            /* mingliu.ttf & mingliu.ttc */
+      "PMingLiU",           /* mingliu.ttc */
+      "MingLi43",           /* mingli.ttf */
     };
 
     int  nn;
   tt_check_trickyness_sfnt_ids( TT_Face  face )
   {
 #define TRICK_SFNT_IDS_PER_FACE   3
-#define TRICK_SFNT_IDS_NUM_FACES  13
+#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] = {
 #define TRICK_SFNT_ID_prep  2
 
       { /* MingLiU 1995 */
-        { 0x05bcf058, 0x000002e4 }, /* cvt  */
-        { 0x28233bf1, 0x000087c4 }, /* fpgm */
-        { 0xa344a1ea, 0x000001e1 }  /* prep */
+        { 0x05BCF058UL, 0x000002E4UL }, /* cvt  */
+        { 0x28233BF1UL, 0x000087C4UL }, /* fpgm */
+        { 0xA344A1EAUL, 0x000001E1UL }  /* prep */
       },
       { /* MingLiU 1996- */
-        { 0x05bcf058, 0x000002e4 }, /* cvt  */
-        { 0x28233bf1, 0x000087c4 }, /* fpgm */
-        { 0xa344a1eb, 0x000001e1 }  /* prep */
+        { 0x05BCF058UL, 0x000002E4UL }, /* cvt  */
+        { 0x28233BF1UL, 0x000087C4UL }, /* fpgm */
+        { 0xA344A1EBUL, 0x000001E1UL }  /* prep */
       },
       { /* DFKaiShu */
-        { 0x11e5ead4, 0x00000350 }, /* cvt  */
-        { 0x5a30ca3b, 0x00009063 }, /* fpgm */
-        { 0x13a42602, 0x0000007e }  /* prep */
+        { 0x11E5EAD4UL, 0x00000350UL }, /* cvt  */
+        { 0x5A30CA3BUL, 0x00009063UL }, /* fpgm */
+        { 0x13A42602UL, 0x0000007EUL }  /* prep */
       },
       { /* HuaTianKaiTi */
-        { 0xfffbfffc, 0x00000008 }, /* cvt  */
-        { 0x9c9e48b8, 0x0000bea2 }, /* fpgm */
-        { 0x70020112, 0x00000008 }  /* prep */
+        { 0xFFFBFFFCUL, 0x00000008UL }, /* cvt  */
+        { 0x9C9E48B8UL, 0x0000BEA2UL }, /* fpgm */
+        { 0x70020112UL, 0x00000008UL }  /* prep */
       },
       { /* HuaTianSongTi */
-        { 0xfffbfffc, 0x00000008 }, /* cvt  */
-        { 0x0a5a0483, 0x00017c39 }, /* fpgm */
-        { 0x70020112, 0x00000008 }  /* prep */
+        { 0xFFFBFFFCUL, 0x00000008UL }, /* cvt  */
+        { 0x0A5A0483UL, 0x00017C39UL }, /* fpgm */
+        { 0x70020112UL, 0x00000008UL }  /* prep */
       },
       { /* NEC fadpop7.ttf */
-        { 0x00000000, 0x00000000 }, /* cvt  */
-        { 0x40c92555, 0x000000e5 }, /* fpgm */
-        { 0xa39b58e3, 0x0000117c }  /* prep */
+        { 0x00000000UL, 0x00000000UL }, /* cvt  */
+        { 0x40C92555UL, 0x000000E5UL }, /* fpgm */
+        { 0xA39B58E3UL, 0x0000117CUL }  /* prep */
       },
       { /* NEC fadrei5.ttf */
-        { 0x00000000, 0x00000000 }, /* cvt  */
-        { 0x33c41652, 0x000000e5 }, /* fpgm */
-        { 0x26d6c52a, 0x00000f6a }  /* prep */
+        { 0x00000000UL, 0x00000000UL }, /* cvt  */
+        { 0x33C41652UL, 0x000000E5UL }, /* fpgm */
+        { 0x26D6C52AUL, 0x00000F6AUL }  /* prep */
       },
       { /* NEC fangot7.ttf */
-        { 0x00000000, 0x00000000 }, /* cvt  */
-        { 0x6db1651d, 0x0000019d }, /* fpgm */
-        { 0x6c6e4b03, 0x00002492 }  /* prep */
+        { 0x00000000UL, 0x00000000UL }, /* cvt  */
+        { 0x6DB1651DUL, 0x0000019DUL }, /* fpgm */
+        { 0x6C6E4B03UL, 0x00002492UL }  /* prep */
       },
       { /* NEC fangyo5.ttf */
-        { 0x00000000, 0x00000000 }, /* cvt  */
-        { 0x40c92555, 0x000000e5 }, /* fpgm */
-        { 0xde51fad0, 0x0000117c }  /* prep */
+        { 0x00000000UL, 0x00000000UL }, /* cvt  */
+        { 0x40C92555UL, 0x000000E5UL }, /* fpgm */
+        { 0xDE51FAD0UL, 0x0000117CUL }  /* prep */
       },
       { /* NEC fankyo5.ttf */
-        { 0x00000000, 0x00000000 }, /* cvt  */
-        { 0x85e47664, 0x000000e5 }, /* fpgm */
-        { 0xa6c62831, 0x00001caa }  /* prep */
+        { 0x00000000UL, 0x00000000UL }, /* cvt  */
+        { 0x85E47664UL, 0x000000E5UL }, /* fpgm */
+        { 0xA6C62831UL, 0x00001CAAUL }  /* prep */
       },
       { /* NEC fanrgo5.ttf */
-        { 0x00000000, 0x00000000 }, /* cvt  */
-        { 0x2d891cfd, 0x0000019d }, /* fpgm */
-        { 0xa0604633, 0x00001de8 }  /* prep */
+        { 0x00000000UL, 0x00000000UL }, /* cvt  */
+        { 0x2D891CFDUL, 0x0000019DUL }, /* fpgm */
+        { 0xA0604633UL, 0x00001DE8UL }  /* prep */
       },
       { /* NEC fangot5.ttc */
-        { 0x00000000, 0x00000000 }, /* cvt  */
-        { 0x40aa774c, 0x000001cb }, /* fpgm */
-        { 0x9b5caa96, 0x00001f9a }  /* prep */
+        { 0x00000000UL, 0x00000000UL }, /* cvt  */
+        { 0x40AA774CUL, 0x000001CBUL }, /* fpgm */
+        { 0x9B5CAA96UL, 0x00001F9AUL }  /* prep */
       },
       { /* NEC fanmin3.ttc */
-        { 0x00000000, 0x00000000 }, /* cvt  */
-        { 0x0d3de9cb, 0x00000141 }, /* fpgm */
-        { 0xd4127766, 0x00002280 }  /* prep */
+        { 0x00000000UL, 0x00000000UL }, /* cvt  */
+        { 0x0D3DE9CBUL, 0x00000141UL }, /* fpgm */
+        { 0xD4127766UL, 0x00002280UL }  /* prep */
+      },
+      { /* NEC FA-Gothic, 1996 */
+        { 0x00000000UL, 0x00000000UL }, /* cvt  */
+        { 0x4A692698UL, 0x000001F0UL }, /* fpgm */
+        { 0x340D4346UL, 0x00001FCAUL }  /* prep */
+      },
+      { /* NEC FA-Minchou, 1996 */
+        { 0x00000000UL, 0x00000000UL }, /* cvt  */
+        { 0xCD34C604UL, 0x00000166UL }, /* fpgm */
+        { 0x6CF31046UL, 0x000022B0UL }  /* prep */
+      },
+      { /* NEC FA-RoundGothicB, 1996 */
+        { 0x00000000UL, 0x00000000UL }, /* cvt  */
+        { 0x5DA75315UL, 0x0000019DUL }, /* fpgm */
+        { 0x40745A5FUL, 0x000022E0UL }  /* prep */
+      },
+      { /* NEC FA-RoundGothicM, 1996 */
+        { 0x00000000UL, 0x00000000UL }, /* cvt  */
+        { 0xF055FC48UL, 0x000001C2UL }, /* fpgm */
+        { 0x3900DED3UL, 0x00001E18UL }  /* prep */
       }
     };
 
     if ( !sfnt )
     {
       FT_ERROR(( "tt_face_init: cannot access `sfnt' module\n" ));
-      error = TT_Err_Missing_Module;
+      error = FT_THROW( Missing_Module );
       goto Exit;
     }
 
 
     /* check that we have a valid TrueType file */
     error = sfnt->init_face( stream, face, face_index, num_params, params );
+
+    /* Stream may have changed. */
+    stream = face->root.stream;
+
     if ( error )
       goto Exit;
 
 
     /* 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 );
     return error;
 
   Bad_Format:
-    error = TT_Err_Unknown_File_Format;
+    error = FT_THROW( Unknown_File_Format );
     goto Exit;
   }
 
       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 );
+    error = TT_Load_Context( exec, face, size );
+    if ( error )
+      return error;
 
     exec->callTop = 0;
     exec->top     = 0;
     exec->threshold = 0;
 
     exec->instruction_trap = FALSE;
-    exec->F_dot_P          = 0x10000L;
+    exec->F_dot_P          = 0x4000L;
 
     exec->pedantic_hinting = pedantic;
 
 
     if ( face->font_program_size > 0 )
     {
-      error = TT_Goto_CodeRange( exec, tt_coderange_font, 0 );
+      TT_Goto_CodeRange( exec, tt_coderange_font, 0 );
 
-      if ( !error )
-      {
-        FT_TRACE4(( "Executing `fpgm' table.\n" ));
-
-        error = face->interpreter( exec );
-      }
+      FT_TRACE4(( "Executing `fpgm' table.\n" ));
+      error = face->interpreter( exec );
     }
     else
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
+
+    size->bytecode_ready = error;
 
     if ( !error )
       TT_Save_Context( exec, size );
       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 );
+    error = TT_Load_Context( exec, face, size );
+    if ( error )
+      return error;
 
     exec->callTop = 0;
     exec->top     = 0;
 
     if ( face->cvt_program_size > 0 )
     {
-      error = TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 );
+      TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 );
 
-      if ( !error && !size->debug )
+      if ( !size->debug )
       {
         FT_TRACE4(( "Executing `prep' table.\n" ));
 
       }
     }
     else
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
+
+    size->cvt_ready = error;
+
+    /* 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;
     return error;
   }
 
-#endif /* TT_USE_BYTECODE_INTERPRETER */
-
-
-#ifdef TT_USE_BYTECODE_INTERPRETER
 
   static void
   tt_size_done_bytecode( FT_Size  ftsize )
     size->max_func = 0;
     size->max_ins  = 0;
 
-    size->bytecode_ready = 0;
-    size->cvt_ready      = 0;
+    size->bytecode_ready = -1;
+    size->cvt_ready      = -1;
   }
 
 
     TT_Size    size = (TT_Size)ftsize;
     TT_Face    face = (TT_Face)ftsize->face;
     FT_Memory  memory = face->root.memory;
-    FT_Int     i;
 
     FT_UShort       n_twilight;
     TT_MaxProfile*  maxp = &face->max_profile;
 
 
-    size->bytecode_ready = 1;
-    size->cvt_ready      = 0;
+    size->bytecode_ready = -1;
+    size->cvt_ready      = -1;
 
     size->max_function_defs    = maxp->maxFunctionDefs;
     size->max_instruction_defs = maxp->maxInstructionDefs;
       metrics->rotated   = FALSE;
       metrics->stretched = FALSE;
 
-      /* set default compensation (all 0) */
-      for ( i = 0; i < 4; i++ )
-        metrics->compensations[i] = 0;
+      /* set default engine compensation */
+      metrics->compensations[0] = 0;   /* gray     */
+      metrics->compensations[1] = 0;   /* black    */
+      metrics->compensations[2] = 0;   /* white    */
+      metrics->compensations[3] = 0;   /* reserved */
     }
 
     /* allocate function defs, instruction defs, cvt, and storage area */
   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 < 0 )
       error = tt_size_init_bytecode( (FT_Size)size, pedantic );
-      if ( error )
-        goto Exit;
-    }
+
+    if ( error || size->bytecode_ready )
+      goto Exit;
 
     /* rescale CVT when needed */
-    if ( !size->cvt_ready )
+    if ( size->cvt_ready < 0 )
     {
       FT_UInt  i;
       TT_Face  face = (TT_Face)size->root.face;
       size->GS = tt_default_graphics_state;
 
       error = tt_size_run_prep( size, pedantic );
-      if ( !error )
-        size->cvt_ready = 1;
     }
 
   Exit:
   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;
-    size->cvt_ready      = 0;
+    size->bytecode_ready = -1;
+    size->cvt_ready      = -1;
 #endif
 
     size->ttmetrics.valid = FALSE;
 
 
 #ifdef TT_USE_BYTECODE_INTERPRETER
-    if ( size->bytecode_ready )
-      tt_size_done_bytecode( ttsize );
+    tt_size_done_bytecode( ttsize );
 #endif
 
     size->ttmetrics.valid = FALSE;
   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;
 
 
     *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 */
       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;
-      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;
     }
 
 #ifdef TT_USE_BYTECODE_INTERPRETER
-    size->cvt_ready = 0;
+    size->cvt_ready = -1;
 #endif /* TT_USE_BYTECODE_INTERPRETER */
 
     if ( !error )
 
 
     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
+    driver->interpreter_version = TT_INTERPRETER_VERSION_35;
+#endif
+
+#else /* !TT_USE_BYTECODE_INTERPRETER */
 
     FT_UNUSED( ttdriver );
 
-#endif
+#endif /* !TT_USE_BYTECODE_INTERPRETER */
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
index 47e4129..859164f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Objects manager (specification).                                     */
 /*                                                                         */
-/*  Copyright 1996-2009, 2011-2012 by                                      */
+/*  Copyright 1996-2009, 2011-2014 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -95,8 +95,8 @@ FT_BEGIN_HEADER
     FT_F26Dot6     control_value_cutin;
     FT_F26Dot6     single_width_cutin;
     FT_F26Dot6     single_width_value;
-    FT_Short       delta_base;
-    FT_Short       delta_shift;
+    FT_UShort      delta_base;
+    FT_UShort      delta_shift;
 
     FT_Byte        instruct_control;
     /* According to Greg Hitchcock from Microsoft, the `scan_control'     */
@@ -173,11 +173,13 @@ FT_BEGIN_HEADER
   /*                                                                       */
   typedef struct  TT_DefRecord_
   {
-    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_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;
 
@@ -190,7 +192,7 @@ FT_BEGIN_HEADER
   {
     FT_Fixed    xx, xy;     /* transformation matrix coefficients */
     FT_Fixed    yx, yy;
-    FT_F26Dot6  ox, oy;     /* offsets        */
+    FT_F26Dot6  ox, oy;     /* offsets                            */
 
   } TT_Transform;
 
@@ -331,8 +333,10 @@ FT_BEGIN_HEADER
     FT_Bool            debug;
     TT_ExecContext     context;
 
-    FT_Bool            bytecode_ready;
-    FT_Bool            cvt_ready;
+    /* if negative, `fpgm' (resp. `prep'), wasn't executed yet; */
+    /* otherwise it is the returned error code                  */
+    FT_Error           bytecode_ready;
+    FT_Error           cvt_ready;
 
 #endif /* TT_USE_BYTECODE_INTERPRETER */
 
@@ -345,11 +349,12 @@ FT_BEGIN_HEADER
   /*                                                                       */
   typedef struct  TT_DriverRec_
   {
-    FT_DriverRec     root;
+    FT_DriverRec  root;
+
     TT_ExecContext   context;  /* execution context        */
     TT_GlyphZoneRec  zone;     /* glyph loader points zone */
 
-    void*            extension_component;
+    FT_UInt  interpreter_version;
 
   } TT_DriverRec;
 
@@ -427,6 +432,10 @@ FT_BEGIN_HEADER
   tt_slot_init( FT_GlyphSlot  slot );
 
 
+  /* auxiliary */
+#define IS_HINTED( flags )  ( ( flags & FT_LOAD_NO_HINTING ) == 0 )
+
+
 FT_END_HEADER
 
 #endif /* __TTOBJS_H__ */
index 65ca845..edefae7 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
 #include "ttpic.h"
 #include "tterrors.h"
 
+
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from ttdriver.c */
   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
   tt_driver_class_pic_free( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
-    FT_Memory  memory = library->memory;
+    FT_Memory          memory        = library->memory;
 
 
     if ( pic_container->truetype )
   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 */
-    if ( FT_ALLOC ( container, sizeof ( *container ) ) )
+    if ( FT_ALLOC( container, sizeof ( *container ) ) )
       return error;
     FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->truetype = 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_tt_services( library,
                                          &container->tt_services );
     if ( error )
@@ -88,7 +88,8 @@
 #endif
     FT_Init_Class_tt_service_truetype_glyf(
       &container->tt_service_truetype_glyf );
-Exit:
+
+  Exit:
     if ( error )
       tt_driver_class_pic_free( library );
     return error;
index 48f43a5..cfb4ee6 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    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,       */
 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
+#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
-    FT_Service_MultiMastersRec tt_service_gx_multi_masters;
+    FT_Service_MultiMastersRec  tt_service_gx_multi_masters;
 #endif
-    FT_Service_TTGlyfRec tt_service_truetype_glyf;
+    FT_Service_TTGlyfRec        tt_service_truetype_glyf;
+    FT_Service_PropertiesRec    tt_service_properties;
+
   } 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
@@ -58,6 +72,7 @@ FT_BEGIN_HEADER
 
  /* */
 
+
 FT_END_HEADER
 
 #endif /* __TTPIC_H__ */
index bb6005d..9991925 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType-specific tables loader (body).                              */
 /*                                                                         */
-/*  Copyright 1996-2002, 2004-2012 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,       */
@@ -72,7 +72,7 @@
 
     /* 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;
@@ -81,7 +81,7 @@
     error = face->goto_table( face, TTAG_loca, stream, &table_len );
     if ( error )
     {
-      error = TT_Err_Locations_Missing;
+      error = FT_THROW( Locations_Missing );
       goto Exit;
     }
 
@@ -92,7 +92,7 @@
       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;
       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;
 
       face->cvt_size = 0;
       face->cvt      = NULL;
-      error          = TT_Err_Ok;
+      error          = FT_Err_Ok;
 
       goto Exit;
     }
     FT_UNUSED( face   );
     FT_UNUSED( stream );
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
 
 #endif
   }
     {
       face->font_program      = NULL;
       face->font_program_size = 0;
-      error                   = TT_Err_Ok;
+      error                   = FT_Err_Ok;
 
       FT_TRACE2(( "is missing\n" ));
     }
     FT_UNUSED( face   );
     FT_UNUSED( stream );
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
 
 #endif
   }
     {
       face->cvt_program      = NULL;
       face->cvt_program_size = 0;
-      error                  = TT_Err_Ok;
+      error                  = FT_Err_Ok;
 
       FT_TRACE2(( "is missing\n" ));
     }
     FT_UNUSED( face   );
     FT_UNUSED( stream );
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
 
 #endif
   }
     /* 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;
     record_size = FT_NEXT_ULONG( p );
 
     /* The maximum number of bytes in an hdmx device record is the */
-    /* maximum number of glyphs + 2; this is 0xFFFF + 2; this is   */
-    /* the reason why `record_size' is a long (which we read as    */
-    /* unsigned long for convenience).  In practice, two bytes     */
+    /* maximum number of glyphs + 2; this is 0xFFFF + 2, thus      */
+    /* explaining why `record_size' is a long (which we read as    */
+    /* unsigned long for convenience).  In practice, two bytes are */
     /* sufficient to hold the size value.                          */
     /*                                                             */
     /* There are at least two fonts, HANNOM-A and HANNOM-B version */
       record_size &= 0xFFFFU;
 
     /* The limit for `num_records' is a heuristic value. */
-
-    if ( version != 0 || num_records > 255 || record_size > 0x10001L )
+    if ( version != 0           ||
+         num_records > 255      ||
+         record_size > 0x10001L ||
+         record_size < 4        )
     {
-      error = TT_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Fail;
     }
 
diff --git a/src/truetype/ttsubpix.c b/src/truetype/ttsubpix.c
new file mode 100644 (file)
index 0000000..ca60451
--- /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] =
+  {
+    { "Verdana Clones", 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    = -1;
+
+        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    = -1;
+
+        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/src/truetype/ttsubpix.h b/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 */
index 1fff15d..de9c199 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    AFM support for Type 1 fonts (body).                                 */
 /*                                                                         */
-/*  Copyright 1996-2011 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,       */
 
 #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 "t1errors.h"
 
 
   /*************************************************************************/
                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;
 
     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 )
     {
-      error = T1_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
     width_table_length = FT_PEEK_USHORT_LE( p );
 
     if ( p + 2 > limit )
     {
-      error = T1_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
     p += 2;
     if ( p + 4 * fi->NumKernPair > limit )
     {
-      error = T1_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
     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;
 
 
       }
     }
 
-    if ( error == T1_Err_Unknown_File_Format )
+    if ( FT_ERR_EQ( error, Unknown_File_Format ) )
     {
       FT_Byte*  start = stream->cursor;
 
 
 
     if ( !fi )
-      return T1_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     for ( i = 0; i < fi->NumTrackKern; i++ )
     {
       }
     }
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
index e35d7b1..2602bdb 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 driver interface (body).                                      */
 /*                                                                         */
-/*  Copyright 1996-2004, 2006, 2007, 2009, 2011 by                         */
+/*  Copyright 1996-2004, 2006, 2007, 2009, 2011, 2013, 2014 by             */
 /*  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 );
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   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++ )
     {
-      gname = face->type1.glyph_names[i];
+      FT_String*  gname = face->type1.glyph_names[i];
+
 
       if ( !ft_strcmp( glyph_name, gname ) )
         return (FT_UInt)i;
   {
     *afont_info = ((T1_Face)face)->type1.font_info;
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   {
     *afont_extra = ((T1_Face)face)->type1.font_extra;
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   {
     *afont_private = ((T1_Face)face)->type1.private_dict;
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
       break;
 
     case PS_DICT_FONT_NAME:
-      retval = ft_strlen( type1->font_name ) + 1;
+      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_CHAR_STRING_KEY:
       if ( idx < (FT_UInt)type1->num_glyphs )
       {
-        retval = ft_strlen( type1->glyph_names[idx] ) + 1;
+        retval = (FT_Long)( ft_strlen( type1->glyph_names[idx] ) + 1 );
         if ( value && value_len >= retval )
         {
           ft_memcpy( value, (void *)( type1->glyph_names[idx] ), retval );
     case PS_DICT_CHAR_STRING:
       if ( idx < (FT_UInt)type1->num_glyphs )
       {
-        retval = type1->charstrings_len[idx] + 1;
+        retval = (FT_Long)( type1->charstrings_len[idx] + 1 );
         if ( value && value_len >= retval )
         {
           ft_memcpy( value, (void *)( type1->charstrings[idx] ),
       if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY &&
            idx < (FT_UInt)type1->encoding.num_chars       )
       {
-        retval = ft_strlen( type1->encoding.char_name[idx] ) + 1;
+        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] ),
     case PS_DICT_SUBR:
       if ( idx < (FT_UInt)type1->num_subrs )
       {
-        retval = type1->subrs_len[idx] + 1;
+        retval = (FT_Long)( type1->subrs_len[idx] + 1 );
         if ( value && value_len >= retval )
         {
           ft_memcpy( value, (void *)( type1->subrs[idx] ), retval - 1 );
       break;
 
     case PS_DICT_VERSION:
-      retval = ft_strlen( type1->font_info.version ) + 1;
+      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_strlen( type1->font_info.notice ) + 1;
+      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_strlen( type1->font_info.full_name ) + 1;
+      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_strlen( type1->font_info.family_name ) + 1;
+      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_strlen( type1->font_info.weight ) + 1;
+      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;
       if ( value && value_len >= retval )
         *((FT_Long *)value) = type1->font_info.italic_angle;
       break;
-
-    default:
-      break;
     }
 
     return retval;
                       right_glyph,
                       kerning );
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     T1_GlyphSlot_Init,
     T1_GlyphSlot_Done,
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    ft_stub_set_char_sizes,
-    ft_stub_set_pixel_sizes,
-#endif
     T1_Load_Glyph,
 
 #ifdef T1_CONFIG_OPTION_NO_AFM
index 80e5453..af102fd 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 Glyph Loader (body).                                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by */
+/*  Copyright 1996-2006, 2008-2010, 2013, 2014 by                          */
 /*  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;
-    FT_Error  error = T1_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
     FT_Incremental_InterfaceRec *inc =
     for ( glyph_index = 0; glyph_index < type1->num_glyphs; glyph_index++ )
     {
       /* now get load the unscaled outline */
-      error = T1_Parse_Glyph( &decoder, glyph_index );
+      (void)T1_Parse_Glyph( &decoder, glyph_index );
       if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance )
         *max_advance = decoder.builder.advance.x;
 
 
     psaux->t1_decoder_funcs->done( &decoder );
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
       for ( nn = 0; nn < count; nn++ )
         advances[nn] = 0;
 
-      return T1_Err_Ok;
+      return FT_Err_Ok;
     }
 
     error = psaux->t1_decoder_funcs->init( &decoder,
         advances[nn] = 0;
     }
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     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;
     }
 
+    FT_TRACE1(( "T1_Load_Glyph: glyph index %d\n", glyph_index ));
+
     FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) );
 
     if ( load_flags & FT_LOAD_NO_RECURSE )
index a0adfd4..22b3f6b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 font loader (body).                                           */
 /*                                                                         */
-/*  Copyright 1996-2012 by                                                 */
+/*  Copyright 1996-2014 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #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      */
   {
     PS_Blend   blend;
     FT_Memory  memory = face->root.memory;
-    FT_Error   error  = T1_Err_Ok;
+    FT_Error   error  = FT_Err_Ok;
 
 
     blend = face->blend;
 
         /* 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;
 
 
         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->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;
     return error;
 
   Fail:
-    error = T1_Err_Invalid_File_Format;
+    error = FT_THROW( Invalid_File_Format );
     goto Exit;
   }
 
     FT_Error  error;
 
 
-    error = T1_Err_Invalid_Argument;
+    error = FT_THROW( Invalid_Argument );
 
     if ( blend )
     {
         axis->maximum = map->design_points[map->num_points - 1];
       }
 
-      error = T1_Err_Ok;
+      error = FT_Err_Ok;
     }
 
     return error;
     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] ) +
-                 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] );
 
     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[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' );
     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 */
-      error = T1_Err_Ok;
-
       for ( n = 0; n < blend->num_designs; n++ )
       {
         FT_Fixed  result = 0x10000L;  /* 1.0 fixed */
 
           /* 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;
         blend->weight_vector[n] = result;
       }
 
-      error = T1_Err_Ok;
+      error = FT_Err_Ok;
     }
 
     return error;
     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 */
      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 )
       /* 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] );
 
       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 );
-      blend->default_weight_vector = 0;
+      blend->default_weight_vector = NULL;
 
       /* release axis names */
       for ( n = 0; n < num_axis; n++ )
   {
     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;
 
                      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 ));
-      error = T1_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       len = token->limit - token->start;
       if ( len == 0 )
       {
-        error = T1_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         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 );
-      name[len] = 0;
+      name[len] = '\0';
     }
 
   Exit:
     FT_Int       num_axis;
     T1_Parser    parser = &loader->parser;
 
-    FT_Error     error = T1_Err_Ok;
+    FT_Error     error = FT_Err_Ok;
     PS_Blend     blend;
 
 
                      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 )
       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;
     }
 
             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;
           }
 
         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;
         }
 
   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_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 ));
-      error = T1_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       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;
       }
 
   {
     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_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 )
       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;
     }
 
                  " /BlendDesignPosition and /WeightVector have\n"
                  "                    "
                  " different number of elements\n" ));
-      error = T1_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       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
-      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;
   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_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;
   }
 
 
     result = T1_ToFixedArray( parser, 6, temp, 3 );
 
-    if ( result < 0 )
+    if ( result < 6 )
     {
-      parser->root.error = T1_Err_Invalid_File_Format;
+      parser->root.error = FT_THROW( Invalid_File_Format );
       return;
     }
 
     if ( temp_scale == 0 )
     {
       FT_ERROR(( "t1_parse_font_matrix: invalid font matrix\n" ));
-      parser->root.error = T1_Err_Invalid_File_Format;
+      parser->root.error = FT_THROW( Invalid_File_Format );
       return;
     }
 
     /* 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 )
     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;
     }
 
         char*  notdef = (char *)".notdef";
 
 
-        T1_Add_Table( char_table, n, notdef, 8 );
+        (void)T1_Add_Table( char_table, n, notdef, 8 );
       }
 
       /* Now we need to read records of the form                */
           {
             charcode = (FT_Int)T1_ToInt( parser );
             T1_Skip_Spaces( parser );
+
+            /* protect against invalid charcode */
+            if ( cur == parser->root.cursor )
+            {
+              parser->root.error = FT_THROW( Unknown_File_Format );
+              return;
+            }
           }
 
           cur = parser->root.cursor;
 
-          if ( *cur == '/' && cur + 2 < limit && n < count )
+          if ( cur + 2 < limit && *cur == '/' && n < count )
           {
             FT_PtrDist  len;
 
 
             parser->root.cursor = cur;
             T1_Skip_PS_Token( parser );
+            if ( parser->root.cursor >= limit )
+              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.                                             */
-            parser->root.error = FT_Err_Unknown_File_Format;
+            parser->root.error = FT_THROW( Unknown_File_Format );
             return;
           }
         }
         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 != ']'               )
-        parser->root.error = T1_Err_Invalid_File_Format;
+        parser->root.error = FT_THROW( Invalid_File_Format );
       return;
     }
 
       FT_Byte*  base;
 
 
-      /* 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 )
+      /* 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 );
 
-      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' */
         /* 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;
         }
 
 
 
     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 )
       }
 
       T1_Skip_PS_Token( parser );
+      if ( parser->root.cursor >= limit )
+      {
+        error = FT_THROW( Invalid_File_Format );
+        goto Fail;
+      }
       if ( parser->root.error )
         return;
 
         FT_PtrDist  len;
 
 
-        if ( cur + 1 >= limit )
+        if ( cur + 2 >= limit )
         {
-          error = T1_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           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 */
 
           if ( size <= face->type1.private_dict.lenIV )
           {
-            error = T1_Err_Invalid_File_Format;
+            error = FT_THROW( Invalid_File_Format );
             goto Fail;
           }
 
 
     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;
 
 
 
         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;
       }
 
 
 
         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;
       }
 
 
               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;
               }
                 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;
                 }
       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" ));
-        error = T1_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
       }
 
     loader.charstrings.init  = 0;
     if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )
     {
       FT_Int    charcode, idx, min_char, max_char;
-      FT_Byte*  char_name;
       FT_Byte*  glyph_name;
 
 
       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";
 
index b685f2f..e11770f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 objects manager (body).                                       */
 /*                                                                         */
-/*  Copyright 1996-2009, 2011 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,       */
@@ -95,7 +95,7 @@
   T1_Size_Init( FT_Size  t1size )      /* T1_Size */
   {
     T1_Size            size  = (T1_Size)t1size;
-    FT_Error           error = T1_Err_Ok;
+    FT_Error           error = FT_Err_Ok;
     PSH_Globals_Funcs  funcs = T1_Size_Get_Globals_Funcs( size );
 
 
                         size->root.metrics.y_scale,
                         0, 0 );
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     if ( !psaux )
     {
       FT_ERROR(( "T1_Face_Init: cannot access `psaux' module\n" ));
-      error = T1_Err_Missing_Module;
+      error = FT_THROW( Missing_Module );
       goto Exit;
     }
 
     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;
     }
 
       root->num_glyphs = type1->num_glyphs;
       root->face_index = 0;
 
-      root->face_flags = FT_FACE_FLAG_SCALABLE    |
-                         FT_FACE_FLAG_HORIZONTAL  |
-                         FT_FACE_FLAG_GLYPH_NAMES |
-                         FT_FACE_FLAG_HINTER;
+      root->face_flags |= FT_FACE_FLAG_SCALABLE    |
+                          FT_FACE_FLAG_HORIZONTAL  |
+                          FT_FACE_FLAG_GLYPH_NAMES |
+                          FT_FACE_FLAG_HINTER;
 
       if ( info->is_fixed_pitch )
         root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
         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;
         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;
 
   {
     FT_UNUSED( driver );
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
index 4955279..ccf9f4c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 parser (body).                                                */
 /*                                                                         */
-/*  Copyright 1996-2005, 2008, 2009, 2012 by                               */
+/*  Copyright 1996-2005, 2008, 2009, 2012-2014 by                          */
 /*  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 ) )
     {
-      error = T1_Err_Ok;
+      error = FT_Err_Ok;
 
       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();
     }
     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 );
   {
     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_ERROR(( "T1_Get_Private_Dict:"
                    " invalid private dictionary section\n" ));
-        error = T1_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Fail;
       }
 
         error = read_pfb_tag( stream, &tag, &size );
         if ( error || tag != 0x8002U )
         {
-          error = T1_Err_Ok;
+          error = FT_Err_Ok;
           break;
         }
 
       /* dictionary block in the heap.                                 */
 
       /* first of all, look at the `eexec' keyword */
-      FT_Byte*  cur   = parser->base_dict;
-      FT_Byte*  limit = cur + parser->base_len;
-      FT_Byte   c;
+      FT_Byte*    cur   = parser->base_dict;
+      FT_Byte*    limit = cur + parser->base_len;
+      FT_Byte     c;
+      FT_Pointer  pos_lf;
+      FT_Bool     test_cr;
 
 
     Again:
       {
         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' &&
         {
           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;
         }
       }
       /* 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;
       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  */
+      /* According to the Type 1 spec, the first cipher byte must not be */
       /* an ASCII whitespace character code (blank, tab, carriage return */
       /* or line feed).  We have seen Type 1 fonts with two line feed    */
       /* characters...  So skip now all whitespace character codes.      */
-      while ( cur < limit       &&
-              ( *cur == ' '  ||
-                *cur == '\t' ||
-                *cur == '\r' ||
-                *cur == '\n' ) )
+      /*                                                                 */
+      /* On the other hand, Adobe's Type 1 parser handles fonts just     */
+      /* fine that are violating this limitation, so we add a heuristic  */
+      /* test to stop at \r only if it is not used for EOL.              */
+
+      pos_lf  = ft_memchr( cur, '\n', limit - cur );
+      test_cr = FT_BOOL( !pos_lf                                      ||
+                         pos_lf > ft_memchr( cur, '\r', limit - cur ) );
+
+      while ( cur < limit                    &&
+              ( *cur == ' '                ||
+                *cur == '\t'               ||
+                (test_cr && *cur == '\r' ) ||
+                *cur == '\n'               ) )
         ++cur;
       if ( cur >= limit )
       {
         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;
       }
 
-      size = parser->base_len - ( cur - parser->base_dict );
+      size = (FT_ULong)( parser->base_len - ( cur - parser->base_dict ) );
 
       if ( parser->in_memory )
       {
       /* 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_ERROR(( "T1_Get_Private_Dict:"
                  " invalid private dictionary section\n" ));
-      error = T1_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Fail;
     }
 
index 9b93209..3ad1bde 100644 (file)
@@ -4,7 +4,8 @@
 /*                                                                         */
 /*    High-level Type 42 driver interface (body).                          */
 /*                                                                         */
-/*  Copyright 2002-2004, 2006, 2007, 2009, 2011 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      */
@@ -63,7 +64,7 @@
   {
     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 )
   {
-    FT_Int      i;
-    FT_String*  gname;
+    FT_Int  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] );
   {
     *afont_info = ((T42_Face)face)->type1.font_info;
 
-    return T42_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   {
     *afont_extra = ((T42_Face)face)->type1.font_extra;
 
-    return T42_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   {
     *afont_private = ((T42_Face)face)->type1.private_dict;
 
-    return T42_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     T42_GlyphSlot_Init,
     T42_GlyphSlot_Done,
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    ft_stub_set_char_sizes,
-    ft_stub_set_pixel_sizes,
-#endif
     T42_GlyphSlot_Load,
 
     0,                 /* FT_Face_GetKerningFunc  */
index c6053af..915e81f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 42 objects manager (body).                                      */
 /*                                                                         */
-/*  Copyright 2002-2009, 2011                                              */
+/*  Copyright 2002-2009, 2011, 2013                                        */
 /*  by Roberto Alameda.                                                    */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
     if ( FT_ALLOC( face->ttf_data, 12 ) )
       goto Exit;
 
+    /* while parsing the font we always update `face->ttf_size' so that */
+    /* even in case of buggy data (which might lead to premature end of */
+    /* scanning without causing an error) the call to `FT_Open_Face' in */
+    /* `T42_Face_Init' passes the correct size                          */
+    face->ttf_size = 12;
+
     error = t42_parser_init( parser,
                              face->root.stream,
                              memory,
@@ -63,7 +69,7 @@
     {
       FT_ERROR(( "T42_Open_Face: cannot handle FontType %d\n",
                  type1->font_type ));
-      error = T42_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
@@ -74,7 +80,7 @@
     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;
@@ -93,7 +99,6 @@
     if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )
     {
       FT_Int    charcode, idx, min_char, max_char;
-      FT_Byte*  char_name;
       FT_Byte*  glyph_name;
 
 
       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";
 
 
     FT_UNUSED( num_params );
     FT_UNUSED( params );
-    FT_UNUSED( face_index );
     FT_UNUSED( stream );
 
 
     if ( !psaux )
     {
       FT_ERROR(( "T42_Face_Init: cannot access `psaux' module\n" ));
-      error = T42_Err_Missing_Module;
+      error = FT_THROW( Missing_Module );
       goto Exit;
     }
 
     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;
     }
 
     root->num_charmaps = 0;
     root->face_index   = 0;
 
-    root->face_flags = FT_FACE_FLAG_SCALABLE    |
-                       FT_FACE_FLAG_HORIZONTAL  |
-                       FT_FACE_FLAG_GLYPH_NAMES;
+    root->face_flags |= FT_FACE_FLAG_SCALABLE    |
+                        FT_FACE_FLAG_HORIZONTAL  |
+                        FT_FACE_FLAG_GLYPH_NAMES;
 
     if ( info->is_fixed_pitch )
       root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
       FT_Open_Args  args;
 
 
-      args.flags       = FT_OPEN_MEMORY;
+      args.flags       = FT_OPEN_MEMORY | FT_OPEN_DRIVER;
+      args.driver      = FT_Get_Module( FT_FACE_LIBRARY( face ),
+                                        "truetype" );
       args.memory_base = face->ttf_data;
       args.memory_size = face->ttf_size;
 
         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;
 
     if ( !ttmodule )
     {
       FT_ERROR(( "T42_Driver_Init: cannot access `truetype' module\n" ));
-      return T42_Err_Missing_Module;
+      return FT_THROW( Missing_Module );
     }
 
     driver->ttclazz = (FT_Driver_Class)ttmodule->clazz;
 
-    return T42_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
     FT_Face   face    = size->face;
     T42_Face  t42face = (T42_Face)face;
     FT_Size   ttsize;
-    FT_Error  error   = T42_Err_Ok;
+    FT_Error  error;
 
 
     error = FT_New_Size( t42face->ttf_face, &ttsize );
     FT_Face        face    = t42slot->face;
     T42_Face       t42face = (T42_Face)face;
     FT_GlyphSlot   ttslot;
-    FT_Error       error   = T42_Err_Ok;
+    FT_Error       error   = FT_Err_Ok;
 
 
     if ( face->glyph == NULL )
     FT_Driver_Class  ttclazz = ((T42_Driver)glyph->face->driver)->ttclazz;
 
 
+    FT_TRACE1(( "T42_GlyphSlot_Load: glyph index %d\n", glyph_index ));
+
     t42_glyphslot_clear( t42slot->ttslot );
     error = ttclazz->load_glyph( t42slot->ttslot,
                                  t42size->ttsize,
index 468b463..5070853 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 42 font parser (body).                                          */
 /*                                                                         */
-/*  Copyright 2002-2012 by                                                 */
+/*  Copyright 2002-2014 by                                                 */
 /*  Roberto Alameda.                                                       */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
                    FT_Memory      memory,
                    PSAux_Service  psaux )
   {
-    FT_Error  error = T42_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_Long   size;
 
 
     if ( ft_memcmp( stream->cursor, "%!PS-TrueTypeFont", 17 ) != 0 )
     {
       FT_TRACE2(( "  not a Type42 font\n" ));
-      error = T42_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
     }
 
     FT_FRAME_EXIT();
     FT_Face     root   = (FT_Face)&face->root;
     FT_Fixed    temp[6];
     FT_Fixed    temp_scale;
+    FT_Int      result;
 
 
-    (void)T1_ToFixedArray( parser, 6, temp, 3 );
+    result = T1_ToFixedArray( parser, 6, temp, 3 );
+
+    if ( result < 6 )
+    {
+      parser->root.error = FT_THROW( Invalid_File_Format );
+      return;
+    }
 
     temp_scale = FT_ABS( temp[3] );
 
+    if ( temp_scale == 0 )
+    {
+      FT_ERROR(( "t1_parse_font_matrix: invalid font matrix\n" ));
+      parser->root.error = FT_THROW( Invalid_File_Format );
+      return;
+    }
+
     /* 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 * 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 )
       temp[2] = FT_DivFix( temp[2], temp_scale );
       temp[4] = FT_DivFix( temp[4], temp_scale );
       temp[5] = FT_DivFix( temp[5], temp_scale );
-      temp[3] = 0x10000L;
+      temp[3] = temp[3] < 0 ? -0x10000L : 0x10000L;
     }
 
     matrix->xx = temp[0];
     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;
     }
 
     if ( ft_isdigit( *cur ) || *cur == '[' )
     {
       T1_Encoding  encode          = &face->type1.encoding;
-      FT_UInt      count, n;
+      FT_Int       count, n;
       PS_Table     char_table      = &loader->encoding_table;
       FT_Memory    memory          = parser->root.memory;
       FT_Error     error;
         parser->root.cursor++;
       }
       else
-        count = (FT_UInt)T1_ToInt( parser );
+        count = (FT_Int)T1_ToInt( parser );
 
       T1_Skip_Spaces( parser );
       if ( parser->root.cursor >= limit )
         char*  notdef = (char *)".notdef";
 
 
-        T1_Add_Table( char_table, n, notdef, 8 );
+        (void)T1_Add_Table( char_table, n, notdef, 8 );
       }
 
       /* Now we need to read records of the form                */
 
           cur = parser->root.cursor;
 
-          if ( *cur == '/' && cur + 2 < limit && n < count )
+          if ( cur + 2 < limit && *cur == '/' && n < count )
           {
             FT_PtrDist  len;
 
 
             parser->root.cursor = cur;
             T1_Skip_PS_Token( parser );
+            if ( parser->root.cursor >= limit )
+              return;
             if ( parser->root.error )
               return;
 
 
             n++;
           }
+          else if ( only_immediates )
+          {
+            /* Since the current position is not updated for           */
+            /* immediates-only mode we would get an infinite loop if   */
+            /* we don't do anything here.                              */
+            /*                                                         */
+            /* This encoding array is not valid according to the type1 */
+            /* 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_THROW( Unknown_File_Format );
+            return;
+          }
         }
         else
         {
         T1_Skip_Spaces( parser );
       }
 
-      face->type1.encoding_type  = T1_ENCODING_TYPE_ARRAY;
-      parser->root.cursor        = cur;
+      face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY;
+      parser->root.cursor       = cur;
     }
 
     /* Otherwise, we should have either `StandardEncoding', */
         face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1;
 
       else
-      {
-        FT_ERROR(( "t42_parse_encoding: invalid token\n" ));
-        parser->root.error = T42_Err_Invalid_File_Format;
-      }
+        parser->root.error = FT_THROW( Ignore );
     }
   }
 
     FT_Byte*    limit  = parser->root.limit;
     FT_Error    error;
     FT_Int      num_tables = 0;
-    FT_ULong    count, ttf_size = 0;
+    FT_ULong    count;
 
     FT_Long     n, string_size, old_string_size, real_size;
     FT_Byte*    string_buf = NULL;
     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;
     }
 
 
         /* don't include delimiters */
         string_size = (FT_Long)( ( parser->root.cursor - cur - 2 + 1 ) / 2 );
+        if ( !string_size )
+        {
+          FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" ));
+          error = FT_THROW( Invalid_File_Format );
+          goto Fail;
+        }
         if ( FT_REALLOC( string_buf, old_string_size, string_size ) )
           goto Fail;
 
         {
           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;
         }
 
         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;
         }
 
 
         if ( limit - parser->root.cursor < string_size )
         {
-          FT_ERROR(( "t42_parse_sfnts: too many binary data\n" ));
-          error = T42_Err_Invalid_File_Format;
+          FT_ERROR(( "t42_parse_sfnts: too much binary data\n" ));
+          error = FT_THROW( Invalid_File_Format );
           goto Fail;
         }
         else
       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;
       }
 
       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;
       }
 
           }
           else
           {
-            num_tables = 16 * face->ttf_data[4] + face->ttf_data[5];
-            status     = BEFORE_TABLE_DIR;
-            ttf_size   = 12 + 16 * num_tables;
+            num_tables     = 16 * face->ttf_data[4] + face->ttf_data[5];
+            status         = BEFORE_TABLE_DIR;
+            face->ttf_size = 12 + 16 * num_tables;
+
+            if ( (FT_ULong)( limit - parser->root.cursor ) < face->ttf_size )
+            {
+              FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" ));
+              error = FT_THROW( Invalid_File_Format );
+              goto Fail;
+            }
 
-            if ( FT_REALLOC( face->ttf_data, 12, ttf_size ) )
+            if ( FT_REALLOC( face->ttf_data, 12, face->ttf_size ) )
               goto Fail;
           }
           /* fall through */
 
         case BEFORE_TABLE_DIR:
           /* the offset table is read; read the table directory */
-          if ( count < ttf_size )
+          if ( count < face->ttf_size )
           {
             face->ttf_data[count++] = string_buf[n];
             continue;
               len = FT_PEEK_ULONG( p );
 
               /* Pad to a 4-byte boundary length */
-              ttf_size += ( len + 3 ) & ~3;
+              face->ttf_size += ( len + 3 ) & ~3;
             }
 
-            status         = OTHER_TABLES;
-            face->ttf_size = ttf_size;
+            status = OTHER_TABLES;
 
             /* there are no more than 256 tables, so no size check here */
             if ( FT_REALLOC( face->ttf_data, 12 + 16 * num_tables,
-                             ttf_size + 1 ) )
+                             face->ttf_size + 1 ) )
               goto Fail;
           }
           /* fall through */
 
         case OTHER_TABLES:
           /* all other tables are just copied */
-          if ( count >= ttf_size )
+          if ( count >= face->ttf_size )
           {
-            FT_ERROR(( "t42_parse_sfnts: too many binary data\n" ));
-            error = T42_Err_Invalid_File_Format;
+            FT_ERROR(( "t42_parse_sfnts: too much binary data\n" ));
+            error = FT_THROW( Invalid_File_Format );
             goto Fail;
           }
           face->ttf_data[count++] = string_buf[n];
     }
 
     /* 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;
     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;
     }
 
     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" ));
-      error = T42_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Fail;
     }
 
         break;
 
       T1_Skip_PS_Token( parser );
+      if ( parser->root.cursor >= limit )
+      {
+        FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
+        error = FT_THROW( Invalid_File_Format );
+        goto Fail;
+      }
       if ( parser->root.error )
         return;
 
         FT_PtrDist  len;
 
 
-        if ( cur + 1 >= limit )
+        if ( cur + 2 >= limit )
         {
           FT_ERROR(( "t42_parse_charstrings: out of bounds\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" ));
-          error = T42_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Fail;
         }
 
     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;
     }
 
 
     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;
 
index a551896..4705c53 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType font driver for Windows FNT/FON files                       */
 /*                                                                         */
-/*  Copyright 1996-2004, 2006-2012 by                                      */
+/*  Copyright 1996-2004, 2006-2014 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*  Copyright 2003 Huw D M Davies for Codeweavers                          */
 /*  Copyright 2007 Dmitry Timoshkov for Codeweavers                        */
 
     FT_FRAME_START( 248 ),
       FT_FRAME_ULONG_LE  ( magic ),   /* PE00 */
-      FT_FRAME_USHORT_LE ( machine ), /* 0x014c - i386 */
+      FT_FRAME_USHORT_LE ( machine ), /* 0x014C - i386 */
       FT_FRAME_USHORT_LE ( number_of_sections ),
       FT_FRAME_SKIP_BYTES( 12 ),
       FT_FRAME_USHORT_LE ( size_of_optional_header ),
       FT_FRAME_SKIP_BYTES( 2 ),
-      FT_FRAME_USHORT_LE ( magic32 ), /* 0x10b */
+      FT_FRAME_USHORT_LE ( magic32 ), /* 0x10B */
       FT_FRAME_SKIP_BYTES( 110 ),
       FT_FRAME_ULONG_LE  ( rsrc_virtual_address ),
       FT_FRAME_ULONG_LE  ( rsrc_size ),
          header->version != 0x300 )
     {
       FT_TRACE2(( "  not a Windows FNT file\n" ));
-      error = FNT_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
     if ( header->file_size < size )
     {
       FT_TRACE2(( "  not a Windows FNT file\n" ));
-      error = FNT_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
     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;
     }
 
          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 */
            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 ( !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;
         }
 
         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;
         }
 
 
         if ( face_index >= font_count )
         {
-          error = FNT_Err_Invalid_Argument;
+          error = FT_THROW( Invalid_Argument );
           goto Exit;
         }
         else if ( face_index < 0 )
                     pe32_header.rsrc_size ));
 
         if ( pe32_header.magic != WINFNT_PE_MAGIC /* check full signature */ ||
-             pe32_header.machine != 0x014c /* i386 */                        ||
-             pe32_header.size_of_optional_header != 0xe0 /* FIXME */         ||
-             pe32_header.magic32 != 0x10b                                    )
+             pe32_header.machine != 0x014C /* i386 */                        ||
+             pe32_header.size_of_optional_header != 0xE0 /* FIXME */         ||
+             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;
         }
 
         }
 
         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:
 
           if ( !(dir_entry1.offset & 0x80000000UL ) /* DataIsDirectory */ )
           {
-            error = FNT_Err_Invalid_File_Format;
+            error = FT_THROW( Invalid_File_Format );
             goto Exit;
           }
 
 
             if ( !(dir_entry2.offset & 0x80000000UL ) /* DataIsDirectory */ )
             {
-              error = FNT_Err_Invalid_File_Format;
+              error = FT_THROW( Invalid_File_Format );
               goto Exit;
             }
 
 
               if ( dir_entry2.offset & 0x80000000UL /* DataIsDirectory */ )
               {
-                error = FNT_Err_Invalid_File_Format;
+                error = FT_THROW( Invalid_File_Format );
                 goto Exit;
               }
 
       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 )
       {
-        error = FNT_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Exit;
       }
     }
 
 
   static FT_Error
-  fnt_cmap_init( FNT_CMap  cmap )
+  fnt_cmap_init( FNT_CMap    cmap,
+                 FT_Pointer  pointer )
   {
     FNT_Face  face = (FNT_Face)FT_CMAP_FACE( cmap );
     FNT_Font  font = face->font;
 
+    FT_UNUSED( pointer );
+
 
     cmap->first = (FT_UInt32)  font->header.first_char;
     cmap->count = (FT_UInt32)( font->header.last_char - cmap->first + 1 );
     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;
       if ( !error )
       {
         if ( face_index > 0 )
-          error = FNT_Err_Invalid_Argument;
+          error = FT_THROW( Invalid_Argument );
         else if ( face_index < 0 )
           goto Exit;
       }
 
       root->face_index = face_index;
 
-      root->face_flags = FT_FACE_FLAG_FIXED_SIZES |
-                         FT_FACE_FLAG_HORIZONTAL;
+      root->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
+                          FT_FACE_FLAG_HORIZONTAL;
 
       if ( font->header.avg_width == font->header.max_width )
         root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
       if ( font->header.last_char < font->header.first_char )
       {
         FT_TRACE2(( "invalid number of glyphs\n" ));
-        error = FNT_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Fail;
       }
 
       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;
                                    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;
-    FT_Error          error   = FNT_Err_Invalid_Pixel_Size;
+    FT_Error          error   = FT_ERR( Invalid_Pixel_Size );
     FT_Long           height;
 
 
     {
     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 )
-        error = FNT_Err_Ok;
+        error = FT_Err_Ok;
       break;
 
     default:
-      error = FNT_Err_Unimplemented_Feature;
+      error = FT_THROW( Unimplemented_Feature );
       break;
     }
 
   {
     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;
 
     if ( !face )
     {
-      error = FNT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Face_Handle );
       goto Exit;
     }
 
     font = face->font;
 
-    if ( !font ||
+    if ( !font                                                   ||
          glyph_index >= (FT_UInt)( FT_FACE( face )->num_glyphs ) )
     {
-      error = FNT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
+    FT_TRACE1(( "FNT_Load_Glyph: glyph index %d\n", glyph_index ));
+
     if ( glyph_index > 0 )
       glyph_index--;                           /* revert to real index */
     else
-      glyph_index = font->header.default_char; /* the .notdef glyph */
+      glyph_index = font->header.default_char; /* the `.notdef' glyph  */
 
     new_format = FT_BOOL( font->header.version == 0x300 );
     len        = new_format ? 6 : 4;
 
-    /* jump to glyph entry */
-    p = font->fnt_frame + ( new_format ? 148 : 118 ) + len * glyph_index;
+    /* get glyph width and offset */
+    offset = ( new_format ? 148 : 118 ) + len * glyph_index;
+
+    if ( offset >= font->header.file_size - 2 - ( new_format ? 4 : 2 ) )
+    {
+      FT_TRACE2(( "invalid FNT offset\n" ));
+      error = FT_THROW( Invalid_File_Format );
+      goto Exit;
+    }
+
+    p = font->fnt_frame + offset;
 
     bitmap->width = FT_NEXT_SHORT_LE( p );
 
+    /* jump to glyph entry */
     if ( new_format )
       offset = FT_NEXT_ULONG_LE( p );
     else
     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;
     }
 
       bitmap->rows       = font->header.pixel_height;
       bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
 
-      if ( offset + pitch * bitmap->rows >= font->header.file_size )
+      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;
       }
 
     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
     FNT_Load_Glyph,
 
     0,                    /* FT_Face_GetKerningFunc  */
index 1aa83e7..8d8fdf7 100644 (file)
@@ -1,6 +1,6 @@
 $! make Freetype2 under OpenVMS
 $!
-$! Copyright 2003, 2004, 2006, 2007 by
+$! Copyright 2003, 2004, 2006, 2007, 2013 by
 $! David Turner, Robert Wilhelm, and Werner Lemberg.
 $!
 $! This file is part of the FreeType project, and may only be used, modified,
@@ -172,7 +172,7 @@ $ deck
 
 
 all :
-        define freetype [--.include.freetype]
+        define freetype [--.include]
         define psaux [-.psaux]
         define autofit [-.autofit]
         define autohint [-.autohint]